Fix Claude Code "The response above may be incomplete"
Claude Code "The response above may be incomplete" means the stream broke mid-response; finished blocks were kept. The prefix names the cause. Send continue.
API Error: Server error mid-response. The response above may be incomplete.API Error: Connection lost mid-response. The response above may be incomplete.API Error: Your computer went to sleep mid-response. The response above may be incomplete.API Error: The response stopped arriving. The response above may be incomplete.API Error: Part of the response never arrived. The response above may be incomplete.API Error: The response stream was malformed. The response above may be incomplete.The stream broke after Claude had already finished at least one block of text or a tool call. Re-sending the request could run the same tool calls twice, so Claude Code does not retry: it keeps the completed output and appends this notice. Check what is left on screen, then send continue.
If the connection breaks before anything has been produced (including when only thinking has finished), Claude Code retries on its own and, if that fails, ends with a different message. That case is covered in Connection lost before a response was produced.
[1] Read the prefix to find the cause (per the official docs).
| Prefix | Meaning | Where to look |
|---|---|---|
Server error mid-response | An overloaded or 5xx server error arrived mid-stream | status.claude.com · 500 Internal server error |
Connection lost mid-response | The connection dropped. Also shown when a proxy or gateway ends the response body cleanly before the response has finished | Network, proxy |
Your computer went to sleep mid-response | The computer slept while streaming. After waking, Claude Code treats the connection as broken and stops reading it | Sleep settings |
The response stopped arriving | The connection stayed open but stopped delivering data, so the streaming idle watchdog aborted it | Stream idle timeout |
Part of the response never arrived | A stream event was dropped between the API and Claude Code, so a later event referenced missing content | Proxies in between |
The response stream was malformed | An event arrived for an already finished block, or arrived damaged (not valid JSON, missing content, or content that doesn't match its type) | Proxies in between |
For the sleep case the docs give the cause but no separate fix. Before leaving a long task running, make sure the machine will not go to sleep.
[2] Check claude --version, because the wording depends on the version.
| Version | Difference |
|---|---|
| Before v2.1.227 | Connection closed mid-response (now Connection lost) · Response stalled mid-stream (now stopped arriving) |
| Before v2.1.199 | A mid-stream server error discarded the partial output and reported the whole turn as an error |
| Before v2.1.222 | The notice also appeared for drops after the response had finished. On ANTHROPIC_BASE_URL or ANTHROPIC_AWS_BASE_URL gateways, The response stopped arriving could fire while keep-alive pings were still arriving |
| Before v2.1.281 | API Error: Content block not found instead of Part of the response never arrived |
| Before v2.1.284 | A damaged event showed the raw parser error, such as one starting API Error: JSON Parse error |
If The response stopped arriving keeps appearing behind a gateway on a version below v2.1.222, update first. The docs say upgrading stops those spurious timeouts on those routes.
[3] In an interactive session, read what remains first. Every completed block is kept, but an interrupted final block is discarded when the turn ends, so the last sentences or a tool call may be missing. Tool calls Claude finished were run, and the turn continued from their results. Then type continue. Claude picks up from its last completed block; confirm that any dropped step, such as a file edit, actually happens this time.
[4] In -p scripts, what you get depends on the output format.
| Output format | What remains |
|---|---|
| Default text | The last completed text block Claude Code still holds from the turn, followed by this message. If it holds none (for example after a mid-turn compaction cleared it), the message alone |
--output-format json or stream-json | This message in the result field |
In non-interactive sessions (-p, Agent SDK, cloud sessions), when the cut-off response in the main conversation has text but no tool calls, Claude Code prompts Claude to continue up to three times in a row and shows the notice only after that (v2.1.246 and later). Subagents get the same treatment (v2.1.257 and later).
[5] In a script, catch the message and resume the session. The docs' approach is to resume once the connection is stable and send continue.
$ out=$(claude -p "Review this codebase for performance issues" --output-format json)$ if echo "$out" | jq -r '.result' | grep -q "The response above may be incomplete"; then claude -p "continue" --resume "$(echo "$out" | jq -r '.session_id')"; fiTo pick up the most recent conversation, claude -p "continue" --continue also works.
[6] If the turn ended with API Error: Content block not found, Content block already closed or Stream event unreadable and no notice, an event was dropped, duplicated or damaged before anything had completed. Normally Claude Code re-sends without streaming; with that fallback turned off by CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK, the turn ends with these messages instead. Unless you turned it off on purpose because your gateway's non-streaming route is broken, remove the variable from your shell and from env in settings.json, then send the message again.