command not found or TLS failures during setup, see Troubleshoot installation and login.
Except for Wrapper and IDE errors, which the launching program prints rather than Claude Code itself, these errors and recovery commands apply across the CLI, the Desktop app, and Claude Code on the web, since all three wrap the same Claude Code CLI. For other surface-specific issues, see the troubleshooting section on that surface’s page.
Claude Code calls the Claude API for model responses, so most runtime errors map to an underlying API error code. This page covers what each error means inside Claude Code and how to recover. For the raw HTTP status code definitions, see the Claude Platform error reference.
Find your error
Match the message you see in your terminal to a section below.Automatic retries
Claude Code retries transient failures up to 10 times with exponential backoff before showing you an error. It doesn’t always retry a failure that arrives partway through Claude’s response. When you see one of the errors on this page, Claude Code has already made whatever retries apply to that failure; the lists below say which failures get the full budget, which get a smaller one, and which get none. Claude Code retries these failures:- Server errors, overloaded responses, and request timeouts that arrive before any of Claude’s response has streamed.
- Dropped connections. When a connection drops partway through a request before Claude has completed any part of its response, including its thinking, Claude Code re-issues the request with the same backoff and the turn continues, even if some text had already started streaming. When it drops after Claude has finished thinking but before it has started any text or tool call, Claude Code instead re-issues the request up to two times in quick succession, and ends the turn with
Connection lost before a response was producedif the connection keeps dropping at that point. - A connection that Claude Code detects was broken by your computer going to sleep partway through a request. Claude Code counts it as a dropped connection under the rules above; once the retry label names the specific reason, it reads
Connection lost while your computer was asleep, and if the turn ends after Claude has finished thinking but before any text or tool call, the message readsYour computer went to sleep before a response was produced. - A stalled response stream, when none of the response has arrived yet or when Claude has finished thinking but hasn’t started any text or tool call: Claude Code aborts the stalled connection and re-issues the request at most once, outside the 10-attempt budget above. If the response stalls a second time after Claude has finished thinking but before any text or tool call, Claude Code ends the turn with
The response stalled before a response was produced. - Temporary 429 throttles, but not a gateway’s spend-limit
429, which isn’t a throttle; see Spend limit reached.- When you’re signed in with a claude.ai subscription, this includes 429 throttles that don’t carry your plan’s quota headers. Before v2.1.199, Claude Code retried those throttles only for API key and Enterprise sign-ins.
- A request rejected because the input plus
max_tokensexceeds the context limit. Re-sending it unchanged would fail the same way, so Claude Code retries with a reducedmax_tokens, and stops retrying and compacts instead in two cases:- When no reduction can fit, for example when the conversation itself nearly fills the context window.
- When a retry can’t shrink
max_tokensany further. Before v2.1.218, Claude Code could re-send a reduced request that still didn’t fit, such as when the extended thinking budget exceeded the remaining context, until the retry budget ran out.
- An expired or missing Google Cloud credential on Google Cloud’s Agent Platform, which surfaces as an error such as
Could not load the default credentials. Claude Code discards its cached credentials and retries up to two times, running yourgcpAuthRefreshcommand if you configured one, then reports the error so you can re-authenticate right away. Google Cloud’s Agent Platform troubleshooting covers re-authenticating. Before v2.1.228, Claude Code retried a failing credential through the full retry budget before showing the error.
Connection lost before a response was produced read Connection closed while thinking, before producing a response and The response stalled before a response was produced read Response stalled while thinking, before producing a response.
Claude Code doesn’t retry these failures:
- A TLS certificate validation failure, such as a TLS-inspecting proxy, a missing
NODE_EXTRA_CA_CERTSbundle, or an expired certificate. Claude Code reports the error on the first attempt, so you can fix the certificate setup right away; see SSL certificate errors. Claude Code still retries transient TLS conditions such as a handshake timeout. Before v2.1.199, Claude Code retried certificate failures through the full retry budget before showing the error. - A server error, dropped connection, or stalled stream that arrives after Claude has completed a block of text or a tool call, or has started one after finishing its thinking, but before it finishes the response. Claude Code could execute the same tool calls twice if it re-ran the request, so it keeps what Claude completed and shows an incomplete-response notice. Claude Code still runs any tool calls Claude completed and continues the turn from their results. Before v2.1.199, Claude Code discarded the partial output and reported the whole turn as an error when a server error arrived mid-stream.