GrepBoard/Manuals
605 manuals ·

Fix Claude Code "The response above may be incomplete"

·Tested on Claude Code official docs · 2026-10·Test scope ↓·6 steps

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.

output
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).

PrefixMeaningWhere to look
Server error mid-responseAn overloaded or 5xx server error arrived mid-streamstatus.claude.com · 500 Internal server error
Connection lost mid-responseThe connection dropped. Also shown when a proxy or gateway ends the response body cleanly before the response has finishedNetwork, proxy
Your computer went to sleep mid-responseThe computer slept while streaming. After waking, Claude Code treats the connection as broken and stops reading itSleep settings
The response stopped arrivingThe connection stayed open but stopped delivering data, so the streaming idle watchdog aborted itStream idle timeout
Part of the response never arrivedA stream event was dropped between the API and Claude Code, so a later event referenced missing contentProxies in between
The response stream was malformedAn 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.

VersionDifference
Before v2.1.227Connection closed mid-response (now Connection lost) · Response stalled mid-stream (now stopped arriving)
Before v2.1.199A mid-stream server error discarded the partial output and reported the whole turn as an error
Before v2.1.222The 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.281API Error: Content block not found instead of Part of the response never arrived
Before v2.1.284A 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 formatWhat remains
Default textThe 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-jsonThis 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.

console
$ 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')"; fi

To 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.

#claude-code#streaming#api-error#headless