"API Error: The response stopped arriving" means that, partway through a streaming response, data stopped coming in even though the connection was still open, and Claude Code's own watchdog timer cut that connection off. Any output that finished before that point is still on screen. In an interactive session, reply continue and Claude picks up from the last completed point.
API Error: The response stopped arriving. The response above may be incomplete.
Before v2.1.227, this message read Response stalled mid-stream. The official error reference states the rename explicitly, and what is happening is the same. When you look for information or bug reports written under the old wording, search for both strings.
Look first at the wording after "API Error:"
"Stopped" and "cut off" messages are worded differently for each cause
Output had started, then data stopped while the connection stayed open
Output had started, then the connection itself dropped
Thinking finished, then it stalled before any output began
The response ended with no usable data, so it was resent without streaming
Table of contents
- 1. What the message means—silence, not a disconnect
- 2. Renamed from "Response stalled mid-stream" in v2.1.227
- 3. How it differs from similar messages
- 4. What happens to the work done so far
- 5. Causes—what is documented and what is reported
- 6. What to do when it stops
- 7. Confirming that it is fixed
- 8. What to record when you report it
- 9. What is confirmed and what is not
- 10. Summary
- FAQ
1. What the message means—silence, not a disconnect
Claude Code's official error reference explains this message as follows: the connection stayed open but stopped delivering data, so the streaming idle watchdog cut it off. It is not an error body returned by the API; it is a note that Claude Code itself attaches while receiving the response.
Even for "it stopped partway," Claude Code words the message differently depending on the cause. The official reference lists the four below, all ending with the same "The response above may be incomplete."
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.
The first line appears when the server returns an overload or 5xx error partway through the response, the second when the connection drops, and the third when your computer goes to sleep mid-response. Only the fourth, the message this article covers, means that data stopped coming even though there was neither an error nor a disconnect.
Four watchdog timers do the cutting off
According to the official network configuration documentation, Claude Code has four timers that abort a stream that has gone quiet, so that a dead connection fails instead of hanging indefinitely. The first three in the table below apply once the response has started streaming.
| Timer | When it cuts off | Default time |
|---|---|---|
| Byte-level watchdog | Not a single byte arrives on the wire (not even SSE keep-alives) | 180 seconds when connecting directly to the Anthropic API, 300 seconds otherwise |
| Event-level watchdog | No response event can be parsed | 300 seconds (all providers) |
| Body idle timeout | No bytes arrive for 5 minutes | 5 minutes (except for the direct Anthropic API and Claude Platform on AWS) |
| First-byte deadline | After sending, no response headers arrive at all | 180 seconds on the direct API, 300 seconds otherwise (plus 1 second per 32 KB of request body). Produces No response from API, not this message |
If you connect directly to the Anthropic API, the threshold to keep in mind is the byte-level watchdog's 180 seconds. In other words, the screen appears frozen for a few minutes before this message shows up. According to the official reference, when a request is still alive but no data has arrived for 20 seconds, the following banner appears first. It means "this has not failed yet," and the countdown runs to the moment the connection would be cut off (before v2.1.185 the threshold was 10 seconds and the wording was different).
Waiting for API response · will retry in … · check your network
If data resumes, the banner goes away on its own. This article's message appears when it does not go away, the timer runs out, and part of the output had already been completed.
2. Renamed from "Response stalled mid-stream" in v2.1.227
Right after describing the four messages, the official error reference says that before v2.1.227, Connection lost mid-response was shown as Connection closed mid-response and The response stopped arriving was shown as Response stalled mid-stream. The same release also relabeled the message for stalls before any output begins.
| Message before v2.1.227 | Current message | Article on this site |
|---|---|---|
Response stalled mid-stream | The response stopped arriving | This article |
Response stalled while thinking, before producing a response | The response stalled before a response was produced | Section 3 of this article |
Connection closed mid-response | Connection lost mid-response | The closed and lost articles (linked below) |
A case where the old Response stalled mid-stream message appeared together with the model repeating the same word over and over is covered in our article on Response stalled mid-stream and the endless "court" loop. For the disconnect-side message, reports from the old-wording era are in the Connection closed mid-response article, and the renamed wording is explained in the Connection lost mid-response article.
A clue to your version
If you see stopped arriving, your Claude Code is v2.1.227 or later. If you see stalled mid-stream, it is an older version.
Not in the CHANGELOG
On September 22, 2026, we read the v2.1.227 entry in the official CHANGELOG, and the wording change was not mentioned. It was published to npm on August 10, 2026 (UTC).
Search reports under both strings
The same phenomenon has been reported under two names. When you search GitHub issues, try both the old and the new wording.
Before v2.1.222, it may be a false alarm
According to the official reference, Claude Code before v2.1.222 had two kinds of false alarms. One: with gateways routed through ANTHROPIC_BASE_URL or ANTHROPIC_AWS_BASE_URL, it counted only parsed events and cut off the stream even while the server's keep-alives were arriving. The other: it also showed this note when the connection stalled after the response had finished, treating a complete response as an error. If claude --version reports anything lower than 2.1.222, update first.
3. How it differs from similar messages
Which message you get depends on how far the response had progressed when it stopped. Laying out the official "Automatic retries" explanation along the progress of a response gives the following.
The later it stops, the more output is kept and the less is retried automatically
① Waiting for headers
Response headers do not arrive within the deadline. Retried at most once
No response from API
② Nothing completed yet
Headers arrived but no content followed, or thinking finished and it stalled before output. Retried at most once, separately from the usual 10; if it stalls again after thinking, it ends with the message below
The response stalled before a response was produced
③ After a block completed
It stopped after completing one block of text or one tool call (including after thinking finished and writing began). Not retried
The response stopped arriving (this article)
④ After the response completed
The complete response is kept and the turn ends normally. No note is shown
No message (v2.1.222 and later)
The reason ③ is not retried is also documented. Resending the request after a block of text or a tool call has completed could run the same tool call twice. So Claude Code keeps what was completed and attaches a note instead of discarding the turn.
| Message | What is happening | Output kept and retries |
|---|---|---|
The response stopped arriving | Data stopped while the connection stayed open | Completed output is kept. Not retried |
Connection lost mid-response | The connection itself dropped | Completed output is kept. Not retried |
Server error mid-response | The server returned an overload or 5xx partway through | Completed output is kept (v2.1.199 and later). Not retried |
The response stalled before a response was produced | Stalled twice in a row after thinking finished and before output began | No output is kept. Shown after one retry |
No response from API | No response headers arrived within the deadline | No output is kept. Shown after one retry |
Streaming response ended before any complete data was received | The response ended without any usable data | Automatically resent without streaming (warning only) |
The difference from Connection lost mid-response: a disconnect or silence
Both appear after some output has been produced, and both keep the output and let you resume with continue. What differs is how it stopped. Lost is a judgment that the connection was lost, so suspect a brief drop in your own network, a VPN reconnecting, or a device along the path cutting the connection. Stopped arriving is a judgment that the connection is still there but nothing is flowing through it, and it is cut off only after waiting out the watchdog timer. That is why the timer tuning covered in section 6 can only help on the stopped arriving side.
The difference from Streaming response ended…: stopped or ended empty
According to the official reference, Streaming response ended before any complete data was received is a warning shown when a response ended without delivering any usable data. Claude Code stops streaming, resends the same request, and continues the turn. The warning appears only once per interactive session (before v2.1.239 it resent silently). The reference says a common cause is a proxy or gateway along the path consuming or transforming the response body. Stopped arriving is a response that got partway and then stopped, and it is not resent automatically.
4. What happens to the work done so far
According to the official explanation, Claude Code keeps every completed block and discards the last, unfinished block at the end of the turn. That is why the last few sentences on screen, or the last tool call, may be missing. Tool calls that had completed are executed, and the turn continues from their results. What happens after the stop depends on the environment it runs in.
Interactive sessions
Read the response left on screen and reply continue; it resumes from the last completed block. Giving your instructions again from the start risks repeating operations that already ran.
-p, Agent SDK, and cloud sessions
If the stopped response is text only and contains no tool call, Claude Code prompts itself to continue. It tries up to 3 times in a row, and the note appears only when those attempts are used up (v2.1.246 and later).
Subagents
Whether the session is interactive or not, a text-only response prompts the subagent to continue. When those prompts are used up, the note becomes the subagent's final message (v2.1.257 and later).
Hooks
According to the official hooks documentation, a turn that ends in an API error fires StopFailure instead of Stop. Its output and exit code are ignored, so a hook cannot make Claude continue automatically.
Output from -p when it stops, and how to continue
With the default text output in non-interactive mode, Claude Code prints the last completed text block from that turn, followed by this message (before v2.1.219 it printed only the message and the response was discarded). However, if no completed text is left—for example, because the conversation was compacted mid-turn and that text was removed—only the message is printed (added after checking the official error reference on September 26, 2026). With --output-format json or stream-json, the message goes into the result field. The official procedure is to wait until the connection settles, then resume the session and send continue.
# Continue the most recent conversation
claude -p "continue" --continue
# Continue a specific session by ID
claude -p "continue" --resume "$session_id"
On automatic resumption through hooks, the reporter of Issue #87972 writes that in the old-wording era the Stop hook fired and could continue automatically, but it stopped working around the time of the rename. This is the reporter's observation, and the official documentation does not say whether the earlier behavior was intended. Going by the current official documentation, a hook can log or notify, but it cannot resume the turn.
5. Causes—what is documented and what is reported
This message only reports the result—"data stopped coming"—and does not tell you why it stopped. Below, the information is sorted by how certain it is.
✅ Factors documented in the official docs and CHANGELOG that make a stream go silent or get cut off
- Mechanism: data stopped while the connection stayed open, and a watchdog timer cut it off. On the direct API, it is cut off after 180 seconds with no bytes, keep-alives included
- False alarms with gateways: before v2.1.222, gateways routed through
ANTHROPIC_BASE_URLand similar could be cut off even while keep-alives were arriving. Gateways routed through a provider base URL such asANTHROPIC_BEDROCK_BASE_URLare exempt from the byte-level watchdog - Silence during long thinking: the CHANGELOG entry for v2.1.229 says SSE keep-alives are now sent on gateway streaming responses during long thinking, to prevent idle disconnects with Vertex or Bedrock upstream; v2.1.257 says it fixed an issue where, on Bedrock and Bedrock Mantle with Opus 4.7 and later, requests went silent during long hidden thinking and the connection was dropped by the idle timeout
- Recovery from cutoffs: v2.1.232 fixed an issue where, in Bedrock, Vertex, and gateway setups, a stream idle timeout failed the request without recovering
- Proxy buffering: the official environment variable documentation explains that the 5-minute minimum on
CLAUDE_STREAM_IDLE_TIMEOUT_MSexists to absorb long thinking and proxy buffering
The official reference places this message in its "Server errors" section. That section opens by saying most of these come from the inference provider side, such as Anthropic's service, but for this particular wording the official explanation goes only as far as the mechanism above. The official documentation does not pin down whether it stopped in your own network, a device along the path, or the server.
🟡 Cases reported on GitHub whose cause is not confirmed
On September 22, 2026, we opened and read the following issues containing this wording. All of them are user reports or guesses, and in what we read there is no public response from Anthropic.
- #88900 (Linux, 2.1.240, no proxy or gateway): reports that the response stopped after about 0.5–2.7 KB had arrived, and the byte-level watchdog cut it off after 180 seconds. The reporter says separate sessions stopped at the same minute and asks for the server-side logs to be checked
- #90005 (Windows 11, 2.1.246): reports 33 occurrences in one day, versus 0 on earlier days. The reporter measured bandwidth, packet loss, and proxy and found them healthy, but notes these were not tests of long-lived open connections and writes that idle disconnects by carrier-grade NAT could not be ruled out
- #89027 (macOS, VS Code extension 2.1.238–2.1.241): reports that the log recorded a "byte-level" cutoff and 180000 ms of silence. It happened during a subagent's WebFetch
- #87246 (macOS, 2.1.232): a report that only pasted this message, closed as not planned. A follow-up comment observes background subagents stopping one after another with this message
#88900 and #90005 both say it stopped even though nothing was wrong with their own network. That alone, however, does not establish that the server is the cause. As the #90005 reporter also notes, tests of short connections do not reproduce a connection that stays open for several minutes and then goes quiet partway through.
6. What to do when it stops
These are ordered from least effort and most effect. If it happened only once, you are done after step 2.
Check the output left behind and the actual state of the work
Tool calls that had completed have been executed. If it stopped while rewriting files or running a command, first look at how much changed with git status or git diff.
Reply continue
This is the official recovery step. It resumes from the last completed block. Pasting the original instructions again from the start means running finished operations a second time.
Check your version and update
Check the version with claude --version and update with claude update. If it is older than 2.1.222, it may be one of the false alarms described in section 2. If you use Bedrock, Vertex, or a gateway, 2.1.229, 2.1.232, and 2.1.257 also contain relevant fixes (section 5).
Isolate the network path
Check the proxy in use on the Proxy line of /status. If turning off the VPN or proxy, switching to a different connection, or removing the gateway (ANTHROPIC_BASE_URL) to connect directly makes the stops go away, the cause is somewhere in what you removed.
Keep each response shorter
Split instructions like "read a large number of files, then write a long report" into a reading step and a writing step. The official reference does not list this as a fix for this message, but its "Request timed out" entry advises breaking long tasks into smaller instructions. #87972 also shares a user's tip that keeping each response short makes stops less likely.
Check for incidents
Check status.claude.com for any ongoing incident. Note, though, that the #90005 reporter says the status page showed "all systems operational" during the period when stops kept happening. A green status does not by itself mean the problem is on your side.
If the path goes quiet for long periods, lengthen the watchdog
In environments where a proxy or gateway buffers the response, lengthening the byte-level watchdog makes cutoffs less likely. Put it in the env section of your settings file as shown below. Background agents may not receive your shell's environment variables, so the official documentation recommends the settings file over exporting in the shell.
An example for ~/.claude/settings.json (setting the byte-level watchdog to 10 minutes):
{
"env": {
"CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS": "600000"
}
}
| Environment variable | Official description |
|---|---|
CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS | The time for the byte-level watchdog only. Clamped to between 10 seconds and 30 minutes. v2.1.210 and later |
CLAUDE_STREAM_IDLE_TIMEOUT_MS | The time for both the byte-level and event-level watchdogs. Values under 5 minutes are raised to 5 minutes, and the byte-level cap is 30 minutes |
API_FORCE_IDLE_TIMEOUT | Set to 0 to disable the 5-minute body idle timeout, or 1 to apply it to all providers. Independent of the watchdog timers |
CLAUDE_CODE_MAX_RETRIES | The number of retries (default 10). This message's situation is designed not to be resent in the first place, so raising it does not make the message less frequent |
Turning the watchdog off is not recommended
Setting CLAUDE_ENABLE_BYTE_WATCHDOG or CLAUDE_ENABLE_STREAM_WATCHDOG to 0 stops the watchdog itself. The official documentation describes these timers as existing so that a dead connection fails and is retried instead of hanging. Turning them off may make the message disappear, but you will then wait indefinitely on a connection that has truly stopped. And if the data from the server really has stopped, a longer timeout only makes the failure come later.
7. Confirming that it is fixed
Do not call it fixed just because it did not appear once. Run a task of similar size and check the following four points.
Version
Whether claude --version reflects the update. The version bundled with an IDE extension or the desktop app may be updated separately from the CLI
The waiting banner
If Waiting for API response appears but goes away on its own, the silences are staying short. The official reference advises treating it as a network problem if it appears on every attempt
Debug log
Starting with claude --debug writes the log to ~/.claude/debug/<session-id>.txt. The reporters of #88900 and #89027 found a line beginning with "Streaming idle timeout (byte-level)" at the moment of the cutoff (the wording of that line is not in the official documentation)
Count in the conversation logs
Conversations are saved as JSONL under ~/.claude/projects/. Count how many times this wording appears before and after an update or settings change, and compare. The official documentation warns that the format is internal and changes between versions
# Check the version
claude --version
# Start with debug logging
claude --debug
# Count the conversation log files containing this wording (macOS, Linux)
grep -rl "The response stopped arriving" ~/.claude/projects/ | wc -l
# Likewise, count the lines containing this wording (PowerShell)
Get-ChildItem "$HOME\.claude\projects" -Recurse -Filter *.jsonl | Select-String -SimpleMatch "The response stopped arriving" | Measure-Object
Treat the count as a rough guide. The #90005 reporter writes that in one 85-minute stretch it stopped 15 times on screen, but only 1 record was left in the conversation logs. Even if the logs show 0, keeping your own tally of on-screen stops is more reliable.
8. What to record when you report it
The official error reference lists the following four channels for when the problem is not resolved.
- Run
/feedbackinside Claude Code. It sends the conversation transcript and your description to Anthropic, and can also open a pre-filled GitHub issue. With providers such as Bedrock or Vertex, it saves locally instead of sending - Run
claude doctorin your shell to see a read-only diagnosis of your installation - Check status.claude.com for incidents
- Search existing GitHub issues, using both the old and the new wording
Report notes template
- Environment
- Output of
claude --version/ OS / where you use it (terminal CLI, VS Code extension, desktop app) - Path
- Direct API, or Bedrock, Vertex, or a gateway (
ANTHROPIC_BASE_URL) / whether a proxy or VPN is in use - Message
- Full error text / time of occurrence and time zone / whether
Waiting for API responseappeared just before / main conversation or subagent - Frequency
- Occurrences per day and the day it started / whether you updated or changed settings that day
- What you tried
- What changed before and after updating, turning off the VPN or proxy, using a different connection, or splitting turns
9. What is confirmed and what is not
✅ Officially confirmed
- It means "the connection stayed open, data stopped, and a watchdog timer cut it off"
- Before v2.1.227 it was shown as
Response stalled mid-stream - Completed output is kept, and you recover with
continue - It is not resent, to avoid running the same tool call twice
- Before v2.1.222 there were false alarms with gateways and with stalls after completion
🟡 Reported but unconfirmed
- It stops even when the local network is healthy (#88900, #90005)
- It stops after a few KB have arrived, in several sessions at once (#88900)
- The conversation logs record fewer occurrences than appear on screen (#90005)
- In the old-wording era, a Stop hook could resume automatically (#87972)
🔴 Not disclosed
- An official explanation of why the data stops (no public response on the issues above)
- Whether the stop is local, on the path, or on the server
- The reason for the rename (not in the CHANGELOG)
10. Summary
"API Error: The response stopped arriving" means that after a response had partly streamed, data stopped while the connection stayed open, and Claude Code's watchdog timer cut it off. It is the same thing as Response stalled mid-stream before v2.1.227, and completed output is kept. First check the state of your work, then reply continue.
If it keeps happening, try in this order: update your version, isolate the VPN, proxy, or gateway, and keep each response shorter. Only in environments where the path goes quiet for long periods is lengthening the byte-level watchdog an option. Connection lost mid-response, where the connection itself drops, points to different places to investigate, so compare the wording of the message first. Other errors are collected in our roundup of common Claude Code errors and fixes.
FAQ
Q. What does "API Error: The response stopped arriving" mean?
A. It means that partway through a streaming response, data stopped arriving while the connection was still open, and Claude Code's watchdog timer cut that connection off. It is the message for a stop after one block of text or one tool call has completed, and the output up to that point is kept.
Q. Is it a different error from "Response stalled mid-stream"?
A. It is the same one. The official error reference states that before v2.1.227 this message was Response stalled mid-stream. Only the wording changed; it does not mean a new kind of failure has started.
Q. What should I reply to resume where it left off?
A. Reply continue. It resumes from the last completed block. If it stopped in the middle of a file operation or command, it is safer to check the actual state with git status or similar before replying.
Q. Will raising the retry count make it go away?
A. No. In this situation Claude Code is designed not to resend at all, so that the same tool call does not run twice. CLAUDE_CODE_MAX_RETRIES applies to failures before output begins.
Q. How is it different from "Connection lost mid-response"?
A. Lost is a judgment that the connection itself dropped; stopped arriving is a judgment that the connection remained but data stopped coming. In both cases completed output is kept and you can resume with continue, but only stopped arriving can be helped by adjusting the watchdog time.
Primary sources
- Claude Code — Error reference (official documentation): the four "The response above may be incomplete" messages and the v2.1.227 rename, false alarms before v2.1.222, Automatic retries, the waiting banner, No response from API, Streaming response ended before any complete data was received, Report an error
- Claude Code — Enterprise network configuration (official documentation): the four watchdog timers and their default times, the environment variables for configuring them, debug logs, and how to pass settings to background agents
- Claude Code — Environment variables (official documentation): descriptions of
CLAUDE_STREAM_IDLE_TIMEOUT_MS,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS, andAPI_FORCE_IDLE_TIMEOUT - Claude Code — Hooks reference (official documentation): StopFailure for turns that end in an API error
- Claude Code — Run Claude Code programmatically (official documentation): resuming with
--continueand--resume - anthropics/claude-code — CHANGELOG (official): the entries for v2.1.222, v2.1.227, v2.1.229, v2.1.232, v2.1.246, and v2.1.257
- GitHub issues: #88900, #90005, #89027, #87246, #87972 (all user reports; checked on September 22, 2026)