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 cloud sessions, 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 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. Claude Code retries these failures:- Server errors, overloaded responses, and request timeouts that arrive before any of Claudeâs response has streamed.
- A server error or overloaded response that arrives after Claude has finished thinking but before it has started any text or tool call. Claude Code retries a server error at that point up to two times. Before v2.1.284, Claude Code ended the turn with the error at that point.
- 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 the response headers have arrived but none of Claudeâs response has arrived, 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. - A streaming request the API never answers with response headers, on a connection where the first-byte deadline runs: Claude Code aborts it at the deadline and re-sends it at most once per model request, within the retry budget, then ends the turn with No response from API if that attempt goes unanswered too. On other connections, the request waits out
API_TIMEOUT_MS. When you setCLAUDE_CODE_RETRY_WATCHDOG, the one-retry cap doesnât apply. - 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, or AWS credentials that fail to load on your machine. Claude Code discards its cached credentials and retries up to two times, then reports the error so you can re-authenticate right away, as described under Could not load AWS or Google Cloud credentials. Before v2.1.228, Claude Code retried a failing Google Cloud credential through the full retry budget before showing the error.
- A
401or403from the Anthropic API, directly or through an LLM gateway, while anapiKeyHelperscript supplies the credential. Claude Code re-runs the script and retries with its fresh output, within the full retry budget. When the script itself fails on the re-run, Claude Code shows Your apiKeyHelper script is failing instead.
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 doesnât re-run the request, because that could execute the same tool calls twice. It keeps what Claude completed, runs any tool calls Claude finished, and continues the turn from their results. For what you see in an interactive session and in a non-interactive one, read The response above may be incomplete. 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.
- A failure that arrives after Claude has finished the response: nothing needs retrying, so Claude Code keeps the complete response and ends the turn normally.
- An Amazon Bedrock streaming response with an unexpected content-type, because the gateway or proxy rewriting the response would rewrite the retry the same way. Requires Claude Code v2.1.208 or later.
- A non-streaming retry of a failed streaming request that gets a success status but no Claude API message in the body. Claude Code ends the turn with that error.
- A request that your organizationâs policy check denied, which surfaces as an
API Error:line carrying the denial message. Your organizationâs administrators set up the check with Inference hooks, a Claude Enterprise feature, and the message ends with the instructions they configured, or by default tells you to contact them. Claude Code doesnât re-send the denied request to the same model or to a fallback model, because the denial is about the requestâs content rather than the model. Before v2.1.239, Claude Code could re-send a denied request, without streaming or on a configured fallback model, before showing you the denial. - A response the APIâs output content filter blocked. Claude Code shows Output blocked by content filtering policy at once and doesnât retry or re-send that request.
What you see while Claude Code retries or waits
While retrying, the spinner shows aRetrying in Ns · attempt x/y countdown after an error label. The label names the specific reason from the first attempt for failures you can act on right away: the network is down, a TLS handshake failed, or you hit a rate limit. For other errors it reads API error at first. As of v2.1.198 it switches to the specific reason from the third attempt, or on the final attempt when CLAUDE_CODE_MAX_RETRIES allows fewer than three; earlier versions switch only on the final attempt.
As of v2.1.198, the usual spinner tip is suppressed during retries. Once the error reason is revealed, if the failure is a 529 overload the line below the countdown also names where to check service status: status.claude.com on the Anthropic API, or the provider or gateway host named in the message on other configurations.
If no data arrives on the response stream for 20 seconds while a request is still pending, the spinner shows Waiting for API response · will retry in âĶ Â· check your network before any retry has started. The request hasnât failed yet: the countdown runs to the point where Claude Code aborts the stalled connection. After the abort, what you see depends on how far the response had got:
- Before Claude has completed a block of text or a tool call, or started one after finishing its thinking, Claude Code retries the request or ends the turn with an error. Automatic retries says which stalls it retries and how many times.
- After Claude has completed a block of text or a tool call, or started one after finishing its thinking, but before Claude has finished the response, Claude Code keeps what Claude completed, continues the turn from any tool calls Claude finished, and shows The response above may be incomplete. In a non-interactive session, and for a subagentâs response in any session, Claude Code may first prompt Claude to continue the response; that entry says when it does and when you still see the notice there.
- After Claude finished the response, Claude Code ends the turn normally.
Tune retry behavior
You can tune retry behavior with these environment variables:Server errors
Most of these errors come from the inference provider: Anthropicâs service on the Anthropic API, and the service behind that providerâs endpoint on Amazon Bedrock, Google Cloudâs Agent Platform, Microsoft Foundry, or a custom gateway. Auto mode cannot determine the safety of an action and Agent terminated early due to an API error also cover causes on your side, such as an Amazon Bedrock account that canât invoke the classifier model or a subagent that hit a usage limit.API Error: 500 Internal server error
Claude Code shows the status code and the APIâs error message for any 5xx response. The example below shows a 500 response on the Anthropic API:ANTHROPIC_BASE_URL names the gateway host.
A 5xx from the API itself indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account.
When a proxy, load balancer, or gateway answers with an HTML error page, the message shows the status code and the pageâs title, such as API Error: 502 Bad Gateway. For a page with no title, the message shows the status code and its standard name instead. Before v2.1.281, the status code was dropped when the page had a title, and the pageâs raw markup was printed when it had none.
What to do:
- Check status.claude.com, or the provider status page named in the message, for active incidents
- Wait a minute, then send your message again. Your original message is still in the conversation, so for a long prompt you can type
try againinstead of pasting the whole thing. - If the error persists with no posted incident, run
/feedbackso Anthropic can investigate with your request details. See Report an error if/feedbackis unavailable in your environment.
API Error: Repeated 529 Overloaded errors
The API is temporarily at capacity across all users. Claude Code has already retried several times before showing this message:- Check status.claude.com, or the provider status page named in the message, for capacity notices
- Try again in a few minutes
-
Run
/modeland switch to a different model to keep working, since capacity is tracked per model. Claude Code prompts you to do this when one model is under particularly high load, for exampleOpus is experiencing high load, please use /model to switch to Sonnet. On Fable models the message names Fable. In a session the Claude Desktop app runs, such as the Code tab or Cowork, the message readsOpus is experiencing high load. Switch to Sonnet.and you switch models with the appâs model picker.
Request timed out
The API didnât respond before the connection deadline.- Retry the request
- If a slow network or proxy is the cause, raise
API_TIMEOUT_MSas described in Automatic retries - If timeouts are frequent and your network is otherwise healthy, see Network and connection errors below
No response from API
Claude Code sent a streaming request and the API returned no response headers within the deadline for the first byte, so Claude Code aborted the request instead of waiting for the fullAPI_TIMEOUT_MS request timeout, 10 minutes by default. Claude Code sends the request again at most once, if the retry budget allows. When the retry goes unanswered too, the turn ends with this message, which shows how long each attempt waited. When you set CLAUDE_CODE_RETRY_WATCHDOG, the one-retry cap doesnât apply and Claude Code retries under the budget described in Tune retry behavior.
- First attempt:
CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MSwhen you set it to 1 or more, clamped to between 10 seconds and 30 minutes. Otherwise Claude Code uses the byte-level watchdog timeout listed in Streaming idle watchdogs, so the variables that change that timeout change this wait too. Either way, Claude Code adds one second for every 32KB of request body. - Retry: one second less than
API_TIMEOUT_MS, just under 10 minutes by default, so that the retry can outlast a proxy or gateway that holds the response until generation completes. On Amazon Bedrock, the retry uses the same deadline as the first attempt, and the message shows one duration instead of two.
API_TIMEOUT_MS, and a positive API_TIMEOUT_MS under 11 seconds turns the deadline off. The byte-level watchdog starts only once the response headers arrive, so a response that stops sending bytes after that follows the stalled-stream rules instead of this deadline.
What to do:
- Send your message again. Your original message is still in the conversation, so for a long prompt you can type
try againinstead of pasting the whole thing. - If it repeats, treat it as a network or proxy problem.
- If a proxy or gateway on your network holds responses until they complete, raise
API_TIMEOUT_MSso the retry waits longer. On Amazon Bedrock, raiseCLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MSas well. - If the first attempt keeps timing out and the retry then succeeds, raise
CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MSso the first attempt waits long enough too.
API_TIMEOUT_MS request timeout, 10 minutes by default, before failing an unanswered streaming request. Before v2.1.261, the retry waited the same deadline as the first attempt and the message showed no durations.
The response above may be incomplete
A streaming request failed while the response was still in progress, after Claude had completed a block of text or a tool call, or had started one after finishing its thinking. Re-sending the request could run the same tool calls twice, so Claude Code keeps the output Claude completed and appends this notice instead of discarding the turn. Which variant you see names the cause:Server error mid-response: a mid-stream overloaded or 5xx server error. This variant requires Claude Code v2.1.199 or later; before then that case discarded the partial output and reported the whole turn as an error.Connection lost mid-response: the connection dropped. You also see this variant when a proxy or gateway ends the response body cleanly before the response has finished.Your computer went to sleep mid-response: Claude Code detected that your computer went to sleep while the response was streaming. Once your computer wakes, Claude Code treats the connection as broken and stops reading from it.Part of the response never arrived: a stream event was dropped between the API and Claude Code, so a later event referenced content that never arrived. Before v2.1.281, this case ended the turn withAPI Error: Content block not found.The response stream was malformed: an event arrived for a content block that had already finished, or an event arrived damaged. A damaged event is one whose data isnât valid JSON, whose content is missing, or whose content doesnât match the eventâs type. Before v2.1.284, the parserâs raw error, such as one beginningAPI Error: JSON Parse error, appeared instead when an event with invalid JSON arrived after Claude had completed its thinking, a block of text, or a tool call.The response stopped arriving: the connection stayed open but stopped delivering data, so the streaming idle watchdog aborted it. Before v2.1.222, Claude Code could also report this failure on gateway connections reached throughANTHROPIC_BASE_URLorANTHROPIC_AWS_BASE_URLwhile the serverâs keep-alive pings were still arriving, because it counted only parsed response events there; upgrading stops those spurious timeouts on those routes. Gateways reached through a provider base URL such asANTHROPIC_BEDROCK_BASE_URLarenât wrapped by the byte watchdog; see Streaming idle watchdogs.
Connection lost mid-response read Connection closed mid-response and The response stopped arriving read Response stalled mid-stream.
When a dropped, duplicated, or damaged stream event arrives before Claude has started any text or tool call, you donât see this notice:
- If Claude had completed only its thinking, Claude Code re-issues the request. When the re-issued streams break the same way, the turn ends with
Part of the response never arrived and no response was produced. Try again.orThe response stream was malformed and no response was produced. Try again. - If nothing had completed, Claude Code re-sends the request without streaming instead. If you turned that fallback off with
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK, the turn ends withAPI Error: Content block not foundfor a dropped event orAPI Error: Content block already closedfor a duplicated one. For a damaged event with the fallback off, the turn ends withAPI Error: Stream event unreadableor the parserâs raw error.
- Earlier in the response, Claude Code either retries the failure or ends the turn with a different error. See Automatic retries.
- When one of these failures arrives after Claude has finished the response, Claude Code keeps the complete response and ends the turn normally, without this notice. Before v2.1.222, Claude Code showed this notice when the connection dropped or stalled after the response finished, and reported the turn as an error even though the response was complete.
- In a non-interactive session, such as a
-prun, an Agent SDK run, or a cloud session, you donât have to sendcontinueyourself when the cut-off response is in the main conversation and contains text but no tool calls: Claude Code keeps the partial output and prompts Claude to continue from where it stopped, up to three times in a row. You see this notice for such a response only once Claude Code has used up those continuations. Before v2.1.246, Claude Code ended a non-interactive turn with this notice on the first cut-off. - In a subagent, whether the session is interactive or not: when its cut-off response contains text but no tool calls, Claude Code prompts the subagent to continue. The notice becomes the subagentâs last message only once those continuations are used up. Before v2.1.257, a subagent showed this notice on the first cut-off.
- In an interactive session, read the response that remains on screen: Claude Code keeps every block Claude completed before the error, but discards an interrupted final block when the turn ends, so the final sentences or tool calls may be missing. Reply with
continueto have Claude pick up from its last completed block. - In non-interactive mode (
-p):- With the default text output, Claude Code prints the last completed block of text it still holds from earlier in the turn, followed by this message. When it holds none, Claude Code prints this message alone, for example because Claude Code compacted the conversation mid-turn and cleared that text. Before v2.1.219, Claude Code printed only this message in
-ptext output and dropped the response it had already produced. - With
--output-format jsonorstream-json, Claude Code reports this message in theresultfield. - To continue the turn once the connection is stable, resume the session and send
continueas described in Continue conversations.
- With the default text output, Claude Code prints the last completed block of text it still holds from earlier in the turn, followed by this message. When it holds none, Claude Code prints this message alone, for example because Claude Code compacted the conversation mid-turn and cleared that text. Before v2.1.219, Claude Code printed only this message in
Auto mode cannot determine the safety of an action
The model that auto mode uses to classify actions couldnât produce a decision, so auto mode didnât approve the action automatically. The message you see depends on how the classifier failed. Reads, searches, and edits inside your working directory skip the classifier, so they keep working in all of these cases. When the classifier model is unavailable:temporarily unavailable, for example <model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now. The categories are (rate-limited), (overloaded), (server error), (timed out), and (connection failed). If (timed out) or (connection failed) repeats, check your connection; see Unable to connect to API. Before v2.1.229, the message never named a category and read Wait briefly and then try this action again.
When no category fits, the message appears with no category in parentheses; more than one failure produces that form. On Amazon Bedrock, including the Mantle endpoint, it also appears when your AWS account canât invoke the model named in the message, and that failure repeats on every retry until your account is granted access to the model.
What to do:
- Retry after a few seconds; Claude sees the same message and usually retries on its own. A transient failure is unrelated to auto mode eligibility; you donât need to change settings
- If retries keep failing, continue with read-only tasks and come back to the blocked action later
- On Amazon Bedrock, if the message returns on every retry, check that your account can invoke the model it names: for standard Amazon Bedrock models, confirm your IAM policy allows invoking it; for Mantle model IDs, contact your AWS account team
- Retry the action; this usually succeeds on the next attempt
- Run
claude --debugand repeat the action for details in the debug log
-p run, Claude Code doesnât stop the run. What Claude receives depends on where it requested the action:
- To a background subagent in a
-prun without--input-format stream-json, Claude Code returns an error result containingAgent aborted: auto mode classifier request refused by the safety safeguard in headless mode - Everywhere else, including interactive sessions and the main conversation of a
-prun, Claude Code returns that denial to Claude
- This is not a decision about your action. Content already in your conversation triggered a safety filter on the API when auto mode sent the conversation to the classifier
- Retrying will not help; the same conversation content will trigger the filter again
- In an interactive session, switch to a different permission mode so you can approve the action when prompted
- Start a fresh conversation without the triggering content
- In an interactive session, auto mode falls back to a normal permission prompt for that action so you can approve or deny it manually
- To a background subagent in a non-interactive
-prun without--input-format stream-json, Claude Code returns an error result containingAgent aborted: auto mode classifier transcript exceeded context window in headless mode, and the run continues - Elsewhere in a
-prun without a--permission-prompt-tool, there is no prompt to fall back to, so the action doesnât run and the run continues
- In an interactive session, approve or deny the action in the prompt that appears
- In an interactive session, run
/compactto reduce the conversation size so subsequent actions fit within the classifier window again
The server returned no safety verdict
Under server-side classifier review, auto mode denies an action when the server gives no verdict for it. The denial names a category in parentheses when Claude Code can determine one, such as(timed out):
Auto mode check unavailable with a countdown, and pressing Esc interrupts the turn.
After ten responses in a row with no verdict, auto mode stops the turn:
- In an interactive session, the message appears as a warning in the transcript and the turn ends
- In a non-interactive
-prun, the run ends and reports an execution error. With the default text output, the message prints on stderr. - When a subagent hit the limit, the subagent stops before finishing, and Claude receives whatever it produced with a note that auto mode stopped it
- Send another message to have Claude try again. The count of responses starts over.
- If the stop repeats and your requests go through an LLM gateway or proxy, check whether it cuts streaming responses short or rewrites them. Server-side classifier review says which gateway behavior causes denials, and the gateway compatibility guide lists what to pass through unchanged.
- Set
CLAUDE_CODE_AUTO_MODE_SERVER=0before you start Claude Code to use its own classifier requests instead. Before v2.1.281, Claude Code didnât read the variable on a direct connection to the Anthropic API. - To approve the actions yourself instead, switch out of auto mode
Agent terminated early due to an API error
A subagentâs API request failed terminally, for example because a usage limit was reached or retries for a server error ran out, so the subagent stopped before finishing its task. This message requires Claude Code v2.1.199 or later; before then the API error text was returned to Claude as if it were the subagentâs result.- Match the error detail after the colon to its own section on this page, such as Usage limits or Server errors, and follow that sectionâs steps
- Once the underlying error clears, ask Claude to retry the task or resume the subagent
Usage limits
Most errors in this section mean a quota tied to your account or plan has been reached. Three work differently:Server is temporarily limiting requests is a server-side throttle unrelated to your plan quota, Usage credits required for 1M context is an entitlement check rather than an exhausted quota, and The prompt to confirm went unanswered means a usage-credits consent prompt closed unanswered, whether or not a quota was reached.
Youâve hit your session limit
Subscription plans include a rolling usage allowance. When it runs out you see one of these messages:/model keeps you working.
In an interactive session signed in with a claude.ai subscription, Claude Code can also wait in the open session and continue the interrupted task shortly after the reset. See Wait for a usage limit to reset for what you see, how to start or cancel a wait, and how to turn automatic continue off. Before v2.1.234, Claude Code didnât offer this wait.
Usage counts against the session and weekly allowances at the same time. A single burst of heavy activity, such as a large workflow fanout, can exhaust the weekly allowance before the session window resets.
What to do:
- Wait for the reset time shown in the error
- In the Code tab of the Desktop app, the session-limit card offers an Auto-continue when limits reset checkbox. The weekly-limit card doesnât. When itâs checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. The Desktop checkbox and the CLIâs Continue automatically at usage limit setting in
/configare separate, so turn each off on its own. - For the Opus or Sonnet limit, run
/modeland switch to a model outside that family to keep working. Each model has its own prompt cache, so the next request re-reads the whole conversation with no cache hits; see Switching models - Run
/usageto see your plan limits and when they reset - Run
/usage-creditsto buy additional usage on Pro and Max, or to request it from your admin on Team and Enterprise. See usage credits for paid plans for how this is billed. - To upgrade your plan for higher base limits, see claude.com/pricing
You've used 85% of your session limit · resets 3:45pm. To watch your remaining allowance continuously, add the rate_limits fields to a custom status line, or in the Desktop app click the usage ring next to the model picker.
Usage credits required for 1M context
The selected model uses the 1M-token extended context window, and your plan only includes it through usage credits./compact; run /clear on those versions to recover. The steps below apply when you explicitly selected a [1m] model.
What to do:
- Run
/modeland select the variant without the[1m]suffix to fall back to the standard context window - Where the message names
/usage-credits, run it to turn on metered billing for the 1M variant on Pro and Max, or to request usage credits from your admin on Team and Enterprise. Once usage credits are on, restart Claude Code or start a new session, whichever the message says. Until then, the session stays at the standard context limit. - If the error persists after
/model, a 1M model ID may be set elsewhere. See Setting your model for the configuration locations to check in priority order. - To remove 1M variants from the model picker entirely, set
CLAUDE_CODE_DISABLE_1M_CONTEXT=1
run /usage-credits to turn them on, or /model to switch to standard context and didnât mention restarting.
The prompt to confirm went unanswered
If your account requires the Fable usage-credits consent, Claude Code asks you to confirm before a Fable request bills usage credits. When the consent prompt closes with nobody answering it, Claude Code ends the turn with one of these messages:continuing on Fable 5 and Fable 5 now uses usage credits. Before v2.1.257, the first message began Fable 5 limit reached.
This happens in Remote Control sessions, background sessions, agent team teammate sessions, and sessions that another application hosts through the Agent SDK. For when Claude Code closes the prompt, see Fable and usage credits.
What to do:
- Where the session runs, at the terminal or in the application hosting it, send another prompt and answer the consent prompt when it reappears. For a background session, attach to it from the agents view first. Resending from a Remote Control client shows this message again, because the client canât display the prompt.
- Run
/modelto switch to a model that doesnât bill usage credits - To give yourself more time, set
dialogExpiryto a longer value or"never"
Server is temporarily limiting requests
The API applied a short-lived throttle that is unrelated to your plan quota.- Wait briefly and try again
- Check status.claude.com if it persists
Request rejected (429)
You have hit the rate limit configured for your API key, Amazon Bedrock project, or Google Cloud project.ANTHROPIC_BASE_URL names the gateway host.
When a proxy, load balancer, or gateway between Claude Code and the API answers with its own HTML 429 page, the text after the · is that pageâs title when it has one, such as Too Many Requests. Before v2.1.281, the whole pageâs markup was printed after the ·.
What to do:
- Run
/statusand confirm the active credential is the one you expect. A strayANTHROPIC_API_KEYin your environment can route requests through a low-tier key instead of your subscription. - Check your provider console for the active limits and request a higher tier if needed
- For Anthropic API keys, see the rate limits reference for how tiers work and how to set per-workspace caps
- Reduce concurrency: lower
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY, avoid running many parallel subagents, or switch to a smaller model with/modelfor high-volume scripted runs
Youâve hit your monthly spend limit
Your planâs included usage canât cover this request, and the usage credits that would otherwise pay for it have reached a spend limit. That happens when one of your planâs usage windows has run out, or when the request is one that only usage credits pay for, such as a request to a model that bills to usage credits. The message names whose limit blocked you. The text after the· says how to get that limit increased, and varies with your plan and whether you manage billing:
team's shared budget is a pooled budget an admin assigned to a group you belong to; the message doesnât name the group. channel's monthly spend limit is the budget of the one Slack channel the session runs in, so your organization may still have budget outside it.
When one of your planâs windows is what ran out, the message also says when that window resets, for example · your session limit resets 3:45pm, and access returns then without anyone raising the limit. On organizations with usage-based billing, the message says usage limit in place of spend limit, as in You've hit your individual usage limit.
Before v2.1.239, the message didnât name the plan windowâs reset time. Before v2.1.268, a groupâs pooled budget produced the individual spend limit message instead of team's shared budget.
If you connect through a Claude apps gateway and see lowercase spend limit reached, that is your gateway operatorâs cap instead; see Spend limit reached.
What to do:
- On Pro and Max, increase your monthly spend limit in Settings > Usage on claude.ai, or run
/usage-credits - On Team and Enterprise, increase the limit in Organization settings > Usage if you manage billing, or ask an admin to.
/usage-creditssends that request to your admin for you - For a channelâs limit, ask an org owner or the channelâs manager to raise it on claude.ai. See Per-channel limits in the Claude Tag documentation
- If the message names a reset time for your planâs window, you can wait for it instead
- Run
/usageto see your planâs windows and when each resets
Spend limit reached
You connect through a Claude apps gateway and have passed a spend cap your gateway operator set. The gateway blocks your requests until the named period resets or the operator raises the cap. It marks each blocked429 response x-should-retry: false, so Claude Code shows this message without retrying.
blocked_message, their instructions follow it. Before v2.1.225, the message read only spend limit reached; a gateway on an older version still sends that shorter form.
What to do:
- Wait for the reset time the message names, or follow the operatorâs instructions if the message carries them
- Ask your gateway operator to raise the cap if you hit it routinely
spend limit unavailable, means the gateway could not read its spend records and blocked the request as a precaution rather than over your cap. It usually clears on its own; if it persists, tell your gateway operator.
Credit balance is too low
Your Console organization has run out of prepaid credits, or Claude Code is sending your requests with a Console API key when you meant to use your subscription.- If you have a Pro, Max, Team, or Enterprise plan and see this, run
/statusand check theAPI keyrow. An approvedANTHROPIC_API_KEYin your environment routes requests through that key instead of your subscription. Unset it in the current shell and remove it from your shell profile, then relaunchclaude. Run/loginif you havenât signed in with your subscription yet. - Add credits at platform.claude.com/settings/billing, and consider enabling auto-reload there so the balance refills before it hits zero
- Set per-workspace spend caps in the Console to prevent a single project from draining the org balance. See Manage costs effectively.
Could not update your spend limit
The server rejected a spend limit change you made from the prompt that appears when you reach your spend limit.Could not update your spend limit. Press Enter to retry. and retrying can succeed. Before v2.1.216, Claude Code showed the generic form for every failure.
What to do:
- If the message includes a reason, choose a limit that satisfies it, such as a lower amount
- If the message shows only the generic form, retry; the failure may be transient
- If the change keeps failing, make it from your claude.ai billing settings in the browser instead
Authentication errors
These errors mean Claude Code cannot prove who you are to the API. Run/status at any time to see which credential is currently active.
Not logged in
No valid credential is available for this session.Authentication required · Sign in again to continue, and you sign in again from the app.
If you sign in with your claude.ai account in another Claude Code window that uses the same configuration directory, an interactive session showing this message starts using that login on its own. You donât need to restart it.
Before v2.1.286 on macOS, the session could keep showing the message after you signed in from another window. On those versions, restart the session that shows the message.
What to do:
- Run
/loginto authenticate with your Claude subscription or Console account - If you expected an environment variable to authenticate you, confirm
ANTHROPIC_API_KEYis set and exported in the shell where you launchedclaude - For CI or automation where interactive login is not possible, configure an
apiKeyHelperscript that fetches a key at startup - See Authentication precedence to understand which credential Claude Code uses when several are present
Could not resolve authentication method
The session reached the API client without any credential. Background sessions and cloud sessions show this message when the worker starts without a credential. Interactive,-p, and Agent SDK runs report the same condition as Not logged in and write this string only to their debug log, so if you found it there, follow that entry instead.
- Upgrade to v2.1.176 or later if this appears in a background or cloud session and your credentials are already configured
- Confirm
ANTHROPIC_API_KEY,CLAUDE_CODE_OAUTH_TOKEN, or your cloud provider credentials are set in the environment that launches the worker, not only in your interactive shell - For the Agent SDK, see authentication setup in the quickstart
- Run
/statusin an interactive session in the same environment to confirm which credential source resolves
Invalid API key
TheANTHROPIC_API_KEY environment variable or apiKeyHelper script returned a key the API rejected, or Claude Code blocked a key from ANTHROPIC_API_KEY before sending it.
Fix external API key with a description such as Invalid X-Api-Key header value from ANTHROPIC_API_KEY: it contains a line break at character 41 (120 characters on 2 lines)., the API never saw the key. Claude Code found a character that HTTP headers canât carry and stopped the request before sending it. See Invalid request header value for how to read the description and fix the value.
What to do:
- Check for typos and confirm the key has not been revoked in the Console
- In the same shell, run
env | grep ANTHROPIC, or in PowerShellGet-ChildItem Env:ANTHROPIC*. Tools like direnv, dotenv shell plugins, and IDE terminals can load a stale key from a.envfile in your project without you setting it explicitly. - Unset
ANTHROPIC_API_KEYand run/loginto use subscription auth instead - If the key comes from an
apiKeyHelperscript, run the script directly to confirm it prints a valid key on stdout - Run
/statusto confirm which credential source Claude Code is actually using
Your apiKeyHelper script is failing
Claude Code ran the command in yourapiKeyHelper setting and didnât get a key back. Without one, the request reaches the API with a placeholder credential, and the API rejects it with 401. The Authentication panel in the terminal shows which of these happened:
- The command exited with an error or timed out
- The command printed nothing to stdout
- The command printed something besides the key, such as a login banner or a log line. The panel shows
returned output that cannot be used as an API keyand says whatâs wrong, without repeating the output. Before v2.1.227, Claude Code sent whatever the command printed, after trimming surrounding whitespace.
apiKeyHelper failed:.
Claude Code re-runs the script and retries the request up to two more times before showing this message, so the failure surfaces within three attempts. Before v2.1.208, Claude Code spent the full retry budget resending the request with the placeholder credential and then reported a generic 401 authentication error instead of the script failure.
Running /login doesnât help here: the helperâs output takes precedence over a saved login for as long as the setting is present.
What to do:
- Run the command configured in
apiKeyHelperdirectly in your shell to reproduce the failure - If the command reports an expired session, re-authenticate with your credential provider, for example by signing in to your SSO or secrets vault again
- Fix the command so it prints only the key to stdout, as a single token of printable ASCII up to 16,384 characters, and exits with code 0. See rotate credentials with apiKeyHelper for a working setup.
- Run
/statusto see the failure and confirmapiKeyHelperis the active credential source. TheapiKeyHelperrow showsFailingwith the last failureâs detail, such as the exit code and the commandâs error output, and disappears after the next successful run. Before v2.1.274,/statusshowed only the credential source, not the failure. - Each time the command fails, its exit code and error output also appear in an
Authenticationpanel in the terminal. Before v2.1.212, the panel was titledCloud authentication.
Invalid request header value
A value Claude Code was about to send as a request header contains a character that HTTP headers canât carry: a line break, a NUL byte, or a character aboveU+00FF, such as a curly quote or a zero-width space. Claude Code stops the request before anything is sent and names the variable or setting to fix. The usual cause is a credential pasted from a document or chat that carried an invisible character or a stray line break.
Claude Code runs this check when it sends requests to the Claude API directly or through an LLM gateway. On a third-party cloud provider such as Amazon Bedrock, Claude Code doesnât run it before sending.
Invalid auth token: a bearer token fromANTHROPIC_AUTH_TOKENorCLAUDE_CODE_OAUTH_TOKENInvalid ANTHROPIC_CUSTOM_HEADERS: a header name or value you set inANTHROPIC_CUSTOM_HEADERS. The description counts whichName: Valuepair is at fault, such asdistinct header 2 of 3 parsed from ANTHROPIC_CUSTOM_HEADERS, without repeating the name or value, since you chose both.Invalid request header from the environment: a value Claude Code copies into a request header from another environment variable, such asCLAUDE_AGENT_SDK_CLIENT_APP. The description names the variable to fix.
ANTHROPIC_API_KEY caught by this check as Invalid API key, with the same trailing description. It reports a bad saved /login credential as Not logged in instead; run /login to save a fresh one. An apiKeyHelper scriptâs output never reaches this check: Claude Code validates it when the script runs, and output an HTTP header canât carry fails with Your apiKeyHelper script is failing.
After the second ·, the message describes the problem, as in this full example:
a non-ASCII character.
What to do:
- Re-set the variable or setting the message names, retyping the characters around the reported position rather than pasting from the same source again
- For
ANTHROPIC_CUSTOM_HEADERS, keep oneName: Valuepair per line and rewrite the pair the message counts - Run
/statusto confirm which credential source is active
This organization has been disabled
Claude Code is using a staleANTHROPIC_API_KEY from a disabled Console organization. When you have a saved subscription login, the key overrides it.
· depends on your saved credentials: the first form appears when a stored /login can take over after you unset the key, and the second when the key is your only credential.
Environment variables take precedence over /login, so a key exported in your shell profile or loaded from a .env file is used even when you have a working Pro or Max subscription. In non-interactive mode (-p), the key is always used when present.
What to do:
- Unset
ANTHROPIC_API_KEYin the current shell and remove it from your shell profile, then relaunchclaude - If the message says
Update or unset, you have no saved login to fall back to. Unset the key and run/login, or replace the key with one from an active Console organization. - Run
/statusafterward to confirm the active credential is your subscription - If no environment variable is set and the error persists, contact support or sign in with a different account.
Your organization has disabled API key authentication
This message requires Claude Code v2.1.169 or later. Your Console organizationâs admin has turned off API key authentication, so the API rejects the key Claude Code is sending. The recovery hint after the· varies by where the key came from:
apiKeyHelper take precedence over /login, so running /login alone doesnât help while either is still supplying a key. See Authentication precedence.
What to do:
- If the message names
ANTHROPIC_API_KEY, unset it in the current shell and remove it from your shell profile or.envfile, then relaunchclaude - If the message names
apiKeyHelper, remove theapiKeyHelpersetting from yoursettings.json - Run
/loginto sign in with your claude.ai account - Run
/statusafterward to confirm the active credential is your subscription rather than an API key - If you need API key authentication for automation, ask your organization admin to re-enable it in the Console
Your organization has disabled Claude subscription access
Your Claude organization doesnât allow signing in to Claude Code with a subscription login. Running/login again with the same account returns the same error.
-p non-interactive mode surface this as the oauth_org_not_allowed error code.
What to do:
- Ask your admin to enable Claude Code access for your organization
- Authenticate with a Console API key instead of your subscription. See Claude Console authentication for setup.
- If you are the admin and do not see an option to enable access, contact Anthropic support
Routines are disabled by your organizationâs policy
An Owner in your Team or Enterprise organization has turned off routines at the organization level. The error appears when you try to create or run a routine, for example from the Routines UI on claude.ai/code. On Claude Code v2.1.227 or later, the same setting also hides/schedule in the CLI.
- Ask an Owner in your organization to enable the Routines toggle at claude.ai/admin-settings/claude-code
- For one-off scheduled work that does not require organization-level routines, see scheduled tasks
Remote Control requires the Anthropic API
The session isnât talking to the Anthropic API directly, which Remote Control requires.- A
CLAUDE_CODE_USE_*provider variable, such asCLAUDE_CODE_USE_BEDROCKfor Amazon Bedrock orCLAUDE_CODE_USE_VERTEXfor Google Cloudâs Agent Platform ANTHROPIC_BASE_URLpointing at a host other thanapi.anthropic.com, such as an LLM gateway or proxy, even when you sign in with claude.ai; before v2.1.196, a custom base URL didnât block Remote ControlANTHROPIC_UNIX_SOCKETset, so the session sends its requests through a local socket rather than toapi.anthropic.com- An enterprise cloud gateway sign-in made through
/login, which doesnât support Remote Control and has no variable to unset
- Unset the variable the message names, such as
CLAUDE_CODE_USE_BEDROCKorANTHROPIC_BASE_URL, and restart the session, or start Remote Control from a session that talks to the Anthropic API directly - If the variable isnât set in your shell, check the
envkey in your settings files, which applies environment variables to every session - For this and the other Remote Control startup messages, see Troubleshoot Remote Control
Remote Control couldnât refresh your login
Claude Code runs a live Remote Control connection on short-lived credentials that it obtains and renews using your saved claude.ai login. When claude.ai stops accepting that login, or Claude Code has no saved login left, Claude Code stops Remote Control and needs you to sign in again. Either failure can happen while Claude Code is still connecting or later, when it renews the credentials. When Claude Code asks the login service to refresh your saved login and gets no answer, it keeps Remote Control running and tries the refresh again while the connectionâs current credential is still valid. A refresh gets no answer when Claude Code canât reach the login service, the request times out, or the service fails without rejecting your login. If the login service still isnât answering when that credential expires, Claude Code stops Remote Control and reportsOAuth token refresh failed.
When Claude Code stops Remote Control, it shows the reason in a warning and in a transcript line that starts with Remote Control disconnected. Your local session keeps running without Remote Control. This section covers these lines:
Claude.ai login expiredandClaude.ai login was rejected: claude.ai no longer accepts your saved login token, because it expired or was revokedOAuth token unavailable: Claude Code had no saved login token when the connectionâs credential came due for renewalOAuth token refresh failed: claude.ai rejected your saved login token while Claude Code was reconnecting, and refreshing the token produced no new oneJWT refresh failed: no OAuth token: Claude Code found no saved login token to renew withSigned out of Claude: you signed out on this machine, for example by running/logoutin another terminal, so Claude Code has no saved login left to renew the connection with
- Run
/loginto sign in again - Run
/remote-controlto reconnect the session. Messages endingrun /login to restore Remote Controldonât need this step: Claude Code reconnects on its own once you sign in.
OAuth token refresh failed â run /login to re-authenticate read OAuth token refresh failed â re-authenticate, then re-enable Remote Control, and JWT refresh failed: no OAuth token â run /login read no OAuth token available for recovery (code <N>). The Claude.ai login expired, Claude.ai login was rejected, and OAuth token unavailable messages were added in v2.1.225.
Before v2.1.238, Claude Code reported the cases that now say Signed out of Claude as JWT refresh failed: no OAuth token â run /login, and stopped Remote Control with Claude.ai login expired â run /login to restore Remote Control as soon as one login refresh got no answer.
Remote Control stopped because the signed-in account changed
Claude Code shows this line during a Remote Control session when you sign in to a different claude.ai account or organization on this machine. You made the switch outside the Claude Code session, for example by running/login in another terminal.
A Remote Control session that you started while signed in through /login belongs to the claude.ai account and organization that were signed in at the time.
- Run
/remote-controlto start a new Remote Control session under the current account or organization - To switch back, run
/loginand sign in to the previous account or organization again. Then run/remote-control.
Remote Control server rejected the request (HTTP 404). That failure could come hours after the switch.
Remote Control stopped because the app running the session signed out or switched accounts
When the Claude desktop app or an IDE hosts your session, Claude Code gets its login token from that app rather than from/login. When claude.ai rejects that token, Claude Code asks the app for a new one. If the app answers that itâs signed out, or that itâs now signed in to a different Claude account, Claude Code ends the Remote Control session and sends the app one of these lines:
- If the app is signed out, sign in to it again, then turn Remote Control back on in the app
- If the app switched accounts, Claude Code canât continue the ended session under the new account. Start a new Remote Control session under that account.
run /login messages listed under Remote Control couldnât refresh your login in both cases.
OAuth token revoked or expired
Your saved login is no longer valid. A revoked token means you signed out everywhere or an admin removed access; an expired token means the automatic refresh failed mid-session. Both messages report a rejection the API returned for a request Claude Code sent. When the saved login has already been cleared after a failed refresh, you see Login expired instead. If you authenticate with a long-lived token inCLAUDE_CODE_OAUTH_TOKEN, you see the same messages when that token expires or is revoked.
-p) and the Agent SDK, the messages read as follows, and the structured error code is authentication_failed:
Your account does not have access to Claude. Please login again or contact your administrator.
What to do:
- Run
/loginat the Claude Code prompt to sign in again - If your
-pcommand or Agent SDK program uses a saved login, runclaudein the same environment, complete/login, then run the command or program again. For automation that canât sign in interactively, authenticate withANTHROPIC_API_KEYor generate a long-lived token withclaude setup-token. - If you authenticate with the
CLAUDE_CODE_OAUTH_TOKENenvironment variable, Claude Code keeps sending the value you set after a request fails with a 401, rather than switching to a stored loginâs token./statusshows this credential as anAuth tokenrow readingCLAUDE_CODE_OAUTH_TOKEN. Generate a fresh token withclaude setup-tokenand restart with it, or unset the variable and run/login. Before v2.1.225, Claude Code could replace the variableâs value mid-session with the short-lived access token from a stored login, and the session failed with 401 errors again once that token expired. - For repeated prompts to log in across launches, see the system clock checks and macOS credential-storage recovery steps in Troubleshooting
- For other failures including
403 Forbiddenand OAuth browser issues, see Login and authentication
API Error: 401 Invalid authentication credentials
The API recognized the format of your credential but rejected the account or organization behind it. Anthropic returns this message when a credential was recently revoked, when an organization was disabled or removed your access, or when the account itself was deactivated, so an expired token isnât the cause. The credential can be your saved login or an approvedANTHROPIC_API_KEY, and the fix differs, so start by running /status to see which one is active.
- If
/statusshows anAPI keyrow that isnât marked as not in use, an approvedANTHROPIC_API_KEYis the active credential and takes precedence over your login, so/logindoesnât replace it. Rotate the key in the Claude Console, or fall back to your subscription by runningunset ANTHROPIC_API_KEY, or in PowerShellRemove-Item Env:ANTHROPIC_API_KEY. - If
/statusshows only your login, run/loginonce. If the credential was revoked, a fresh login replaces it. - If the same message returns for the same login account, the account or organization is no longer active. Check the account and organization that
/statusreports, and ask your organization admin to restore access. - If
ANTHROPIC_BASE_URLpoints at an LLM gateway, the text after401is your gatewayâs message rather than Anthropicâs, and/logindoesnât change it. Fix the credential your gateway expects instead.
Login expired
Claude Code tried to renew your saved claude.ai login and the OAuth service rejected the stored refresh token, so Claude Code cleared the saved credentials. After that, each model request stops locally with this message before it reaches the API, because only/login can create new credentials.
Before v2.1.206, Claude Code sent the model request anyway with whatever credential remained in the environment, and every model then failed with Thereâs an issue with the selected model or a 401 instead of a prompt to sign in.
-p) and the Agent SDK, the message reads as follows, and the structured error code is authentication_failed:
Login expired for a login it already failed to renew, so it sends no request. When the renewal fails because the account itself is suspended rather than the login being stale, Claude Code shows Your account is on hold instead.
Sessions authenticated with an API key, CLAUDE_CODE_OAUTH_TOKEN, or a third-party provider donât use the saved login and never see this message.
You can check for this state before a request fails: /status shows a Login row reading Expired â log in again, plus the organization and email it has saved for the expired login. The row appears only when the saved login is your active credential and can no longer be refreshed. Sessions authenticated another way donât show the row, even if an expired login remains saved. Before v2.1.210, /status gave no indication in this state that a login had ever existed, because the cleared credential left it nothing to report.
What to do:
- Run
/loginto sign in again. Retrying without signing in shows the same message on every request. - If you sign in with your claude.ai account in another Claude Code window, see Not logged in for when this session starts using that login on its own.
- In non-interactive mode, run
claudein the same environment, complete/login, then rerun your command. For automation that canât sign in interactively, authenticate withANTHROPIC_API_KEYor generate a long-lived token withclaude setup-token. - If signing in keeps failing, see Login and authentication
Could not refresh your login because another Claude Code process is refreshing it
This message doesnât mean your login was rejected. Your saved claude.ai login had expired and needed renewing. Another Claude Code process on the same machine held the shared refresh lock, or exited and left it behind, and the refresh made no progress while this session waited. Claude Code stops the request before sending it:-p) and the Agent SDK, the message reads as follows, and the structured error code is server_error:
CLAUDE_CODE_OAUTH_TOKEN, or a third-party provider donât use the saved login and never see this message.
What to do:
- Try again in a minute. If another process completes the refresh first, this session uses the renewed login.
- If the message keeps returning, close other Claude Code windows and processes, then retry.
- If it returns with no other Claude Code process running, run
/login. Signing in again doesnât wait on the refresh lock.
Couldnât save your login
You signed in with claude.ai, but Claude Code couldnât save the login to its credential store, so the login didnât complete. On macOS this can happen when the login keychain locks, for example on sleep or idle, after Claude Code has already read or saved credentials in it during the same session.- On macOS, unlock the login keychain, then run
/loginagain - On other platforms, run
/loginagain - If the login still doesnât save, see Not logged in or token expired for the keychain unlock command and other credential-storage recovery steps
Failed to start OAuth callback server
When/login, claude auth login, or claude setup-token signs you in through the browser, Claude Code opens a listening port on 127.0.0.1 so your browser can return the sign-in result to it. This message means Claude Code couldnât open that port, and the sign-in stops before a browser window or login URL appears:
Is port 0 in use?, the attempt to listen on the IPv4 loopback address 127.0.0.1 failed outright. Because the failure happens before a login URL exists, the Paste code here if prompted flow isnât available as a workaround.
What to do:
- To sign in right away without the local listener: if you use a claude.ai subscription, run
claude setup-tokenon a machine where sign-in works and set the token it prints asCLAUDE_CODE_OAUTH_TOKENon this machine. Otherwise setANTHROPIC_API_KEYto a key from the Claude Console. Authentication precedence explains how Claude Code chooses between credentials. - To use browser sign-in on this machine instead, Claude Code must be able to listen on
127.0.0.1. If it runs inside a sandbox, check that the sandboxâs policy allows listening on local ports, then run/loginagain. If it should be able to and still fails, run/feedbackso the report includes your environment details.
Claude login not accepted
You tried to start a cloud session, and the server refused to create it with a 401: it didnât accept the Claude login this machine sent, usually because the login expired or was revoked. The first part of the line is the serverâs own reason when it gives one. Otherwise the line reads:- Run
/login, complete the sign-in, then start the session again
Artifacts need a claude.ai login
Claude Code refused an artifact publish or read because the session has no claude.ai login it can use for artifacts. Every form of the message starts with the same words, followed by a remedy that depends on how your session authenticates. With no competing credential it reads:- Run
/loginand select Claude account with subscription. The Anthropic Console account option doesnât provide claude.ai credentials. - When the message names a credential that takes precedence, such as
ANTHROPIC_API_KEY, anapiKeyHelpersetting, or a Console key saved by a previous/login, remove it the way the message says, then run/login - When the message says this remote session authenticates through the machine that launched it, sign in to claude.ai on that machine, then reconnect the session
- When the message says the credential is injected by the sessionâs host environment, you canât change it in that session; start a session that is signed in to claude.ai
- See Availability for the other requirements artifacts have, such as plan, model provider, and organization policy
Administrator policy requires a Cloud gateway sign-in
An administratorâs managed settings on this machine setforceLoginMethod to "gateway" or set forceLoginGatewayUrl. Unless you select a cloud provider through a variable such as CLAUDE_CODE_USE_BEDROCK, Claude Code then accepts only the Claude apps gateway sign-in. You see one of two messages:
/login since the policy reached the machine.
If the machine also holds an Anthropic-issued credential and the managed settings set forceLoginMethod or forceLoginOrgUUID, Claude Code exits at startup instead. That credential can be an ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN variable, an apiKeyHelper setting, or an API key saved by an earlier Claude Console login.
The startup message names the credential the session is configured with, where itâs set, and the step that removes it. For example, with an ANTHROPIC_API_KEY variable set in your shell, it reads:
- For
Not signed in to the Cloud gateway, run/loginand complete the sign-in on the Cloud gateway screen - For the startup message, remove the credential by following the steps at the end of the message
- If you believe the machine shouldnât require the gateway, ask the administrator who manages it to remove
forceLoginMethodandforceLoginGatewayUrlfrom its managed settings
Administrator policy requires a Cloud gateway sign-in on this machine; the Anthropic-issued credential configured here (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or apiKeyHelper) is not used. If you see that wording and canât tell which credential to remove, update to v2.1.284 or later and start claude again.
On v2.1.265, a regression also showed the first message in some LLM-gateway and proxy configurations that authenticate with an API key, apiKeyHelper, or custom headers, even with no administrator requirement on the machine. Update to v2.1.266 or later. You donât need to change your configuration.
Before v2.1.261, on machines that set forceLoginMethod to "gateway", Claude Code used a leftover saved login instead of failing model requests, and reported a configured environment credential with This machine's managed settings require a first-party login instead of the startup message.
Your account is on hold
The Claude account behind your login has been suspended. Claude Code shows the first message when it tries to renew your saved login and learns of the hold, and the second when a sign-in you complete in the browser reports it:-p) and the Agent SDK, the structured error code is account_on_hold. Before v2.1.235, Claude Code reported a held account as Login expired · Please run /login, whose recovery steps canât clear a hold.
What to do:
- Open the link in the message to view the holdâs details or appeal it
- If you have another Claude account or an API key that isnât affected by the hold, you can keep working while the hold is resolved: run
/loginwith that account, or set the key withANTHROPIC_API_KEY
Anthropic profile login expired
Claude Code is authenticating through an Anthropic credential profile whose saved login credential has expired, and the profile holds no refresh credential Claude Code can use to renew it. Claude Code stops each request locally without retrying, because a retry would read the same expired credential.ANTHROPIC_PROFILE environment variable, that Claude Code discovers as the active profile in your Anthropic configuration directory, or that Claude Code wrote when you signed in without an API key. Sessions that authenticate with an API key, a bearer token such as ANTHROPIC_AUTH_TOKEN, or a third-party provider never see this message.
On a machine that offers the keyless sign-in, run /login, choose the Anthropic Console account, and sign in again to renew a profile that the keyless Console sign-in or the Claude Platform CLIâs ant auth login wrote. Claude Code replaces the expired credential in that profile. For a federation profile or one another tool created, /login doesnât renew the credential. Which form you see depends on whether you selected the profile or Claude Code discovered it:
- When you set
ANTHROPIC_PROFILEexplicitly, the message ends withRe-authenticate your Anthropic profile. - When Claude Code discovered the profile from your configuration directory, the message offers
/login, because Claude Code gives a working/loginprecedence over the discovered profile and then authenticates with your claude.ai or Console account instead. Before v2.1.234, Claude Code showed theRe-authenticate your Anthropic profileform in this case too.
- Sign in to the profile again, then retry: on a machine that offers the keyless sign-in, run
/loginand choose the Anthropic Console account for a profile the keyless Console sign-in or the Claude Platform CLIâsant auth loginwrote; for other profiles, use the tool that created them - If an administrator provisioned the profileâs credential, ask them to issue a new one
- Run
/statusto confirm the active credential source and profile name - To stop using the profile, unset
ANTHROPIC_PROFILEif you set it, then authenticate another way, such as/loginorANTHROPIC_API_KEY
OAuth scope requirement
The stored token predates a permission scope that a newer feature needs:- Run
/loginto get a new token with the current scopes. You donât need to log out first.
claude.ai rejected the session token
A claude.ai connector request failed because claude.ai rejected the token from your Claude Code login. The rejected token is your login, not the connectorâs own authorization in claude.ai, so authorizing the connector again doesnât resolve it. In/mcp, the connector shows as session token rejected and its detail view reads:
- Run
/loginto sign in again - Reconnect the connector from
/mcp, or run/mcp reconnect <server>. Reconnecting before you sign in again leaves the connector in the same state. The/mcppanelâs Reconnect option reportsyour claude.ai session token was rejected; the typed/mcp reconnect <server>form reports a successful reconnect even though the token is still rejected.
MCP server needs you to sign in again
A remote MCP server rejected the credential on a tool call mid-session, usually because a sign-in or token expired or because the token lacks a permission the tool needs. The tool call fails, and/mcp marks the server as needing authentication.
For a server you sign in to from Claude Code, including a claude.ai connector, the sign-in expired or was revoked:
/mcp, select the server, and sign in again from its menu.
For a server configured with a headersHelper script, Claude Code has already re-run the helper and retried the call once before showing this:
/mcp, which runs the helper again.
For a server with a static Authorization header in its configuration:
/mcp.
Before v2.1.273, the expired sign-in, headersHelper, and Authorization header cases all showed MCP server "<name>" requires re-authorization (token expired).
A server can also refuse a tool call with HTTP 403 insufficient_scope to ask you to authorize a scope, sometimes one your token already lists. The message names that scope:
/mcp, select the server, and authenticate again from its menu.
When the serverâs configuration sets neither oauth.scopes nor authServerMetadataUrl, Claude Code requests the scope the server named. With either setting, Claude Code requests that settingâs scopes instead. If you pinned oauth.scopes, add the missing scope to that list before you authenticate again.
Before v2.1.274, this case showed the needs you to sign in again message, and before v2.1.273 it showed requires re-authorization (token expired) like the other cases.
MCP server URL is missing or not a valid URL
Claude Code refused to start an OAuth sign-in for a remote MCP server because the serverâs configuredurl doesnât parse as a URL. Unless Claude Code has a more specific configuration problem to report for the server, running claude mcp login <name> in your shell prints the refusal as:
- Set the entryâs
urlto the serverâs real endpoint where the server is configured, or set the environment variable that its${VAR}reference names, then run the sign-in again.
Issuer mismatch in authorization response
During an MCP OAuth sign-in, the authorization server redirected back to Claude Code with aniss parameter that doesnât name the issuer that Claude Code expected from the serverâs OAuth metadata. A wrong issuer at this step is how an authorization server mix-up attack looks, so Claude Code fails the sign-in instead of exchanging the authorization code. Claude Code shows the error in the /mcp server menu after the browser sign-in:
expected is the issuer from the serverâs OAuth metadata, and received is the iss value the redirect carried. A sign-in whose redirect carries no iss parameter passes the check, unless the serverâs metadata sets authorization_response_iss_parameter_supported, in which case Claude Code fails the sign-in.
What to do:
- Try the sign-in again from
/mcp - If the error repeats, report it to the server operator. The fix is server-side: the authorization server must return the same issuer in the
issparameter that it advertises in its metadata - To connect while the server is being fixed, start Claude Code with
MCP_SDK_GENERATION=v1, whose runtime doesnât run this check. This removes a protection against mix-up attacks, so prefer the server-side fix
MCP_SDK_GENERATION=v2.
Refusing to send credentials to non-https token endpoint
On the v2 runtime, Claude Code sends an MCP OAuth token request only to a token endpoint served over HTTPS or atlocalhost, 127.0.0.1, or ::1. This message means the serverâs token endpoint is neither, so Claude Code stopped before sending the request. That happens after the browser sign-in, so the browser step succeeds first, and again whenever Claude Code refreshes the serverâs token.
In its full form, the message comes from the MCP SDK and quotes the token endpoint it refused. In the debug log, it follows Error during auth completion: for a sign-in or Token refresh failed: for a refresh. In your shell, claude mcp login <name> prints it after Couldn't complete authentication for "<name>":, and in a session, /mcp shows it under the serverâs menu:
io, followed by from the MCP SDK for and the redacted server URL. Other errors from the MCP SDK take the same shape there. The redacted message can be this error only when the serverâs token endpoint is plain http:// at an address other than localhost, 127.0.0.1, or ::1.
What to do:
- Serve that token endpoint over HTTPS, for example by putting the server behind a reverse proxy or tunnel that terminates TLS and configuring the server to advertise the
https://address - To connect without changing the server, start Claude Code with
MCP_SDK_GENERATION=v1, whose runtime doesnât apply this rule and sends the token request over plain HTTP. That choice lasts until you exit and applies to every server. The v1 runtime also skips the issuer check, so prefer serving the endpoint over HTTPS
AWS credentials expired or invalid
Your AWS session token expired or was rejected. This message appears on a 401 from Claude Platform on AWS or the Mantle endpoint, which is how those providers report an expired security token. The action hint in the middle varies with your setup. The stable part is the leadingAWS credentials expired or invalid:
awsAuthRefresh was configured.
What to do:
- If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here donât apply: retry, or contact your administrator
- If
awsAuthRefreshis set, run the command named in the message, such asaws sso login --profile myprofile, in another terminal and complete the browser sign-in, then retry. Otherwise refresh the AWS credential you use yourself: your SSO sign-in, access keys, API key, or proxy token - With
awsAuthRefreshset in an interactive session, you can instead run/login, choose 3rd-party platform, then select Claude Platform on AWS · refresh credentials under Using 3rd-party platforms to run the same command without restarting Claude Code. See Configure AWS credentials - If the error repeats after the refresh command succeeds, confirm the identity is valid outside Claude Code with
aws sts get-caller-identityin the same shell and profile
AWS authentication failed
Your AWS provider returned a 403, or Amazon Bedrock returned a 401. Amazon Bedrock reports an expired security token as a 403, but a 403 is also how it reports an authorization denial, such as anAccessDeniedException from a missing IAM permission. Claude Code canât tell those two causes apart.
A 401 from Amazon Bedrock also lands here rather than under AWS credentials expired or invalid, because Amazon Bedrock doesnât report an expired token as a 401. A 401 from that endpoint typically comes from something else in the request path, such as a corporate proxy.
A credential refresh fixes an expired token and canât fix the other causes, so the message offers both:
AWS authentication failed.
When the 403 is Amazon Bedrockâs answer that you donât have access to the model with the specified model ID, the hint instead tells you to enable the model for your account and region in the Amazon Bedrock console.
Before v2.1.273, this message appeared only when awsAuthRefresh was configured.
What to do:
- If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here donât apply: retry, or contact your administrator
- Refresh your AWS credentials in case an expired credential is the cause: run the
awsAuthRefreshcommand named in the message when one is set, or refresh your SSO sign-in, access keys, API key, or proxy token yourself - If your credentials are current, confirm the IAM permissions in IAM configuration are attached to the identity youâre using and that the selected model is enabled for your account and region
- Run
aws sts get-caller-identityto confirm which identity your requests use
Google Cloud credentials expired or invalid
Your Google Cloud credentials for Google Cloudâs Agent Platform expired or were rejected: the request returned a 401, which is how Agent Platform reports credential expiry. The action hint in the middle varies with your setup. The stable part is the leadingGoogle Cloud credentials expired or invalid:
- If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here donât apply: retry, or contact your administrator
- If you authenticate with application default credentials, run the
gcpAuthRefreshcommand named in the message, orgcloud auth application-default login, and complete the sign-in, then retry - If you route through an LLM gateway with
CLAUDE_CODE_SKIP_VERTEX_AUTHset, refresh the gateway token inANTHROPIC_AUTH_TOKENorANTHROPIC_CUSTOM_HEADERS, then retry - If you authenticate with a service account key file, confirm
GOOGLE_APPLICATION_CREDENTIALSpoints at a valid key. See Configure GCP credentials - If the error repeats after a refresh, confirm the identity works outside Claude Code with
gcloud auth application-default print-access-tokenin the same shell
Please run /login or Failed to authenticate message instead, which canât refresh Google Cloud credentials.
Google Cloud authentication failed
Google Cloudâs Agent Platform returned a 403, which it uses for authorization denials rather than expired credentials. Usually the identity you authenticate with is missing an IAM permission, or the model isnât enabled for your project. The action hint in the middle varies with your setup. The stable part is the leadingGoogle Cloud authentication failed:
- If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here donât apply: retry, or contact your administrator
- Confirm the roles in IAM configuration are granted to the identity you authenticate with
- Confirm the model is enabled for your project. See Request model access
Please run /login or Failed to authenticate message instead, which canât refresh Google Cloud credentials.
Microsoft Foundry authentication failed
Microsoft Foundry returned a 401 or 403: the Azure credential on the request was rejected, or the identity behind it doesnât have access to the Foundry resource./login canât mint Azure credentials. The action hint in the middle varies with your setup. The stable part is the leading Microsoft Foundry authentication failed:
- If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here donât apply: retry, or contact your administrator
- Refresh the credential you configured in Configure Azure credentials: rotate
ANTHROPIC_FOUNDRY_API_KEY, mint a freshANTHROPIC_FOUNDRY_AUTH_TOKEN, or runaz loginso the default Microsoft Entra credential chain can sign in again - If the credential is current, confirm the identity has access to the Foundry resource. See Azure RBAC configuration
Please run /login or Failed to authenticate message instead, which canât refresh Azure credentials.
Could not load AWS or Google Cloud credentials
Claude Code couldnât obtain usable credentials from the AWS credential provider chain or from your Google application default credentials on the machine it runs on, so no request reached your cloud provider. Claude Code clears its cached credentials and retries twice before showing this message. The detail after the· names the specific cause, such as an expired SSO session, missing application default credentials reported as Could not load the default credentials, or a revoked sign-in reported as invalid_grant:
-p and in the Agent SDK, the structured error code is cloud_credential_error. Before v2.1.267, the message showed only the detail text after API Error:, and the structured code was server_error or unknown.
What to do:
- Run your providerâs sign-in command, such as
aws sso login --profile myprofileorgcloud auth application-default login, then retry. Bedrock, Agent Platform, or Foundry credentials not loading shows how to confirm the credentials outside Claude Code - If the detail reads
AWS default-chain credential resolve timed out, the chain hung rather than failed, so follow AWS default-chain credential resolve timed out instead
AWS default-chain credential resolve timed out
The AWS default credential provider chain didnât produce credentials within 60 seconds, so Claude Code stopped the resolve and failed the request. This timeout is one cause of Could not load AWS or Google Cloud credentials. The failure is local credential resolution: the request never reached Amazon Bedrock, Claude Platform on AWS, or the Mantle endpoint. Claude Code clears its credential cache and retries before this error surfaces, so by the time you see it the chain has stalled on repeated attempts.credential_process command in your AWS profile that waits for input it canât receive, and a container or VM whose instance metadata service (IMDS) never answers the chainâs probe.
Before v2.1.267, the message read API Error: AWS default-chain credential resolve timed out.
Before v2.1.207, a stalled chain left the request waiting indefinitely instead of failing.
What to do:
- Run
aws sts get-caller-identityin the same shell with the sameAWS_PROFILE. If it also hangs, fix the profile; acredential_processcommand that prompts interactively is a common cause. - Complete the sign-in step before starting Claude Code, for example
aws sso login --profile myprofile - If your chain runs an interactive sign-in that legitimately needs more than 60 seconds, such as SSO with MFA through a wrapper like
aws-vault, raise the limit in milliseconds withCLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS
Bedrock setup verification timed out waiting for AWS
A call to AWS during the Bedrock setup wizardâs credential verification, such as the credential lookup or the identity check, didnât finish within the 60-second limit. The wizard stops waiting and fails the verification step:CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS.
Common causes are a network or proxy that stalls requests to AWS, including the SSO token refresh, and a credential helper still waiting for input you canât see. Raise the limit only when the helper legitimately needs more time.
A single stalled request to AWS can also fail on its own per-request timeout, which shows a shorter message on the same step:
unreachable instead of showing either message.
What to do:
- Run
aws sts get-caller-identityin the same shell. If it also hangs, the stall is outside Claude Code, in your network, your proxy, or the credential helper in your AWS profile; fix that first. - Complete any interactive sign-in before opening the wizard, for example
aws sso login --profile myprofile - If a credential helper in your AWS profile legitimately needs longer than 60 seconds to prompt you, raise the limit in milliseconds with
CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS
Cloud gateway session expired
You signed in through a Claude apps gateway, and the gateway session saved on this machine has expired and couldnât be renewed, or the gateway no longer accepts it, for example after the gatewayâs JWT secret is replaced. If you see this line when you startclaude interactively, the session has opened signed out of the gateway:
claude subcommand other than claude auth, Claude Code exits with this message instead when the gateway no longer accepts the session:
- Run
/loginin the session and complete the browser sign-in - For a non-interactive launch, start
claudein the same environment, run/login, then rerun your command
Sign-in timed out while waiting for you to continue
During a Claude apps gateway sign-in, the gateway named the account that signed in, and Claude Code asked you to confirm it before saving the credential. You left the confirmation open past the sign-inâs own expiry, and the gateway issued no refresh token that could renew it, so Claude Code stored nothing when you continued:- Run
/loginagain and confirm the account before the sign-in expires
Gateway refused the request
Youâre signed in through a Claude apps gateway, and a request returned a 403: the gateway, or the upstream behind it, refused it. Signing in again doesnât change a refusal, so the message points at your gateway administrator:- Ask your gateway administrator to look up the request. The
API Error:tail carries the refusal the gateway returned - For administrators: an access control rule on the gateway returns a 403 that the audit log records with its reason, and an upstreamâs authorization denial passes through per Upstream error messages
Please run /login or Failed to authenticate message instead, and signing in again didnât clear the refusal.
Network and connection errors
Most of these errors mean a network request from Claude Code failed to reach its destination, or something between Claude Code and the API altered the response on its way back; where an entry also has a local cause, such as a failed archive write, its body says so. They usually originate in your local network, proxy, or firewall, or in the cloud environmentâs network policy.Unable to connect to API
The TCP connection to the API failed or never completed. For the common connection error codes, the message names the kind of failure and keeps the code in parentheses:Unable to connect to API followed by the code in parentheses. Some of these messages can show more than one code: Connection refused can show ConnectionRefused or ECONNREFUSED, for example, and Can't reach the API server can show ENOTFOUND or FailedToOpenSocket.
Before v2.1.227, each of these coded messages read Unable to connect to API followed by the code, for example Unable to connect to API (ECONNREFUSED).
Common causes include no internet access, a VPN that blocks api.anthropic.com, or a required corporate proxy that is not configured.
What to do:
- Confirm you can reach the API host from the same shell by running
curl -I https://api.anthropic.com. On Windows PowerShell usecurl.exe -I https://api.anthropic.comso the built-inInvoke-WebRequestalias is not used. - If you are behind a corporate proxy, set
HTTPS_PROXYbefore launching Claude Code and see Network configuration - If you route through an LLM gateway or relay, set
ANTHROPIC_BASE_URLto its address. See Connect Claude Code to an LLM gateway for setup. - Ensure your firewall allows the hosts listed in Network access requirements
- Intermittent failures are retried automatically; persistent failures point to a local network issue
curl succeeds but Claude Code still fails, the cause is usually something between the runtime and the network rather than the network itself:
- Check whether
ANTHROPIC_BASE_URLis set by runningecho $ANTHROPIC_BASE_URL, orecho $env:ANTHROPIC_BASE_URLin PowerShell, and look for it in theenvblock of your settings files. When itâs set, Claude Code sends model requests to that address instead ofapi.anthropic.com, so a leftover value pointing at a local proxy or gateway thatâs no longer running producesConnection refusedeven thoughcurlreaches the API. Remove it from your shell profile or settings and start Claude Code from a new terminal. - On Linux and WSL, check
/etc/resolv.conffor an unreachable nameserver. WSL in particular can inherit a broken resolver from the host. - On macOS, a VPN client that was disconnected or uninstalled can leave a tunnel interface or routing rule behind. Check
ifconfigfor staleutuninterfaces and remove the VPNâs network extension in System Settings. - Docker Desktop and similar container runtimes can intercept outbound traffic. Quit them and retry to rule this out.
Unable to connect to Anthropic services
During first-run setup, Claude Code checks that it can reachapi.anthropic.com and platform.claude.com before showing the sign-in step. When either check fails, Claude Code prints the reason and exits.
HTTPS_PROXY. Before v2.1.222, the check used a different proxy transport with no timeout: behind a proxy URL with the https:// scheme, it could stall on Checking connectivity... indefinitely and then fail even though API requests through the same proxy succeed.
Claude Code skips this check when a managed settings file, MDM policy, or policy helper sets forceLoginMethod to "gateway", or sets forceLoginGatewayUrl without forceLoginMethod. With either configuration, Claude Code opens the sign-in step on the Cloud gateway screen rather than an Anthropic sign-in method. Claude Code also skips the check when a managed settings source on the machine exists but canât be read, since that source may hold the gateway configuration. Before v2.1.247, Claude Code ran the check under this configuration too, and exited with this error when Anthropicâs endpoints were unreachable.
What to do:
- If the message names a proxy variable, check that its value points at the right proxy and ask your network team to allow HTTPS connections through it to the host in the message. See Network configuration.
- Work through the checks in Unable to connect to API. The
curltest and firewall guidance there apply to this check too. - If your network is open and the failure persists, Claude Code may not be available in your country
Socket is closed
Socket is closed means the connection carrying a streaming response was closed while the response was still arriving. The most common cause is a corporate proxy on Windows dropping an established tunnel mid-response.
Depending on how far the response had progressed, Claude Code retries the request, keeps what Claude produced, or ends the turn. See Automatic retries.
Before v2.1.214, Claude Code didnât retry this failure, and the turn stopped with an error containing Socket is closed.
What to do:
- If you see this error, update to v2.1.214 or later with
claude update, then send your message again - If turns keep failing behind the same proxy after updating, work through Unable to connect to API and check the proxy setup in Network configuration
API returned an empty or malformed response
Claude Code shows this error when its non-streaming retry of a failed streaming request gets an HTTP success status but the body isnât a Claude API message: commonly an HTML error or sign-in page, an empty body, or JSON in another format. A proxy, gateway, or network sign-in page answering in the APIâs place is the usual source. Claude Code doesnât retry the request, and the turn ends with this error.- A
Response:clause with the content type, the kind of body, such asbody is an HTML pageorempty body, its size in bytes, and whether the response carried an Anthropic request id. When the response names a recognizable server, such asnginxorcloudflare, or carries intermediary headers, such ascf-rayorvia, the clause lists those too. - A sentence naming the failed streaming requestâs id and the failure that triggered the retry. When a stream had opened before the failure, it also reports how many stream events arrived and, if any did, how long the stream had been silent when the attempt failed.
intercepting the request.
Before v2.1.271, a reply that carried a valid API message under a non-JSON content type such as text/plain also ended the turn with this error. Some LLM gateways use that content type for the non-streaming reply.
What to do:
- Read the
Response:clause to see which system answered. An HTML body, no Anthropic request id, or a named server such asnginxorcloudflaremeans that something between Claude Code and the API replied in its place - If you route through an LLM gateway, test the route with a direct request and fix the hop that returns the non-API response
- On a network with a sign-in page, such as guest Wi-Fi, complete the sign-in in a browser, then retry
- If only the non-streaming route through your gateway is broken, set
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1to turn off this fallback, except when the streaming endpoint itself returns404, where Claude Code still falls back
Streaming response ended before any complete data was received
A streaming response from your model provider completed without delivering any usable data, so Claude Code re-sent the request without streaming to finish the turn. Claude Code shows the warning once per session, in interactive sessions only. Before v2.1.239, Claude Code silently retried without streaming.- Configure any proxy or gateway between Claude Code and your model provider to pass streaming response bodies and their headers through unmodified
- On Amazon Bedrock, see Streaming errors behind a gateway or proxy for the header and body requirements
Bedrock streaming response has an unexpected content-type
A gateway or proxy between Claude Code and Amazon Bedrock is transforming the streaming response body or itsContent-Type header. Amazon Bedrock streams responses as application/vnd.amazon.eventstream. Rather than decode a body it canât read, Claude Code rejects a successful streaming response that reports a different content-type. Claude Code doesnât retry the request.
API Error: Truncated event message received after the whole response had been buffered.
What to do:
- Configure the gateway to pass the
InvokeModelWithResponseStreamresponse body and itsContent-Typeheader through unmodified. An intermediary that re-emits the stream as server-sent events is a common cause. - Setting
CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1hides this error, but Claude Code doesnât decode a binary body under a rewritten header, so those requests fall back to a slower non-streaming path. See Streaming errors behind a gateway or proxy.
SSL certificate errors
A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it.Check your proxy or corporate SSL certificates, without the OpenSSL code or the NODE_EXTRA_CA_CERTS hint.
As of v2.1.199, a certificate validation failure isnât retried, so this error appears on the first attempt instead of after the full retry budget. Earlier versions spent a few minutes retrying before showing it. Transient TLS conditions, such as a handshake timeout, still retry.
During /login and the startup connectivity check, the same failure produces a different message:
- Export your organizationâs CA bundle and point Claude Code at it with
NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem - See Network configuration for full setup instructions
- Donât set
NODE_TLS_REJECT_UNAUTHORIZED=0, which disables certificate validation entirely
Host not allowed in a cloud session
An outbound HTTP request from a cloud session or routine was blocked by the environmentâs network policy.- Open your environment for editing, either from the routineâs form or from the environment selector where you start cloud sessions.
- In the Edit environment dialog, change Network access from Trusted to Custom, then add the blocked domain to Allowed domains. Enter one domain per line. Check Also include default list of common package managers to keep the default allowlist alongside your custom domains. Select Full instead if you want unrestricted access.
- Click Save changes. The next run uses the updated allowlist. For a cloud session thatâs already open, see when a network access change reaches existing sessions.
The proxy refused the connection
You see this message when Claude reads an artifact through the proxy you set inHTTPS_PROXY or a related proxy variable. Artifact content comes from *.frame.claudeusercontent.com, so Claude Code first sends the proxy a CONNECT request asking it to open a tunnel to that host. When the proxy refuses, nothing reaches the host, and the message carries the proxyâs HTTP status:
CONNECT. The host never answered, so each status points at a different fix:
HTTP 407: the proxy requires credentials it didnât get. Put them in the proxy URL, as Basic authentication shows.HTTP 403: the proxy refuses to tunnel to*.frame.claudeusercontent.com. Ask whoever runs the proxy to allow that host, which Network access requirements lists.- Any other status, such as
HTTP 502: the proxy didnât open the tunnel for its own reason, such as failing to reach the host. Look the status up in the proxyâs logs. unreadable replyin place of a status: whatever is at the proxy address didnât answer with an HTTP status line. Check that the address is an HTTP proxy.
- Check the address and credentials in the proxy variable, as Proxy configuration describes, then run
curl -x http://proxy.example.com:8080 -I https://api.anthropic.comfrom the shell you start Claude Code in, using your own proxy URL. On Windows PowerShell, runcurl.exe. If this probe fails the same way, fix the proxy setup first. If it succeeds, the refusal is specific to the artifact host. - If your network lets Claude Code reach the artifact host directly, add
.frame.claudeusercontent.comtoNO_PROXY. Keep the entry that narrow: a broader.claudeusercontent.comentry also bypasses the proxy forbridge.claudeusercontent.com, which organizations with IP allowlisting need to keep on the proxy.
The cloud environments service returned an empty or unexpected response
Claude Code requests your cloud environments list at several points, such as when you create a cloud session from the CLI or run/remote-env. When it canât read the serverâs answer, it shows one of these messages:
couldn't list environments: in the /remote-env dialog.
What to do:
- Retry the action. Claude Code requests the list again each time
- If the message keeps appearing, check status.claude.com for active incidents
Couldnât reconnect to your Remote Control session
claude --resume or claude --continue reconnects to the Remote Control session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code canât confirm whether the remote session still exists. Your local session keeps running without Remote Control.
What to do:
- Run
/remote-controlto retry the connection - Start a new session with
claude --remote-controlto create a new Remote Control session - For other Remote Control startup messages, see Troubleshoot Remote Control
Previous session is unavailable â run /remote-control to start a new one.
Sessions ended while this machine was offline
Claude Code shows this message in the terminal runningclaude remote-control after your machine was offline long enough that the server cleaned up the Remote Control environment your machine was serving. The sessions in that environment ended, and you canât resume them. The count is the number of sessions that ended.
- When Claude Code lists kept worktrees under this message, pick up any uncommitted work from them
- Run
claude remote-controlto start a fresh environment
Couldnât share the transcript
After you agree to share your session transcript from a survey prompt, such as the session quality survey, Claude Code uploads it to Anthropic, or saves a local archive instead on third-party providers, on Claude apps gateway sessions, and when no Anthropic credentials are available. This message means the share didnât complete.- Run
/feedbackto send the transcript with a description of what happened. See Report an error if/feedbackis unavailable in your environment - If other requests are failing too, check your network connection and see Unable to connect to API
Couldnât send feedback
You sent a report from the/feedback, /bug, or /share dialog and the upload to Anthropic failed. The dialog keeps your text so you can retry.
: not signed in. Run /login, then retry.: the dialog uploads only when Claude Code found Anthropic credentials as it opened, and none were usable by the time you sent. For example, you signed out on this machine in the meantime, or your login could no longer be refreshed.- A parenthetical:
(server returned <status>)is the serviceâs response code;(request timed out)and(couldn't reach the service)are network failures. When Claude Code canât name a reason, the parenthetical is absent.
The draft is still queued. Try again later. instead, and the draft stays in the queue for another attempt.
What to do:
- For the not-signed-in wording, run
/loginand send again - Otherwise, send again; if other requests are failing too, check your network connection and see Unable to connect to API
- If it keeps failing, file the report at github.com/anthropics/claude-code/issues, as the message says
Request errors
These errors relate to the content of your request. Most come back from the API after it rejected the request; a few are produced locally by Claude Code before any request is sent.Prompt is too long
The conversation plus attached files exceeds the modelâs context window./clear when DISABLE_COMPACT is set. Longer forms of the error, such as the compaction-failed form below, keep the Prompt is too long · wording. In -p output and the transcript, the text stays Prompt is too long.
When you turned auto-compact off in your user settings, the line also says so:
/config writes autoCompactEnabled to user settings. The hint appears only when a /config change would take effect. For example, it doesnât appear when DISABLE_AUTO_COMPACT or DISABLE_COMPACT turned auto-compact off. It also doesnât appear when a higher-precedence scope, such as project or managed settings, set autoCompactEnabled to false. Before v2.1.235, the line carried no auto-compact hint.
Amazon Bedrock reports this condition as Input is too long for requested model., which Claude Code handles the same way. Before v2.1.217, Claude Code didnât recognize the Bedrock wording, so auto-compact never triggered on it and /compact failed with the same error.
A Claude apps gateway reports this condition as capability_rejected: prompt_too_long when a cloud upstream rejects the request in the providerâs own error shape. Claude Code treats the token the same as Prompt is too long. Before v2.1.228, Claude Code didnât recognize the token, so auto-compact didnât trigger on it.
When automatic compaction ran on this turn and failed on an underlying error, such as an unavailable model or an authentication failure, the message names that error after a separator:
/compact fails on the same error until you do. Before v2.1.229, a failed automatic compaction surfaced Prompt is too long without the cause.
When automatic compaction runs on this error, it normally summarizes your oldest exchanges and keeps the newest. As a last resort, Claude Code summarizes differently:
- When it canât summarize any whole exchange, Claude Code keeps your newest prompt word for word and summarizes everything before it.
- In that case, when the conversation doesnât end with your prompt, Claude Code summarizes the whole conversation instead.
/clear to start fresh. Before v2.1.269, compaction failed whenever it couldnât summarize a whole exchange, so a session in that state hit this error again on every turn.
A single-exchange conversation has no earlier turns to summarize. When automatic compaction would have run on one, Claude Code skips the attempt and explains what fills the request instead. When the API doesnât report token counts in its error, the message reads:
Prompt is too long when it failed.
What to do:
- Run
/compactto summarize earlier turns and free space, or/clearto start fresh. If/compactanswersNot enough messages to compact., the conversation is a single exchange with nothing earlier to summarize, so the space is taken by that one prompt and what Claude Code sends with every request: run/clearand resend with less pasted text or smaller attachments, or reduce the tool definitions and memory files using the steps below - Run
/contextto see a breakdown of what is consuming the window: system prompt, tools, memory files, and messages - Disable MCP servers you are not using with
/mcp disable <name>to remove their tool definitions from context - Trim large
CLAUDE.mdmemory files, or move instructions into path-scoped rules that load only when relevant - Auto-compact is on by default and normally prevents this error. If you turned it off in
/configor withDISABLE_AUTO_COMPACT, turn it back on. If you keep it off, run/compactyourself before the window fills.
Context exceeds the token limit
/context shows this warning at the top of its output when the conversation has grown past the modelâs context window. Requests fail with Prompt is too long until you free space. An interactive session shows that error as the Context limit reached line.
/clear instead of /compact when you have set DISABLE_COMPACT.
What to do:
- In a multi-turn conversation, run
/compactto summarize earlier turns and free space. To start fresh instead, run/clear - For more ways to reduce usage, see Prompt is too long
/context showed usage above 100% with no warning line explaining what that meant or how to recover.
Request too large
The raw request body exceeded the APIâs 32MB limit before tokenization, usually because of large pasted content, tool results, or attachments. This limit is separate from the context window.Request too large (max 32MB; 20.1MB of about 33.4MB is images or documents).: images or documents pushed the request over the limit. Claude Code retries with them stripped.Request too large for the API's 32MB request limit: the messages alone are over the limit, so the message sayscompacting cannot make it fitand Claude Code doesnât retry. In non-interactive mode, the message tells you to reduce the input or start a new session instead.
Request too large (max 32MB). Double press esc to go back and try with a smaller file. Before v2.1.229, Claude Code showed the attachment advice for every rejection, even when compacting couldnât help.
What to do:
- If the message says
compacting cannot make it fit, press Esc twice to step back past the turn that added the large content, or run/clearto start fresh - Otherwise, run
/compact, which drops accumulated images and attachments - Reference large files by path instead of pasting their contents, so Claude can read them in chunks
- For images, see Image was too large below
Image was too large
A pasted or attached image exceeds the APIâs size or dimension limits.- Resize the image before pasting. The API accepts images up to 8000 pixels on the longest edge for a single image, or 2000 pixels when many images are in context.
- Take a tighter screenshot of the relevant region instead of the full screen
Unable to resize image
Claude Code couldnât downscale an attached image before sending it to the API.- If the message asks you to convert the image, convert it to PNG, JPEG, GIF, or WebP and attach it again. Claude Code can verify dimensions for these formats from the file header, without decoding the image.
- If the message reports a dimension or size limit, resize or recompress the image below that limit before attaching.
- If the message names a cause, such as a CMYK JPEG, an animated WebP, or a possibly damaged file, re-save the image in the format the message suggests and attach it again.
PDF errors
The PDF you attached couldnât be processed. The messages are shown here in their non-interactive form; in an interactive session they instead prompt you to double press esc and try again.- For oversized PDFs, ask Claude to read a page range with the Read tool instead of attaching the whole file, or extract text with a tool like
pdftotextand reference the output file by path - For protected or invalid PDFs, remove the password or re-export the file from its source application, then try again
pdftoppm. Install poppler-utils with the command the message gives, or on other platforms a poppler build that puts pdftoppm on your PATH. See Read tool behavior for which PDFs are read by page range.
Extra inputs are not permitted
A proxy or LLM gateway between Claude Code and the API stripped theanthropic-beta request header, so the API rejected fields that depend on it.
context_management alongside an anthropic-beta header that enables them. When a gateway forwards the body but drops the header, the API sees fields it doesnât recognize.
What to do:
- Configure your gateway to forward the
anthropic-betaheader. See feature pass-through for what gateways must forward. - As a fallback, set
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1before launching. Disable pre-release capabilities covers the exact scope.
Tool input schema is invalid
A tool in the request declared aninput_schema that fails the APIâs JSON Schema validation, so the API rejected the whole request. The number after tools. is the failing toolâs position in the requestâs tool list, not a name you can look up.
$schema. Claude Code doesnât check those schemas against the JSON Schema meta-schema, though the top-level property-name check still applies.
Before v2.1.216, no deployment ran the exclusion checks.
What to do:
- If your Claude Code version is earlier than v2.1.216, run
claude update. - Remove or disable the MCP server that declares the invalid schema. The error names the tool only by position. On v2.1.216 or later, check each serverâs log for a line naming a tool whose input schema would be rejected. If no log names one, disable servers one at a time.
- If you maintain the server, fix the toolâs
input_schema. The schema must be valid JSON Schema, and top-level property names must be 1 to 64 characters long and use only ASCII letters and digits,_,., and-. See Tools with invalid input schemas.
tool_use.name over 200 characters
A tool call in the conversation history carries a name longer than the 200 characters the API accepts in a request:No such tool available tool error and the conversation continues without this API error.
What to do:
- Run
claude update, then resume the conversation. The updated version repairs the overlong name when it loads the transcript, so a conversation that was stuck works again.
/compact and --resume, so this error repeated and the conversation was stuck.
Thereâs an issue with the selected model
The configured model name was not recognized or your account lacks access to it. As of v2.1.160 the trailing hint, shown here in its interactive form, varies by surface.- Interactive CLI: run
/modelto pick from models available to your account. - Non-interactive mode (
-p): pass--modelwith a valid alias or ID, or setANTHROPIC_MODEL. The error text showsRun --modelon this surface. - Agent SDK: the error text omits the hint because the model is set programmatically. Set
modelonOptionsin TypeScript orClaudeAgentOptions(model=...)in Python, and handle the structuredmodel_not_founderror to surface your own retry or model picker. - Use an alias such as
sonnetoropusinstead of a full versioned ID. Aliases resolve to a maintained default so they donât go stale. See Model configuration. - If the wrong model keeps coming back in the CLI, a stale ID is set somewhere. Check the places you can set a model in priority order and remove the stale value.
- Claude Code reports an expired claude.ai login as Login expired, not as this error. Before v2.1.206, an expired login that could no longer be refreshed failed every model with this error; run
/loginif you see that on an older version. - For Google Cloudâs Agent Platform deployments, see Google Cloudâs Agent Platform troubleshooting.
Model is not a recognized model id
The string you passed to a model switch isnât one Claude Code can use as a model, so it refused the switch without sending a request and the session keeps its current model. You can get this error when a model is set through the Agent SDKsetModel() method, by an app that runs the Claude Code CLI for you, such as the Desktop app, or when you pick a model from a device connected through Remote Control. Before v2.1.200, Claude Code saved the string and failed on the next request with Thereâs an issue with the selected model.
Sonnet 5, which the message repeats without its space. The trailing hint names the closest matching alias or model ID. When nothing is close enough, it reads Run /model to see available models. instead. In a session that the Desktop app starts for you, the no-match hint reads Switch to a different model.
When you switch through the Agent SDK or an app on the Anthropic API, only a string that canât be a model ID gets this error, such as a display name or an empty string.
When you pick a model from a Remote Control device, Claude Code checks the string locally. Any string that isnât a model alias, a model Claude Code lists or you configured, or an ID that starts with claude- gets this error, a mistyped ID such as claud-sonnet-5 included. Before v2.1.260, this check didnât cover Remote Control picks, so an unrecognized string was applied and failed on the next request.
What to do:
- Run
/modelwith no argument to open the picker and choose from the models available to your account, then pass the alias or ID shown there - If you used an alias that only a newer Claude Code version supports, run
claude update, or pass the modelâs full ID instead. The server can still require a minimum Claude Code version for that model; see Claude Code does not support this model. - A model saved before v2.1.200 isnât repaired by this check. If a stale value keeps coming back, remove it from the locations listed under Setting your model.
- On any provider other than the Anthropic API, or behind a gateway or custom
ANTHROPIC_BASE_URL, only an empty string gets this error. Claude Code can still write the unrecognized-model diagnostic line at request time, on every provider.
Model not found
You switched to a model by name and Claude Code couldnât confirm that a model with that name exists. When the name isnât a model alias or another spelling Claude Code accepts locally, Claude Code verifies it with a minimal API request, and this error is usually your API endpointâs answer. With/model <name>, a name that canât be a model ID at all, such as one containing spaces, gets the same message.
Try '...' instead suggestion that names your providerâs ID for a fallback model.
What to do:
- Run
/modelwith no argument and pick from the models available to your account, or use a model alias such assonnet, which resolves to a maintained default - If you typed a full ID, check it against your providerâs model catalog. A newly launched model can be available on the Anthropic API before your provider or region offers it.
- In the Agent SDK,
setModel()fails with this message and the session keeps running on its previous model. In the TypeScript SDK, callsupportedModels()to list the models you can switch to. - Before v2.1.265,
/modelalso rejected theopusplan[1m]alias spelling with this error. On those versions, update Claude Code, or set the model in settings or with--modelinstead.
Couldnât confirm model with the API
You switched models through the Agent SDKsetModel() method or an app that runs the Claude Code CLI for you, such as the Desktop app, and the request that confirms the model ID with your API endpoint got no answer within five seconds. The session keeps its current model.
Try again.
What to do:
- Switch to the model again
- If the switch keeps failing, check that Claude Code can reach your API endpoint; see Network and connection errors
API error when checking the picked model
You picked a model with/model <name>, or an app connected to the session requested the switch. The API refused the minimal request Claude Code sends to verify the model, for a reason that has no entry of its own, such as a rate limit or a server error. The session keeps its current model, and the message ends by saying so:
- Act on the serverâs explanation; for a rate limit or a 5xx status, wait and pick the model again
- The refusals with their own wording are covered by the surrounding entries, such as Model not found and Model is restricted by your organizationâs settings
Claude Opus is not available with the Claude Pro plan
Your active subscription plan does not include the model you selected.sign out and sign in again instead of naming the commands.
What to do:
- Run
/modeland select a model your plan includes - If you upgraded your plan recently and still see this, run
/logoutthen/login. The stored token reflects your plan at the time you signed in, so upgrading on claude.ai does not take effect in an existing session until you re-authenticate. - See claude.com/pricing for which models each plan includes
Claude Code does not support this model
The API refused the request with a 400 because your Claude Code version is below a required minimum. Either the model you selected requires a newer version, which the server checks per model, or your organizationâs policy requires one. The 400 carries the error codeclaude_code_version_too_old, and the message says which minimum applies.
- If you run
claude updateon the stable release channel, it doesnât move you past the newest stable release, which can still be below the required minimum. Move to the latest channel, then update again. If your organization pins your channel or version through managed settings, ask your admin to change it - For the per-model wording, you can keep working in the current session by switching to another model: run
/modelin the CLI, callsetModel()on the TypeScript SDKâsQueryobject in streaming input mode, or callset_model()on the Python SDKâsClaudeSDKClient - For the organization-policy wording, update before you continue
Model is restricted by your organizationâs settings
Your organization admin has disabled this model in the claude.ai admin console, or managed settings exclude it through anavailableModels allowlist or a deniedModels list. The notice appears at startup when --model, ANTHROPIC_MODEL, or the model setting named the restricted model, and it names the model the session uses instead. If managed settings leave no permitted model for the session to use, see Managed settings block the default model. The substitution notice can also appear mid-session after an admin disables the model a session is running on in the claude.ai admin console.
/model <name> for a restricted model is rejected and the session keeps its current model. For a model disabled in the admin console, the rejection reads Model '<name>' is restricted by your organization's settings. Run /model to choose a different model. For a model that managed settings exclude, it reads Model '<name>' is not available. Your organization restricts model selection.
A notice prefixed with an agent, skill, or command name means the restriction applied to that subagentâs requested model: the subagent runs on the substituted model and your sessionâs model is unchanged. Before v2.1.223, Claude Code showed the notice only for subagents launched with the Agent tool.
Claude Code treats a model family alias, one of opus, sonnet, haiku, or fable, as a request for that family rather than for its newest version. On the Anthropic API and on Claude Platform on AWS, a restricted family alias resolves to the newest version of the family that your organizationâs settings permit, and the substitution notice names that version. Claude Code rejects /model <alias> only when every version of the family is restricted. Before v2.1.205, a family alias was substituted or rejected based on its newest version alone, even when an older version of the same family was allowed.
What to do:
- Run
/modelto pick from the models your organization allows. Restricted models are hidden from the picker. - If the restricted model was set in
--model,ANTHROPIC_MODEL, themodelfield of a settings file, or themodelfrontmatter of a subagent, skill, or command, remove or update that value so the notice doesnât recur - If you need access to the restricted model, ask your organization admin to enable it. See Organization model restrictions.
Canât switch to the default model
You picked the Default model, for example by selecting the Default row in the/model picker or typing /model default. Claude Code refused the switch, so the session keeps its current model.
your organization's managed settings block it ... in "deniedModels": a managed deny list blocks the model the Default option resolves toyour organization allows only the models listed in "availableModels": a managedavailableModelsallowlist withavailableModelsMatchset to"exact"leaves out the model the Default option resolves toClaude Code couldn't read your organization's managed settings to check which models they allow: the managed settings couldnât be read, and Claude Code refuses the switch rather than apply it unchecked
- For the
deniedModelsandavailableModelswordings, run/modeland pick a model your organization allows by name - Ask your administrator to update the managed setting the message names
- For the
couldn't readwording, restart Claude Code; if it keeps happening, ask your administrator to check the managed settings
Claude Code can't start message under these managed settings, see Managed settings block the default model.
Model switch was blocked by a PreModelSwitch hook
A PreModelSwitch hook didnât approve the model switch you or a client requested, so the session keeps its current model. When the switch came from an Agent SDK host or Remote Control rather than a command you typed, the message readsModel switch blocked by a PreModelSwitch hook without naming the target model.
- A reason a hook wrote: a PreModelSwitch hook supplied that reason when it denied the switch or asked for confirmation. Address what it asks, or pick a model your hooks allow.
PreModelSwitch hook <name> did not respond before its timeout: a hook that doesnât answer before its timeout blocks the switch. Fix the hanging command or raise that hookâstimeout, then switch again.confirmation required, and this session cannot ask: a hook answeredaskwithout a reason, and a control request has no way to show the confirmation prompt. A/modelcommand in a-prun reports the same condition with(run /model interactively to confirm)after the reason. Make the switch from an interactive session, or change the hookâs decision for this model.so organization-managed PreModelSwitch hooks could not be checked: Claude Code couldnât tell which PreModelSwitch hooks your organizationâs managed plugins deliver, for example because a managed plugin failed to load. One of those hooks might block the switch, so Claude Code refuses rather than apply the switch unchecked. The start of the reason names what failed. Claude Code re-checks on every switch attempt, so a failure that has since cleared stops blocking; if it keeps failing, runclaude --debugand switch again to capture the details, then fix the plugin or ask your admin to fix it.a PreModelSwitch hook failed before answeringorPreModelSwitch hooks were cancelled (the control stream closed) before answering: the hook run ended without a verdict, and Claude Code doesnât treat that as approval. Runclaude --debugto see what failed, then switch again.
plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log. Claude Code retried the plugin load once and then refused later switches in the session, even when your organization managed no plugins. Restart the session to run the plugin load again on those versions.
Couldnât save it as your default
You picked a model to save as your default, for example with/model <name> or Enter in the /model picker, and Claude Code couldnât write the pick to your user settings file, ~/.claude/settings.json. The switch itself applied, so the current session runs on the model you picked, but your default is unchanged and the next session starts on the old value.
can't be written (<code>): the write failed with the operating system error code in parentheses, such asEROFSwhen the file, or the file it links to, sits on a filesystem that refuses writes. Make the file writable and switch again. If another tool generates the file, set themodelkey in that tool instead; see A change you made in Claude Code is lost in new sessions.isn't valid JSON: the file on disk doesnât parse, and Claude Code leaves it untouched rather than overwrite content it canât read back. Fix the syntax error, then switch again; see Fix a broken settings file.
couldn't confirm it was saved as your default (~/.claude/settings.json is still being written) means the write hadnât finished after three seconds. It continues in the background, so the default may still be saved; check which model your next session starts on, or run /model <name> again.
Before v2.1.265, the notice said the model was saved as your default for new sessions even when the write failed.
Advisor is less capable than the current main model
Your advisor model ranks below your sessionâs main model, so Claude Code keeps the selection but doesnât attach the advisor to the main modelâs requests.- In an interactive session, a notification reads
Advisor will not activate on the main model (advisor is less capable); subagents may still use it and may use more tokens · /advisor. - At launch with the
--advisorflag, a warning reads"<advisor>" cannot advise "<main model>" (the advisor must be at least as capable as the main model). The advisor will not be used for the main model.and the session starts anyway.
- Choose a higher-ranked advisor or a lower-ranked main model. Choose an advisor model shows the ranking and lists the accepted advisors for each main model.
- Leave the advisor set if you want subagents whose model it can advise to keep using it
thinking.type.enabled is not supported for this model
Your Claude Code version is older than the minimum for the selected model. The CLI sent a thinking configuration the model no longer accepts.- Run
claude updateand restart Claude Code. Opus 4.7 needs v2.1.111 or later. Opus 4.8 needs v2.1.154 or later. Sonnet 5 needs v2.1.197 or later. Opus 5 needs v2.1.219 or later. Opus 5.5 needs v2.1.280 or later. Sonnet 5.5 needs v2.1.284 or later - On the stable release channel, updating doesnât move you past the newest stable release, which can still be older than these versions. Move to the latest channel, then update
- If you canât upgrade, run
/modeland select Opus 4.6 or Sonnet 4.6 instead - If you hit this in the Agent SDK, upgrade the SDK package instead. Opus 4.8 needs TypeScript SDK v0.3.154 or later and Python SDK v0.2.88 or later. Sonnet 5 needs TypeScript SDK v0.3.197 or later. Opus 5 needs TypeScript SDK v0.3.219 or later. Opus 5.5 needs TypeScript SDK v0.3.280 or later. Sonnet 5.5 needs TypeScript SDK v0.3.284 or later
Effort isnât available with thinking turned off
You turned extended thinking off and ran at an effort level abovehigh. The model doesnât accept that combination, so the API rejected the request.
· varies by session: in a non-interactive session it reads use --effort high (or the effortLevel setting), and in a session the Claude Desktop app runs it reads you can lower effort to High.
What to do:
- Lower the effort level to
highor below. - Turn thinking back on, for example by unsetting
MAX_THINKING_TOKENSor removing"alwaysThinkingEnabled": falsefrom your settings.
API Error: 400 output_config.effort 'xhigh' is not supported when thinking is disabled on this model. Use effort 'high' or below, or enable thinking. Before v2.1.251, Claude Code sent the request at the effort level you set, so Opus 5 rejected every request above high with thinking turned off. Claude Code now sends effort high instead to models it knows reject the combination, such as Opus 5.
Thinking budget exceeds output limit
The configured extended thinking budget exceeds the maximum response length, so there is no room left for the actual answer.- Raise
CLAUDE_CODE_MAX_OUTPUT_TOKENSabove the thinking budget - See Extended thinking for how the budget interacts with output length
Tool use or thinking block mismatch
The conversation history reached the API in an inconsistent state.tool_use, tool_result, and thinking blocks in history no longer matches what the API expects.
What to do:
- If you are using Opus 4.7 or Opus 4.8, run
claude updatefirst. Versions before v2.1.156 can trigger this error during normal tool use, and/rewinddoesnât clear it. - Run
/rewind, or press Esc twice, to step back to a checkpoint before the corrupted turn and continue from there. See Checkpointing for how checkpoints are created and restored.
Invalid data in redacted_thinking block
The API refused the request with a 400 because it couldnât accept aredacted_thinking block that an earlier turn in the conversation history carries.
- If youâre on v2.1.281 or earlier and every turn fails with this error, run
claude updateand resume the session - If the error persists, run
/clearto start a conversation that doesnât carry the block
Unsupported tool content removed
When Claude Code connects directly to the Anthropic API and loads or previews a saved session, it removes tool content the Anthropic API doesnât accept and leaves this line where removed content sat between two thinking blocks:ANTHROPIC_BASE_URL that translates another providerâs tool calls. Claude Code removes it only when the session connects directly to the Anthropic API, and loads the saved history as it is when the session runs through a proxy or on another provider. Before v2.1.246, Claude Code sent the tool use and its result back to the API, and every turn of the resumed session failed with a 400 error such as messages.1.content.0.server_tool_use.name: Input should be 'web_search', 'web_fetch', ....
What to do:
- None needed when you see the placeholder line. The session continues without the removed content.
- If every turn of a resumed session fails with the 400 error instead, run
claude updateand resume the session again. Versions before v2.1.246 donât remove the content.
role âsystemâ must precede an âassistantâ message
The API refused the request with a 400 because a system message sits at a position in the conversation it doesnât accept:use the top-level 'system' parameter for the initial system prompt, get the same recovery.
When the error does appear, the refused system message isnât one Claude Code can remove. That usually means a proxy or LLM gateway between Claude Code and the API added a system message of its own.
What to do:
- If the error repeats on every turn behind a proxy or gateway configured through
ANTHROPIC_BASE_URL, connect without the proxy to confirm the source, and report the error to whoever operates it - Run
/clearto start a fresh conversation. If the error returns there too, the cause is on the request path, not in the saved conversation.
Invalid encrypted_content in search_result block
The API refused the request with a 400 because the conversation history holds hosted web-search content it canât decrypt. The wording names the field it canât read:encrypted_stdout wording names the output of a hosted code execution program that read such results, which the API encrypts as well. The API refuses a request that replays content it canât decrypt, such as content produced for a different organization.
Claude Codeâs own WebSearch tool records search results as plain text, so these blocks usually reach a conversation through a proxy or LLM gateway that ran hosted web search itself.
For the three web search wordings, Claude Code leaves the search calls, results, and citations out of what it sends and retries the request once, so the session continues without showing the error. The encrypted_stdout wording has no such recovery, so that message still reaches you. Before v2.1.282, Claude Code kept the refused web search blocks too, and every later turn and /compact failed the same way.
What to do:
- If youâre on v2.1.281 or earlier and every turn fails with one of the web search wordings, run
claude updateand resume the session - If the error persists, or the message names
encrypted_stdout, run/rewindto step back to a checkpoint before the turn that added the content, or run/clearto start a conversation that doesnât carry it - If you run Claude Code behind a proxy or gateway, report the error to whoever operates it
Usage Policy refusal
The API declined to respond because content in the conversation triggered a Usage Policy check. If the message includes the lineDetails: `[reasoning_extraction]`, see Safeguards flagged a request for Claudeâs reasoning.
The message includes a Request ID and a Message ID you can quote to support if you believe the refusal is incorrect.
Claude when no model is recorded.
The check evaluates the full conversation, not only your latest prompt, so sending a new message in the same session usually re-triggers the same refusal. The same applies after exiting and reopening the session with --continue or --resume, since the transcript on disk still contains the triggering content. On Amazon Bedrock, Google Cloudâs Agent Platform, and Microsoft Foundry, this message also covers requests the modelâs safety measures flagged as a cybersecurity topic. See Safety measures flagged a cybersecurity topic.
Before v2.1.219, the message read Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.
What to do:
- Press Esc twice or run
/rewindto step back to a checkpoint before the turn that triggered the refusal, then rephrase or take a different approach. See Checkpointing. - If you canât identify which turn caused it, run
/clearto start a fresh conversation in the same project. Your previous conversation is preserved on disk and remains available in/resume. - In non-interactive mode (
-p), where rewind is unavailable, retry with a rephrased prompt in a new session without--continue. Policy checks vary by model, so switching to a different model with--modelmay also resolve the refusal in some cases.
Safety measures flagged a cybersecurity topic
The modelâs safety measures flagged content in the conversation as a cybersecurity topic. The message names the model that flagged the request:Details: `[reasoning_extraction]`, see Safeguards flagged a request for Claudeâs reasoning.
The message links to the Cyber Verification Program, which grants access for legitimate cybersecurity work. On Opus 5.5 and Sonnet 5.5, the message opens with <model>'s safeguards flagged this session instead. When the flagged category has a fallback model available, Claude Code switches models rather than showing this error.
On Amazon Bedrock, Google Cloudâs Agent Platform, and Microsoft Foundry, a cybersecurity flag produces the Usage Policy refusal message instead.
The safeguard itself is server-side and predates v2.1.203; client releases since then have changed only the messageâs wording.
From v2.1.203 through v2.1.218, the message read <model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center: followed by the same help-center link, and interactive sessions appended If you were not engaging in a cybersecurity topic, please send feedback via /feedback.
Before v2.1.203, it read <model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption: followed by an exemption form link.
What to do:
- If your work requires this content, apply for access through the Cyber Verification Program
- If your request wasnât about a cybersecurity topic, run
/feedbackto report the false positive - To keep working in the same session, press Esc twice or run
/rewindto step back to a checkpoint before the turn that triggered the flag, then take a different approach. See Checkpointing.
Safeguards flagged a request for Claudeâs reasoning
The API declined the request because safeguards flagged it as asking the model to reproduce its internal reasoning in the response. The API names this refusal categoryreasoning_extraction, and the refusal message includes this line:
Details line.
What to do:
- Remove or reword any instruction that asks Claude to write out its thinking or reasoning verbatim or in a fixed format, such as a
<thinking>section, a scratchpad section, or areasoningfield in JSON output. The instruction can be in your prompt or in a customization that Claude Code loads with it, such as CLAUDE.md, a skill, a subagent prompt, an output style, or an MCP tool description. - To check whether a customization is the trigger, run
claude --safe-modein your terminal to start a session with customizations disabled, then send the same prompt - After you change a customization, start a new session
- To reword a prompt you already sent, see Rewind and summarize
- You can still ask Claude to explain its answer. Ask for a short explanation, the evidence behind a result, or a summary of the actions it took. To read summaries of Claudeâs thinking, see
showThinkingSummaries. - For more examples, and what to do if a reworded request is still declined, see Keep reasoning in thinking blocks
Output blocked by content filtering policy
The APIâs output content filter stopped the response Claude was generating. The message text comes from the API:- Rephrase your last message or take a different approach
- To step back to a checkpoint before the turn that triggered the block, press Esc twice or run
/rewind. See Checkpointing
Installation errors
These errors appear while installing or updating Claude Code, from the install script,claude install, or claude update. For command not found, PATH, permission, and TLS problems during setup, see Troubleshoot installation and login.
Installation was killed before it could finish
The install script reports when theclaude install step is terminated by a signal. On Linux, exit code 137 means the process received SIGKILL, and on a low-memory host thatâs usually the kernel out-of-memory (OOM) killer. The script prints this explanation and exits with code 137:
Installation was killed before it could finish (exit code <N>) with the actual exit code and omits the out-of-memory explanation. The message comes from the install script macOS and Linux use, which also covers installs inside WSL; the native Windows install scripts never print it. Before v2.1.200, the script exited with only the shellâs bare Killed line.
What to do:
- Stop other processes to free memory, then rerun the installer
- Add swap space or move to a larger instance. See Install killed on low-memory Linux servers for the swap-file commands.
The connection dropped while downloading the update
The connection to the download server closed whileclaude install or claude update was fetching the Claude Code binary, and the retries didnât recover. Claude Code retries the download when the connection drops, the transfer stalls, or the downloaded file fails its checksum, up to three attempts in total. A completed HTTP error, such as a 404, isnât retried because the server already answered. Before v2.1.202, a single dropped connection failed the download immediately with the bare error aborted instead of retrying.
claude update precedes the message with Error: Failed to install native update on stderr.
A download that stays connected but doesnât finish within 10 minutes fails with Download timed out: exceeded the total deadline instead. Claude Code doesnât retry a timed-out download, because a connection too slow to finish inside the deadline wonât finish on an immediate retry either. The steps below apply to both messages.
A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download.
What to do:
- Run
claude updateagain. On an otherwise healthy network, the download usually succeeds on the next run. For the timed-out message, run it again from a faster or less throttled network. - If your network requires a proxy, set
HTTPS_PROXYbefore running the installer orclaude update. See Check network connectivity. - If a corporate proxy keeps closing the transfer, ask your network team to allow the full download from
downloads.claude.ai. See Network access requirements. - Run
claude doctorfrom your shell for installation diagnostics
Command-line errors
These errors come from theclaude command line and its subcommands, from a command name you submit at the prompt, and from commands such as /security-review that gather context by running shell commands before their prompt runs. They also come from /tui, which relaunches the CLI.
Conflict between --bg and --print
This message requires Claude Code v2.1.198 or later. You combined --bg with -p or --print in the same claude invocation. --bg starts a background session that you later attach to with claude agents, while --print runs non-interactively and never starts the interactive session that claude agents attaches to. Before v2.1.198 this combination silently created a background job that could never be attached to.
- Drop
-por--print.--bgtakes the prompt as its positional argument, soclaude --bg "<task>"is the complete command. See Dispatch new agents from your shell. - To run the prompt non-interactively and print the result instead of creating a background session, drop
--bgand runclaude -p "<task>"
Conflict between a system prompt flag and its file form
You passed--append-subagent-system-prompt together with --append-subagent-system-prompt-file in one claude invocation, so claude exits with code 1 instead of starting the session:
claude exited the same way when you passed --system-prompt with --system-prompt-file, or --append-system-prompt with --append-system-prompt-file, because those pairs conflicted instead of combining. On those versions the message names the pair you combined.
What to do:
- Keep one form of the flag and drop the other. To combine a fixed prompt file with per-run text, merge the text into the file before launching instead of passing both flags
Invalid --agents configuration
The value you passed to --agents is invalid, so claude exits with code 1 instead of starting the session. When you pass --safe-mode or set CLAUDE_CODE_SAFE_MODE, Claude Code ignores --agents entirely. With --resume or --continue, an inline JSON value isnât checked and the session starts; a value read from a file is checked on every launch. Before v2.1.242, Claude Code started the session anyway.
- When the value begins with
{but doesnât parse as JSON, or the contents of an--agentsfile donât parse, Claude Code prints oneinvalid JSON:line carrying the JSON parserâs own message - When it parses but an agent definition doesnât match the schema for CLI-defined subagents, Claude Code prints one line per problem
- When an agent name starts with
-, Claude Code prints<name>: agent names must not start with '-'
âĶand N more.
With --print, --agents also accepts the path to a JSON file in place of the inline object. Before v2.1.281, --agents accepted only inline JSON and treated a file path as invalid JSON. The file form has refusals of its own, printed in place of this message, including these:
Error: --agents takes a JSON object, or a file path only with --print (-p): Claude Code read the value as a file path in an interactive session. Pass the definitions as inline JSON, or add-pto read them from a file.Error: --agents file not found: <path>: no file exists at that path. A value that doesnât begin with{and isnât valid JSON is read as a path, so inline JSON that your shell mangled can fail this way too. Check the path or the quoting and run the command again.
- Fix each problem the message lists, then run the command again. See the fields a CLI-defined subagent takes.
Cloud sessions cannot be created from a --restricted session
When you start a session with --restricted, Claude Code refuses to create cloud sessions from it, because the new session would run outside the restricted process and wouldnât enforce restricted mode. Claude Code refuses on the client, before contacting the server, so no cloud session is created:
- Run the task locally in the restricted session
- If you control how the session was launched, start a new
claudesession without--restrictedand create the cloud session from there
--restricted flag; earlier versions reject the flag itself with an unknown-option error.
Cloud sessions are disabled by your organizationâs policy
Your organizationâsallow_remote_sessions policy is off, so cloud sessions and the commands that use them arenât available:
/teleport, /remote-env, or /web-setup. Before v2.1.268, submitting one of those commands returned Unknown command instead.
This is a server-side organization policy, so it canât be overridden from local settings, environment variables, or CLI flags.
If Claude Code hasnât loaded your organizationâs policy yet or canât fetch it, those commands answer Couldn't verify your organization's policy for cloud sessions. Check your network connection, then restart Claude Code and try again. instead.
What to do:
- Ask an Owner in your organization to enable cloud sessions in the Claude Code admin settings at claude.ai/admin-settings/claude-code
- If the message says it couldnât verify the policy, check your network connection, then restart Claude Code and try again
The --json-schema value is not a valid JSON Schema
The schema you passed to --json-schema in non-interactive mode failed JSON Schema compilation, so claude exits with code 1 instead of running the prompt. Before v2.1.205, an invalid schema produced unstructured output with no error, and any schema that used the format keyword was treated as invalid.
format keyword, such as "format": "email", are valid: Claude Code accepts format as an annotation and doesnât enforce it.
Claude Code runs two checks before schema compilation: it rejects a value that isnât parseable JSON with Error: --json-schema is not valid JSON, and valid JSON that isnât an object with Error: --json-schema must be a JSON object.
What to do:
- Fix the part of the schema the diagnostic names, then rerun the command
- See Get structured output for a working schema and command
Settings file exceeds the 2MiB limit
The file you passed to--settings is larger than 2 MiB, so claude exits with code 1 at startup instead of loading it. Before v2.1.214, Claude Code read the file with no size check, and a multi-gigabyte file or a device file such as /dev/zero grew memory without bound.
--settings path that isnât a regular file the same way: a device, FIFO, or socket reports Error: Cannot use settings file (Not a regular file (device, FIFO, or socket)) followed by the path, and a directory reports an EISDIR reason.
What to do:
- Point
--settingsat a regular JSON settings file under 2 MiB. See Settings for the format.
The current directory no longer exists
You startedclaude from a directory that was deleted or moved after your shell entered it, for example a worktree or temp directory another shell removed. Claude Code canât read its working directory, so it exits with code 1 before starting the session, in interactive and non-interactive mode alike. Before v2.1.239, Claude Code crashed with minified bundle source and a raw ENOENT ... uv_cwd stack on stderr instead of this message.
Can't read the current directory (EACCES). Start Claude Code from a different directory.
On macOS, EPERM for a directory in ~/Desktop, ~/Documents, ~/Downloads, or iCloud Drive usually means macOS is blocking your terminal app from that folder. Other commands that read that folder fail the same way: ls there reports Operation not permitted, even with sudo.
What to do:
- Change to a directory that exists, such as your home or project directory, then run
claudeagain - If the directory was recreated at the same path, your shell still holds the deleted one. Run
cd "$PWD"or leave and re-enter the directory, then runclaudeagain - For
EPERMon macOS, quit your terminal app with Cmd+Q, open it again, return to that folder, and runclaude. Iflsin that folder still fails, open System Settings > Privacy & Security > Files and Folders, turn on the folder for your terminal app, then reopen the terminal
Temp directory refused or cannot be created
On macOS and Linux, Claude Code creates a private temp directory at startup,claude-<uid> under the system temp directory or the CLAUDE_CODE_TMPDIR override. When the directory canât be created, or an entry already at that path fails the safety checks, Claude Code prints the failure to stderr and exits with code 1 rather than start the session:
- For
ENOSPC, free disk space on the volume that holds the temp directory - For the
Refusing to use itforms, remove the named entry itself, not what a link points to, and start Claude Code again; for theowned by uidform, only an administrator or that user can remove it - For
is not readable, runchmod 0700on the named directory, or remove it and start again - In any of these cases, set
CLAUDE_CODE_TMPDIRto a directory you control and start Claude Code again, leaving the refused path alone
Directory couldnât be resolved to a real location
You ran/add-dir for a subdirectory of your working directory, and Claude Code couldnât resolve the directory to its real location.
You already have file access to a subdirectory of the working directory, so /add-dir only loads its skills, commands, and agents. Before loading them, Claude Code checks that the directoryâs real location, with any symlinks resolved, is inside the working directory. When Claude Code canât resolve that location, it loads nothing and shows this message:
- Check that the path names a real directory inside the working directory, then run
/add-diragain - The message doesnât change your file access; it only reports that the directoryâs
.claude/content wasnât loaded
/add-dir <subdirectory> when the working directory was on a /net/<host> automount, where Claude Code declines to resolve paths by design; the directory was fine and retrying couldnât help.
Workspace not trusted when starting Remote Control
You started Remote Control server mode withclaude remote-control or its claude rc alias in a directory you havenât trusted, and the command couldnât ask you whether to trust it. For example, the commandâs standard input or standard output isnât a terminal because one of them is redirected or piped. The command exits with code 1:
Error: Workspace not trusted. appear in a terminal too small to show what trusting the directory turns on, or one that didnât report its size. Enlarge the window or switch to a normal terminal window, then run claude rc again.
In your home directory the message is different, because the workspace trust dialog never saves trust for the home directory, so accepting it there canât satisfy this check. Before v2.1.214, the home directory showed the message above, whose advice canât succeed there.
n or press Enter at the Trust <directory>? question, the command prints a Remote Control did not start message that names the directory and exits with code 1. Run claude rc again to answer y.
What to do:
- Trust the directory from a terminal first: run
claude rcthere and answery, or runclaudethere and accept the workspace trust dialog, then run your original command again - In your home directory, change to a project directory and start Remote Control there
Not carried over to the sessions Remote Control starts
You started Remote Control with a globalclaude flag before the remote-control verb, one that would restrict or configure the sessions Remote Control starts, such as --settings, --setting-sources, --permission-mode, --disallowed-tools, or --mcp-config. A flag placed before the verb never reaches those sessions. Claude Code refuses to start instead, naming the flag:
--verbose, --model, or a wrapper-injected --session-id or --plugin-dir: it ignores them and Remote Control starts.
Claude Code also refuses to start for a global flag it doesnât yet recognize as harmless, so a flag added in a newer release can appear in this message until a later release marks it harmless.
What to do:
- Remove the flag from before the verb and pass Remote Controlâs own options after it;
claude remote-control --helplists them - When the refused flag is
--permission-mode, runclaude remote-control --permission-mode <mode>to set the permission mode for the sessions Remote Control starts
claude remote-control didnât accept its own flags when a global flag came first, and the command failed with an unknown option error.
claude import is not yet available in this build
You ranclaude import, and Claude Code found the import flow turned off, so the command exits with code 1 instead of starting the import. Before v2.1.222, a build with the import flow off treated import as a prompt and started an interactive session instead of printing this message.
claude import on through a feature flag it fetches from Anthropic and caches on disk. This message means the cached value is off. The cause is usually one of the following:
- You havenât started a session since installing, so Claude Code hasnât fetched the flag yet. The first
claude importcan print this even when the feature is available to you. - You use Claude Code through Amazon Bedrock, Google Cloudâs Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a Claude apps gateway. Claude Code doesnât fetch feature flags in these sessions, so
claude importstays unavailable. - You set
DISABLE_TELEMETRY,DO_NOT_TRACK,DISABLE_GROWTHBOOK, orCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, which turn off feature-flag fetching, soclaude importstays unavailable.
- On a fresh installation, start
claude, wait for the session to load, exit, and runclaude importagain - Where feature-flag fetching stays off, set the configuration up yourself: add MCP servers with
claude mcp add, and create theCLAUDE.mdfiles, skills and commands, and subagents you want to carry over. The message also names~/.claude/settings.json. Of the configurationclaude importcarries, that file holds only the permission mode; Claude Code doesnât read MCP servers from it.
Could not read Claude Code config
You ranclaude import while Claude Code couldnât parse ~/.claude.json, the file where it stores your login and per-project state. The subcommand reads that file to check availability but doesnât show the recovery dialog the interactive session shows, so it exits with code 1. Before v2.1.222, claude import with an unreadable config file started an interactive session, whose recovery dialog handled the file.
- Run
claudewith no arguments. Claude Code detects the invalid file and offers to reset it. Then runclaude importagain. - To keep manual edits youâve made, fix the JSON syntax in
~/.claude.jsonin an editor instead, then rerunclaude import
Could not import a server from Claude Desktop
Claude Code couldnât add one of the servers you selected inclaude mcp add-from-claude-desktop. The command still imports the other selected servers and prints one line per server it couldnât add. Before v2.1.205, the first server that failed stopped the import.
claude mcp restricts to letters, numbers, hyphens, and underscores. Other reasons include a server configuration that fails validation and a server blocked by your organizationâs MCP policy.
What to do:
- Rename the server in
claude_desktop_config.jsonto use only letters, numbers, hyphens, and underscores, then runclaude mcp add-from-claude-desktopagain - Add that server directly with
claude mcp addorclaude mcp add-jsonunder a valid name. See Import MCP servers from Claude Desktop.
Cannot add MCP server to the managed scope
You ranclaude mcp add or claude mcp add-json with --scope managed. That scope holds the servers your organization provides through the managedMcpServers managed setting. Claude Code reads them from managed settings only, so the command canât write a server to that scope.
- Add the server to a scope you can write:
local,user, orproject. Without--scope, the command useslocal. See MCP installation scopes - To provide the server to every user in your organization, add it to
managedMcpServersin the managed settings you deploy
Cannot add MCP server when managed settings allow only plugin servers
You ranclaude mcp add or claude mcp add-json while your organizationâs managed settings set strictPluginOnlyCustomization to true or to a list that includes mcp. With that setting, Claude Code doesnât load MCP servers from ~/.claude.json or .mcp.json, so the command exits with code 1 instead of saving a server that would never load:
claude mcp add-from-claude-desktop reports each server you select as not imported, with this message as the reason. /import reports this message for each MCP server it tries to add and still imports the other items it found.
Before v2.1.284, these commands saved the server and reported success, and the server never loaded.
What to do:
- Install a plugin that provides the server
- Ask your administrator to distribute the server in a plugin, or to provide it through
managedMcpServersif itâs a remote HTTP or SSE server
Canât read .mcp.json
A command that reads the projectâs.mcp.json, such as claude mcp add or claude mcp add-json with --scope project, or claude mcp remove, found that the file in your current directory isnât a regular file or is larger than 2 MiB, so it exits with this error instead of reading the file.
.mcp.json left the command waiting forever with no output, and a symlink to a device file such as /dev/zero grew memory until the process was killed.
What to do:
- Check what sits at
.mcp.jsonin your current directory. Replace it with an ordinary JSON file in the project-scope format, or delete it, then run the command again.
MCP server was not saved or removed
You ranclaude mcp add, claude mcp add-json, or claude mcp remove for a server in the user or local scope. Both scopes are stored in ~/.claude.json, and the change isnât in that file when Claude Code reads it back after writing. The command exits with this error instead of its success line.
was not removed from and ends with then remove the server again. For a local-scope server, the path is followed by the project directory the entry belongs to, as (local scope for /path/to/project).
Before v2.1.283, claude mcp add, claude mcp add-json, and claude mcp remove reported success even when the change didnât reach the file.
What to do:
- Make the file the message names writable, or run the command outside the sandbox, then run the same add or remove command again.
MCP server may not have been saved or removed
You ranclaude mcp add, claude mcp add-json, or claude mcp remove for a server in the user or local scope, and Claude Code couldnât read ~/.claude.json back to confirm the change. The change may or may not be on disk. The text in parentheses is the error from that read.
may not have been removed and ends with then remove the server again if it is still listed.
Before v2.1.283, the commands reported success even when the change couldnât be confirmed.
What to do:
- Run
claude mcp get <name>to check whether the change is on disk. For alocal-scope server, run it from the project directory the server belongs to, since local scope is per project. - If the server is missing after an add, or still listed after a remove, run the same add or remove command again.
Server is Anthropic-hosted and doesnât support local OAuth
You started a sign-in for an MCP server whose URL points at an Anthropic-hosted connector host that authenticates through a third-party identity provider. These hosts includemicrosoft365.mcp.claude.com, gmail.mcp.claude.com, and gcal.mcp.claude.com. Claude Code refuses to start its local OAuth flow for these hosts from both the /mcp panel and claude mcp login, because their sign-in works only through claude.ai.
- Remove your entry with
claude mcp remove <name>, so it canât hide the claude.ai connector at the same URL - After removing it, connect the service at claude.ai/customize/connectors, while signed in to the account you use in Claude Code. Once connected, the connector appears in Claude Code automatically if your active authentication method is a claude.ai subscription login
Server rejected the Authorization header minted by the configured headersHelper
An MCP server whoseheadersHelper supplies the Authorization header answered the connection with HTTP 401 or 403, so Claude Code reports the connection as failed. Because the helper supplies the Authorization header, Claude Code doesnât fall back to OAuth for the server:
- Run the
headersHelpercommand yourself the way Claude Code runs it: from the directory Claude Code runs it in, with the environment variables Claude Code sets for it, and without the credential variables Claude Code removes for a server from a project.mcp.json, a plugin, or a project agent file. Check that it prints anAuthorizationvalue the serverâs endpoint accepts - After fixing the helper or its credential source, select the server in
/mcpand choose Reconnect
Authorization header. That discovery could fail with Incompatible auth server: does not support dynamic client registration instead of reporting the rejected credential.
MCP permission prompt tool not found
The tool you passed to--permission-prompt-tool wasnât among the connected MCP tools when the run first needed a permission decision, either because its server never connected or because no connected server exposes a tool by that name. Claude Code still sends your prompt: the non-interactive run exits with this error, and exit code 1, on the first tool call, so it produces no answer even though the request was made. Before the first prompt, Claude Code waits up to the per-server connection timeout of 30 seconds set by MCP_TIMEOUT for that server to connect. Before v2.1.206, startup didnât wait for the server to finish connecting, so a slow-starting but healthy server produced this error too.
Available MCP tools: names the MCP tools that were connected.
What to do:
- Check that the server starts and stays connected: run
claude mcp listin the same directory and confirm the server is listed as connected - Confirm the tool name matches the
mcp__<server>__<tool>name the server exposes - If the server needs longer than 30 seconds to start, raise
MCP_TIMEOUT
OAuth callback port is already in use
When you sign in to a remote MCP server with OAuth, Claude Code starts a local listener to receive the sign-in callback. If the port that listener needs is held by another process, the sign-in fails with this message. This mostly happens with a fixed callback port set through theMCP_OAUTH_CALLBACK_PORT variable or --callback-port, since without one Claude Code picks an available port.
netstat -ano | findstr :<port> instead.
What to do:
- Run the command from the message to find the process holding the port, and stop it or wait for it to finish
- If another program needs that port permanently, register a different redirect URI with the server and set its port with
MCP_OAUTH_CALLBACK_PORTor--callback-port, whichever you use - Then start the sign-in again, for example by selecting the server in
/mcp
No available ports for OAuth redirect
When you sign in to a remote MCP server with OAuth, Claude Code starts a local listener to receive the sign-in callback. The sign-in fails with this message when Claude Code canât bind a local port for it. Something on the machine is preventing it from listening on127.0.0.1, for example security software or a sandbox policy that denies local listeners.
- Check whether security software or a sandbox policy blocks processes from listening on
127.0.0.1, and allow Claude Code to bind a local port - Then start the sign-in again, for example by selecting the server in
/mcp
/security-review fails without origin/HEAD
/security-review builds its review context by diffing your branch against origin/HEAD, the local ref that records which branch is the default on your origin remote. When that ref doesnât exist, the git commands that gather the diff fail and the review stops before it starts.
git log or a different git diff instead. Git creates origin/HEAD only when the remote advertises a default branch and your fetch refspec covers it, which a full git clone of a remote with commits does. The ref is missing in these setups:
- A single-branch or CI checkout, which fetches too narrow a refspec
- A remote whose server-side HEAD points at a branch nobody pushed
- A repository with no
originremote, or one you never fetched
Shell command permission check failed for pattern "...": the commandâs permission check didnât allow it. Permission checks on injected commands covers which results abort in each permission mode and how to pre-approve a command withallowed-toolsSkill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found: the skillâs frontmatter demands bash on a machine without it. Install Git for Windows or change the frontmatter toshell: powershell. See How injected commands run
- Create the ref by naming your remoteâs default branch:
git remote set-head origin <default-branch>. This works whenever the local tracking reforigin/<default-branch>exists. If it doesnât, as in single-branch clones, fetch the branch first: rungit remote set-branches --add origin <branch>, thengit fetch origin, then rerun the set-head command. Rerun/security-review. - If youâd rather not name the branch, run
git fetch originand thengit remote set-head origin --auto, which asks the remote which branch is its default. It fails witherror: Cannot determine remote HEADwhen the remote advertises no default branch, because it is empty or its HEAD points at a branch nobody pushed; name the branch explicitly instead. It fails witherror: Not a valid refwhen your clone doesnât fetch that branch; widen the refspec as above first. - If the repository has no remote, add one with
git remote add origin <url>and fetch before creating the ref. If the remote is empty, push your branch first withgit push -u origin HEADand name that branch in the set-head command;origin/HEADthen points at the branch you just pushed, so/security-reviewsees an empty diff until the branch diverges from it.
Input must be provided when using --print
Bare claude needs stdout to be a terminal to start the interactive UI. When stdout is redirected, or the console isnât a real terminal, such as PowerShell ISE and some IDE output panes, claude runs non-interactively instead. That is the same mode as claude -p, which requires a prompt, so the message names --print even when you didnât pass the flag. Passing -p/--print with no prompt and nothing piped on stdin produces the same error anywhere.
- For interactive use, run
claudein a real terminal: Windows Terminal or the PowerShell console rather than ISE, and your IDEâs integrated terminal rather than an output pane - For one-shot use, pass the prompt:
claude -p "your question", or pipe it withecho "your question" | claude -p
Claude Code canât read the keyboard here
You ranclaude without -p, which starts an interactive session, but its standard input isnât a terminal. Something piped or redirected it, or the program that launched claude supplied its own input stream.
An interactive session needs a terminal to read your keystrokes from, and what Claude Code does without one depends on your platform:
- Windows: Claude Code prints the message to stderr and exits with code 1 instead of starting the interface
- macOS and Linux: Claude Code reads your keystrokes from
/dev/ttyand starts the session, with any piped text as your first prompt. You see the message when/dev/ttycanât be opened, and its first line names/dev/ttyin place of the Windows wording.
- To work interactively, run
claudedirectly in a terminal, without piping or redirecting its input - To get a reply without the interactive interface, for example from a script, add
-pand give the prompt as an argument or on stdin, as inclaude -p "your question"orecho "your question" | claude -p. The same works with--continueand--resume <session-id>.
Raw mode is not supported.
If you see Raw mode is not supported during claude install instead, see Raw mode is not supported during install.
Input contained only whitespace
In non-interactive mode, Claude Code refuses a prompt made up entirely of spaces, tabs, or newlines instead of sending it, because the API rejects messages with no visible text. Which message you see depends on where the blank prompt came from:- Prompt argument or piped stdin for
claude -p:claudeexits withError: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print - Message submitted to a running
--input-format stream-jsonor Agent SDK session: Claude Code ends the turn without calling the model and the session stays usable. The refusal arrives as an informational message and as the turnâs result text:Blank prompt â the message was only whitespace, so nothing was sent to the model.
- Include visible text in the prompt. If a script builds the prompt from a variable or file, check that the source isnât empty before calling Claude Code.
stream-json input carried over 256M characters with no newline
Your program sent more than 268,435,456 characters on stdin without a newline to aclaude -p --input-format stream-json run, so Claude Code prints this error to stderr and exits with code 1 instead of buffering more input. The message states that budget as 256M. Before v2.1.257, Claude Code buffered such input without limit, growing memory until the process crashed or was killed.
- Check whatâs piped to stdin. With
--input-format stream-json, every message must be one newline-terminated JSON line - To send plain text instead, drop
--input-format stream-json;claude -preads a plain-text prompt from stdin by default
Unknown command
In an interactive terminal session, you submitted a/ name that doesnât match any command in this session, so Claude Code reports the name instead of running anything:
- A typo, such as
/heplfor/help. How the command menu matches what you type covers picking a close match before you submit - A command that exists but isnât available in this session because a requirement isnât met, such as your platform, plan, or authentication method. The troubleshooting entries for
/web-setupand/schedulewalk through two common cases. Some commands answer with their own message when your organizationâs policy disables them, such asCloud sessions are disabled by your organization's policy - A command from a plugin or MCP server that isnât installed or connected in this session
/ name this way only in an interactive terminal session. In every other session, it sends the prompt to Claude as a normal message instead, with a note that the command didnât run and a list of commands Claude can run in the session. Those sessions include:
-pruns- Agent SDK applications
- The Code tab of the Desktop app
- The chat panel of the VS Code extension
- Cloud sessions and routines
Unknown command too.
Claude Code doesnât treat every prompt that starts with / as a command. It sends the prompt to Claude as a normal message when the first word after the / starts with punctuation, such as the /-- that opens a Lean doc comment, or is a path such as /var/log/syslog.
Before v2.1.236, if you pressed Enter while the command menu listed a near match for the name you typed, Claude Code ran that match, so a typo such as /hepl ran /help instead of producing this message.
What to do:
- Run the suggested name, or type
/followed by part of the name to see whatâs available in this session - If Claude Code reports a documented command as unknown, check its row in the commands reference for the requirement it names
Diff is too large for ultrareview
The diff between your branch and the base branch, including uncommitted and staged changes, exceeds the size limits for an ultrareview, so/code-review ultra and the claude ultrareview subcommand refuse the review before the cloud session starts. A refused review doesnât use a free run and doesnât bill usage credits. The message names the limits in effect, the size of your diff, and the files that contribute the most changed lines. Before v2.1.216, the message showed only the raw diff statistics.
PR #<N> is too large for ultrareview and names the PRâs file and line counts.
What to do:
- Pass a base branch closer to your work, such as
/code-review ultra develop, so the review covers only the diff against that branch - Split the change into smaller branches and review each one. The files the message names contribute the most changed lines, so start by moving those to their own branch.
Could not find merge-base with the base branch
/code-review ultra and the claude ultrareview subcommand review the diff between your branch and a base branch, which needs a commit the two share. When git merge-base finds none, Claude Code refuses the review before the cloud session starts. On a clone Claude Code can verify is complete, with at least one branch, it falls back to reviewing every tracked file instead of refusing. You see this refusal when the base branch canât be found at all, when Claude Code canât verify that your clone is complete, or in the rare repository where the whole-tree diff isnât possible, such as the SHA-256 object format.
- You didnât pass a base branch: Claude Code compared against the repositoryâs default branch and suggests passing your base explicitly, as in the example above
- You passed a base branch that was already in your clone: the hint reads
Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`) - You passed a base branch that wasnât in your clone: Claude Code fetched it from origin before comparing. The hint reads
<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`); when Claude Code canât tell whether your clone is shallow, it suggestsgit fetch --unshallow origininstead. Before v2.1.221, the hint suggestedgit fetch --unshallow originfor every fetched base branch, and on a complete clone that command fails withfatal: --unshallow on a complete repository does not make sense.
- If another branch is your real base, pass it explicitly:
/code-review ultra <branch> - If your clone might not have full history, run
git fetch --unshallow originand rerun the review
Your checkout has no branches
A checkout can have commits but no branches: if you rungit init followed by git fetch <url> and git checkout FETCH_HEAD, you get a detached HEAD with no refs. Claude Code packages your repository as a git bundle to upload it for an ultrareview, and it canât bundle a repository that has no branches or other refs, so /code-review ultra and the claude ultrareview subcommand refuse the review before the cloud session starts.
- Create a branch at your current commit with
git checkout -b <name>, then rerun the review
No GitHub account is connected to your Claude account
You ran/code-review ultra <PR#> or claude ultrareview <PR#>, and before creating the cloud session Claude Code asks the server whether the GitHub account connected to your Claude account can reach the PRâs repository. No account is connected, or the connection expired, so the cloud clone would fail and Claude Code refuses the launch. Claude Code doesnât spend a free run or bill usage credits for a refused launch.
/web-setup isnât available in your session, the message names only the claude.ai link.
What to do:
- Run
/web-setupto connect your GitHub CLI login to your Claude account, or connect an account at claude.ai/connect-github - Rerun the review a minute after connecting
Your connected GitHub account canât see the repository
You ran/code-review ultra <PR#> or claude ultrareview <PR#>, and the GitHub account connected to your Claude account canât read the PRâs repository, so the cloud clone would fail and Claude Code refuses the launch. Claude Code doesnât spend a free run or bill usage credits for a refused launch.
/web-setup isnât available in your session, the message names only the app install.
What to do:
- If your local
ghCLI can read the repository, run/web-setupto connect that login to your Claude account - Rerun the review after the change
The GitHub App preflight failed transiently
You started a cloud session from a local repository, and two steps failed together. Claude Code couldnât build or upload the bundle of your repository. Before the upload, it checked whether the cloud service can clone the repository from GitHub, and rather than a definite answer, that check ended in an error that a retry could clear, such as a network error, a timeout, or a temporary server error. The full message starts with what stopped the bundle, for exampleCould not upload repo bundle (<error>), and ends with the preflight sentence:
- Rerun the command after a moment. When the GitHub check passes, Claude Code can start the session from a GitHub clone, so the failed upload no longer blocks the launch
- If retries keep failing, the start of the message names what stopped the upload. When that cause is something you can fix, fix it so the session can start from your local repository instead
Please set up GitHub on https://claude.ai/code even when the GitHub check failed only transiently, and setup advice canât clear a transient failure.
The repository upload canât follow a git setting
You started a cloud session that uploads your local repository, or an ultrareview of a branch, and the upload canât follow one of the git settings that decide which attribute rules apply to your files. If the upload went ahead and missed a rule, a file that git transforms before storing it, such as one a clean filter encrypts, could reach the cloud as it is on disk. Claude Code refuses the upload instead, and nothing is uploaded:core.attributesFile and attr.tree, each with its own fix.
The message can name a config file that your git configuration pulls in through an include or includeIf directive, even when that directiveâs condition doesnât apply to this repository.
What to do:
- Apply the fix in the messageâs final sentence
GitHub isnât connected to your Claude account
You started a cloud session from your local repository, for example with/autofix-pr. No GitHub account is connected to your Claude account, or the connection expired, so Claude Code refuses the launch:
/schedule, the same message appears as a setup note that names the repository; the note doesnât block creating the routine.
What to do:
- Run
/web-setupto connect your GitHub CLI login to your Claude account, or connect an account at claude.ai/connect-github. See GitHub authentication options for how the two differ. - Rerun the command a minute after connecting
A GitHub organization policy is blocking Claude
You ran a command at the Claude Code prompt that starts a cloud session, such as/autofix-pr. Before it creates the session, Claude Code checks Claudeâs access to the repository on GitHub, and GitHub refused because your GitHub organization has a policy that blocks Claude. Claude Code stops there and shows a message naming the policy.
When an IP allow list is what blocks the access, the message reads:
- IP allow list: ask an owner of your GitHub organization or enterprise to allow Anthropicâs outbound IP addresses. See GitHub allow lists and firewalls for the addresses and the GitHub settings to change.
- Single sign-on: disconnect GitHub at claude.ai/customize/connectors, then connect it again. When GitHub asks, click Authorize next to your organization so the new connection is authorized for its single sign-on.
- Conditional Access policy: ask your GitHub Enterprise or Microsoft Entra ID administrator to allow Claude in that policy
- After the change, run the command again
Single sign-on authorization needed
You ran/install-github-app and chose a repository whose organization enforces SAML single sign-on. Before setup, Claude Code checks your access to the repository with the GitHub CLI, and GitHub refused that check because your gh token isnât authorized for the organization yet. The wizard shows the warning with the steps to authorize:
- Re-authorize your GitHub CLI login with the
repoandworkflowscopes by runninggh auth refresh -h github.com -s repo,workflow, and authorize the organization when GitHub prompts for single sign-on - If you authenticate with a personal access token in
GH_TOKEN, open github.com/settings/tokens, select Configure SSO on the token, and authorize the organization - Run
/install-github-appagain
Admin permissions required warning for this condition instead.
Failed to resume the conversation
Claude Code couldnât read or process the saved transcript for the session you selected from theclaude --resume picker, so it ends the process rather than continue in a partially loaded state. The message includes the command to retry:
/resume picker inside a running session reports Failed to resume conversation in the conversation instead, and your current session keeps running. Before v2.1.216, a failed resume from the claude --resume picker stayed on the Resuming conversationâĶ spinner indefinitely instead of showing this message.
What to do:
- Run
claude --resume <session-id>with the session ID from the message to retry - On a version before v2.1.285, if the retry fails the same way, run
claude updateand resume again. Those versions fail the resume when the saved transcript contains an entry they canât read. - If the retry fails again, run
claudeto start a new session
No conversation found with the session ID
You passed a session ID toclaude --resume <session-id> and no saved transcript matched it:
- Mistyped ID: for a non-interactive run, the ID is the
session_idfield of the--output-format jsonoutput - Deleted transcript: Claude Code removes transcripts after the retention period, 30 days by default, following the retention sweep rules
- Different machine: Claude Code stores transcripts locally, so resume the session on the machine where it ran
- Duplicate copies: if you copied a project directory under
~/.claude/projectsso two transcripts carry the same ID, Claude Code reports this message rather than resume one copy arbitrarily
- For an interactive session, open the session picker with
claude --resumeand pressCtrl+Ato widen it to every project on this machine, then select the session - Sessions created with
claude -por the Agent SDK donât appear in the picker, so re-check the ID against thesession_idyour original run printed
Windows reported an error (EBADF) when Claude Code read this sessionâs transcript file
You resumed a session on Windows, its saved transcript file opened normally, and reading it then failed with the system error EBADF. The system error doesnât say why the read failed, so the message suggests likely causes and what to try:Failed to resume session <session-id>. A claude --resume or claude -p command exits with code 1 after showing it. After /resume inside a session, your current session keeps running.
What to do:
- Exclude the folder that holds your session transcripts from software that scans or intercepts file reads, such as security, encryption, or endpoint-management tools. Transcripts live under
%USERPROFILE%\.claude\projectsby default, or under the directoryCLAUDE_CONFIG_DIRnames - If you canât add an exclusion, add Claude Code to that softwareâs allowed applications instead
- Resume the session again
claude --resume <session-id> ended at Failed to resume session <session-id>, and a -p run printed only the system error text, such as Failed to resume session: EBADF: bad file descriptor, read.
Cannot switch renderers in this session
When you switch renderers, Claude Code restarts its process. You ran/tui in a session Claude Code declines to restart, so it doesnât switch and saves nothing. Which message you see tells you the cause:
Cannot switch renderers while work is running in the background: you have background work running that a restart would abandon, such as a background shell or a subagent. Wait for the work to finish or stop it with/tasks, then run/tui fullscreenor/tui defaultagainCannot switch renderers in this session: the session has restrictions Claude Code canât pass to the restarted process. Before v2.1.234, Claude Code restarted anyway and the relaunched session ran without them
launch flags: a custom system prompt, a tool allowlist, or restricted settings: you started the session with a flag Claude Code doesnât pass back to the restarted process. These flags include--system-prompt,--system-prompt-file,--append-system-prompt-file, a--toolsallowlist,--setting-sources, and--permission-prompt-toolpermission rules set for this session only: a permission update from a hook or SDK caller added deny or ask rules with thesessiondestination. Session-scoped allow rules donât trigger the refusal. A restart drops them, and Claude Code prompts again insteadask-before-running rules with no command-line form: a permission update from a hook or SDK caller added ask rules alongside the rules Claude Code passes back as--allowed-toolsand--disallowed-tools. No flag exists for ask rulespermission rules a command line cannot carry intactandadded directories a command line cannot carry intact: a permission update added a rule or directory path mid-session. The restarted processâs command line canât carry its text as the same value
- In a session started without those restrictions, run
/tui fullscreen, or/tui defaultto switch back. Claude Code saves thetuisetting there
Couldnât open Claude Desktop
You ran/desktop or its alias /app in a session, or claude --desktop in your shell, and the system command Claude Code uses to open Claude Desktop failed. After /desktop, the session stays in the terminal; claude --desktop prints the message without the Error: prefix and exits with status 1.
The text in parentheses names the command that failed, with its exit status and the first line of its error output when it produced them. On macOS that command is open, as in this example; on Windows it is rundll32:
- Open Claude Desktop yourself, then run
/desktoporclaude --desktopagain - To read the failed commandâs full error output, turn on debug logging with
/debugand run/desktopagain, or runclaude --desktop --debug-file <path>, then check the debug log
Open Claude Desktop and run /desktop again. Before v2.1.275, it was Failed to open Claude Desktop. Please try opening it manually. and didnât say what failed.
/terminal-setup left your Zed keymap unchanged
You ran/terminal-setup in Zed, and Claude Code couldnât complete the update to your Zed keymap.json, so it left the file as it was.
Each message names the path to your keymap and ends with the keybinding block to add yourself:
Couldn't read your Zed keymap, so it was left unchanged.: Claude Code couldnât read the file, for example because of file permissionsYour Zed keymap isn't a readable list of keybindings, so it was left unchanged.: the file read fine but doesnât parse as an array of keybinding blocks, even with//comments and trailing commas allowedCouldn't back up your Zed keymap; not modifying it.: Claude Code couldnât copy the file to a.bakbackup beside it, so it changed nothingCouldn't update your Zed keymap, so it was left unchanged.: the merged result didnât verify as a valid keymap carrying the binding, so Claude Code discarded it instead of writing. A keybinding block with a duplicated key can cause this
- Copy the block from the message into the top-level array in your
keymap.jsonat the path the message names - For
isn't a readable list of keybindings, fix the syntax error, or make the fileâs top-level value an array, then run/terminal-setupagain
/terminal-setup couldnât parse a Zed keymap that used // comments or trailing commas, and it replaced the entire file with only its own binding while reporting the binding as installed. To restore a keymap an earlier version replaced, use the .bak backup file described under Enter multiline prompts.
Skill usage reports are not available on this connection
You ran/skill-doctor over Remote Control, from your phone or browser. Claude Code doesnât send the skill usage report over Remote Control and replies with this message instead:
- Run
/skill-doctorin the terminal on the machine where the session is running, or runclaude -p "/skill-doctor"there
Custom output styles canât be selected over Remote Control
You ran/output-style from the mobile app or web via Remote Control, or the command arrived in a message relayed into the session. Because such a turn may not come from the account owner, Claude Code lists and selects only built-in styles on it, and adds this notice whenever the command lists the styles or doesnât recognize the name you gave. A custom style name gets the same reply as a name that doesnât exist:
- Pick a built-in style, for example
/output-style concise - To use a custom style, set
outputStylein the projectâs.claude/settings.local.json, or run/output-style <style>at the sessionâs own terminal if it has one
Output styles are saved to local settings which this session doesnât load
You tried to switch output styles with/output-style <style> or /config outputStyle=<style> in a session whose setting sources exclude local. Examples are an Agent SDK session whose settingSources leaves out "local" and a CLI session started with a --setting-sources value that leaves out local. Both commands save the style to .claude/settings.local.json, a file such a session never reads back, so Claude Code refuses instead of writing a setting that would have no effect:
- Add
localto the sessionâs setting sources and switch again - Set the
outputStylekey in a settings file the session does load, such as.claude/settings.jsonin the project or~/.claude/settings.json. In the TypeScript SDK, setoutputStyleinside the inlinesettingsobject instead; see Activate an output style
/recap only runs when you ask for it yourself
The/recap request didnât come from your own input. It arrived in a message relayed into the session from a Slack, Teams, or project thread, or in a prompt that a routine or another program sent.
A relayed message gets the notice even when you wrote it yourself. Claude Code canât tell that a relayed or automated message came from the person whose account runs the session, so it answers with this notice instead of a summary:
/recap you pass to claude -p, or that your own Agent SDK application sends to a session it launched, counts as your own input.
What to do:
- Open the session yourself and run
/recapthere: in its terminal, in the Desktop app or the mobile app, at claude.ai/code, or over Remote Control - If a routine or another program sent it, remove
/recapfrom that prompt
Plugin errors
These errors come from plugin and marketplace configuration. For plugin problems that donât produce one of the messages on this page, such as a marketplace URL that doesnât load or a plugin that installs but doesnât appear, see Plugin troubleshooting.plugin eval is currently in early access
You ranclaude plugin eval or claude plugin eval init and it exited 1 with one of these messages before doing anything:
- Run
claude --version, thenclaude update, and run the command again in a fresh session. See the requirements for plugin evals - If you see the second message on a current build, try again later after another
claude update
Marketplace is registered from an untrusted source
The marketplace is registered under a name that is reserved for official Anthropic marketplaces, but its registered source isnât ananthropics GitHub repository. Claude Code re-checks reserved names every time it loads or refreshes a marketplace, so the marketplace and the plugins installed from it stop loading. Before v2.1.205, an entry registered before its name became reserved kept loading.
can only be used with GitHub sources from the 'anthropics' organization instead. claude plugin marketplace add runs the same check, and refuses a reserved name with Failed to add marketplace: followed by the same reserved-name sentence.
What to do:
- If the marketplace is already registered, run
claude plugin marketplace remove <name>, then add it again from the officialgithub.com/anthropicsrepository - If you publish a third-party marketplace that used the name before it became reserved, rename it and ask users to re-add it from your source
- See the reserved name list under Marketplace schema
Marketplace name is another spelling of a reserved name
The marketplaceâs name isnât itself a reserved name, but Claude Code treats it as another spelling of one. Reserved names lists which spellings count as a reserved name. Claude Code refuses such a name when you add the marketplace:/plugin, claude plugin install, and claude plugin update warn:
This marketplace's name is another spelling of "<reserved>", a reserved marketplace name. It is not exactly the reserved name it appears to be.
What to do:
- Rename the marketplace to a name that doesnât spell a reserved name and add it again
- For the ignored-entry warning, run the
claude plugin marketplace removecommand it gives, or remove the entry from~/.claude/plugins/known_marketplaces.json
Claude Code refuses the marketplace name
A registered marketplaceâs name impersonates an official Anthropic marketplace under the rules that section lists. If a marketplace was registered under such a name before the check blocked it, the marketplace and the plugins installed from it stop loading, because Claude Code checks the name every time it reads the marketplaceâs catalog. When the name imitates an official one,claude plugin list and the /plugin Errors tab report each affected plugin with a message that begins:
Claude Code refuses this marketplace's name: it looks like one of Anthropic's own instead. claude plugin marketplace add refuses any impersonating name with Marketplace name impersonates an official Anthropic/Claude marketplace.
Before v2.1.282, claude plugin list and /plugin reported the plugins of an imitating name as failed to load too, without naming the marketplaceâs name as the cause.
What to do:
- Run
claude plugin marketplace remove <name>. This also uninstalls the plugins installed from the marketplace and deletes their saved data - To keep the marketplace instead, wait until its maintainer renames it, then run
claude plugin marketplace update <name> - If you publish the marketplace, rename it in your
marketplace.json; users then update the marketplace instead of removing it
Marketplace is already added from a different source
You confirmed adding a marketplace through/plugin install <plugin> --marketplace <source>, and the catalog Claude Code fetched from that source names itself the same as a marketplace you already added from a different source. Claude Code keeps the existing marketplace instead of replacing it, and the plugin isnât installed.
- If the marketplace you already added is the one you want, install from it by name:
/plugin install <plugin>@<name> - To switch to the new source, run
/plugin marketplace remove <name>, then retry the install
Plugin command references user_config in a shell command
A plugin hook, monitor, or MCPheadersHelper command references a ${user_config.KEY} plugin option, and the substituted string would be passed to a shell. A configured value containing $(...), backticks, or ; would run as code there, so Claude Code refuses to start the component instead of substituting the value. The check runs on the command template, so the error appears even when no value is configured yet. Before v2.1.207, the value was substituted into the shell command.
The wording depends on which surface referenced the option. A shell-form hook reports:
headersHelper reports:
- For a hook, add an
argsarray so it runs in exec form, where each${user_config.KEY}becomes one argument with no shell in between. Or drop the reference and read the$CLAUDE_PLUGIN_OPTION_<KEY>environment variable inside the script - For a monitor, drop the reference and have the monitor script read the value from a config file
- For a
headersHelper, move${user_config.KEY}into the serverâsheadersfield, which isnât shell-parsed, or read the value inside the helper script
Plugin archive integrity check failed
The pluginâs marketplace entry uses anarchive source with a sha256 pin, and the digest of the downloaded file doesnât match the pin. Claude Code refuses the install, so nothing changes in the plugin cache. The mismatch has three possible causes:
- The file at the URL changed after the author computed the pin
- The author entered the wrong digest in the marketplace entry
- The URL serves a different file than the author pinned
- If you publish the plugin, recompute the digest of the exact file the URL serves, for example with
shasum -a 256 my-plugin.zip, orGet-FileHash -Algorithm SHA256 my-plugin.zipin PowerShell, and update thesha256in the marketplace entry - If you install the plugin, run
/plugin marketplace update <name>to refresh the catalog in case the entry was corrected, then retry the install - If the digests still disagree after a refresh, ask the marketplace owner which file they pinned before installing
Path escapes plugin directory
A plugin component path, declared in the pluginâsplugin.json or in its marketplace entry, resolves outside the pluginâs own directory. Claude Code drops that path and loads the rest of the plugin. The component name in the message, such as commands or hooks, names the field that declared the path.
claude plugin command output, the same error reads Path escapes plugin directory: ./../shared.md (commands).
Claude Code rejects both a path that points outside the plugin as written, such as ../shared-utils, and a symlink that leads outside the plugin and isnât one the marketplace symlink rules allow. For a symlink, the message also says where the path resolves:
commands path declared in a marketplace entry even when it pointed outside the plugin directory.
Before v2.1.257, the check looked only at the pathâs spelling, not at where a symlink leads.
What to do:
- Move the referenced file inside the plugin directory and point the path at it with a
./relative path - If the path is a symlink to a file outside the plugin, replace the symlink with a copy of the file
- If the message says the path contains a backslash, write the path with forward slashes, for example
./commands/deploy.md - To share files with other plugins in the same marketplace, link them with a symlink inside the plugin directory, following the symlink rules
Path could not be checked
Claude Code asked the operating system whether a plugin path exists and got an error other than ânot foundâ, so it doesnât load what the path names. How much of the plugin loads depends on which path failed:- One of a pluginâs default component locations, such as the
skills/folder, themonitors/monitors.jsonfile, or aSKILL.mdat the plugin root: the pluginâs other components still load - The pluginâs own directory: nothing from that plugin loads
/plugin, the error appears under the plugin and names the path and the code the operating system returned:
claude plugin list, the same error reads Path not found: /home/user/my-plugin/skills (skills, ELOOP).
Causes that produce this error include:
ELOOP: a symlink in the path points at itself or forms a loopEIOorESTALE: the path is on a network mount that is broken or staleEACCES: one of the directories above the path denies you permission to traverse it
- Replace a symlink that points at itself with a real folder, or delete it
- If the path is on a network mount, remount the share
- If the code is
EACCES, restore your execute permission on the directories above the path - Run
/reload-pluginsafter fixing the path, or restart Claude Code, to load the plugin or component
Marketplace entry path does not stay inside the marketplace directory
The pluginâs marketplace entry declares a source path that Claude Code canât resolve to a location inside the marketplaceâs own directory, so the plugin doesnât install or load. The refusal covers:- An entry path that is absolute, climbs out of the marketplace with
.., or is spelled like a network path - On macOS and Linux, an entry path that contains a backslash anywhere after the leading
./ - An entry in a marketplace fetched from a remote source, such as git or a URL, that reaches its target through a symlink resolving outside the marketplace directory
- A relative entry in a marketplace added from a direct URL to its
marketplace.json: Claude Code downloads only that file, so no local plugin files exist for the path to name. See Plugins with relative paths fail in URL-based marketplaces
claude plugin install reports the refusal like this:
claude plugin list shows the plugin as failed to load with:
- If you maintain the marketplace, write the entryâs
sourceas a plain relative path with forward slashes, such as./plugins/my-plugin, and keep any symlink it crosses pointed inside the marketplace directory - If you added the marketplace from a direct URL, relative entries canât resolve. Ask the marketplace author to use another plugin source, or add the marketplace from its git repository instead
Failed to load marketplace configuration
Claude Code keeps the plugin marketplaces youâve added in a registry file at~/.claude/plugins/known_marketplaces.json. A plugin command that needs the registry, such as claude plugin install, fails with one of two messages when Claude Code canât use the file:
Failed to load marketplace configuration: the file exists but isnât valid JSON or canât be read. An empty file fails this way too.Marketplace configuration file is corrupted: the file is valid JSON but its contents donât match the registry schema.
claude plugin install reports:
claude plugin install didnât report this failure.
What to do:
- Open
~/.claude/plugins/known_marketplaces.jsonand repair the JSON, or fix the entries the message names as not matching the registry schema - If you canât repair it, delete the file or replace its contents with
{}, then re-add each marketplace withclaude plugin marketplace add <source>. Claude Code re-registers the marketplaces your user or managed settings declare inextraKnownMarketplacesthe next time you start it in a folder youâve trusted.
Plugin is required by your organization
You ranclaude plugin disable, or used the /plugin Installed tab, to turn off a plugin synced from claude.ai that your organization marks as required:
- Ask an admin of your claude.ai organization to change the pluginâs required status on claude.ai
Plugin was not uninstalled
You ranclaude plugin uninstall, or chose Uninstall in the /plugin Installed tab, and the uninstall stopped with a message starting "<plugin>" was not uninstalled:. If the text after that colon starts with installed_plugins.json instead of naming a settings file, the cause is content in installed_plugins.json that this version of Claude Code canât read. For that form, see installed_plugins.json holds a record this version canât read.
When Claude Code removed the pluginâs entry from enabledPlugins and read that scopeâs settings files back, either the plugin was still switched on there, or a file that could switch it on couldnât be read or checked. Deleting the pluginâs saved options, secrets, and data while a settings entry could switch it back on would lose them, so the uninstall stops instead: the plugin stays installed and nothing it saved is deleted.
it is still switched on in <file>, although the settings change reported no error: the settings write reported success but the entry is still there when the file is read backit is still switched on in <file>, and the settings change failed (<error>): the file couldnât be saved, for the reason in parentheses<file> is there and could not be read: the file exists but couldnât be read as settings, for example because it isnât valid JSON, so it may still enable the plugin<file> (not read: it is on a network path or is a link to one, or could not be checked): Claude Code didnât read the project or local settings file because the file, or the.claudefolder that holds it, is a link that leads to a network location, or because it couldnât examine that path
claude plugin uninstall exits 1, and with --json the result carries failureCode: "settings_still_on". /plugin shows the same message.
What to do:
- Follow the last sentence of the message: repair or replace the settings file it names, or remove the pluginâs entry from
enabledPluginsin that file yourself, then run the uninstall again
Tool errors
These errors come from Claudeâs tool calls. Claude corrects most tool errors on its own. When one needs a change from you, that errorâs What to do list says what to change.No such tool available
Claude called a tool by a name that isnât in the sessionâs tool list. Claude Code returns the error to Claude as the tool callâs result, and the turn continues. When Claude Code can tell why the tool is missing, it adds a sentence after the tool name that gives the reason or names the tool to call instead, as in the second line:- If it happens once, you donât need to do anything. Claude reads the error and the turn continues.
- If calls to an MCP serverâs tools keep failing with this error, run
/mcpin the session orclaude mcp listin your shell to check the serverâs status, and reconnect a failed server from/mcp. In the Agent SDK, see Error handling.
Agent would be spawned with zero tools
Every entry in the subagentâstools list failed to match a usable tool, so Claude Code refused to launch the subagent: with no tools, it couldnât act. The message groups your entries by what went wrong:
- Unrecognized: the entry matches no tool name, usually a typo such as
GrpeforGrep. - Not available to subagents: the entry names a real tool that subagents canât use. Background subagents keep a smaller built-in tool set, so an entry that only a foreground subagent can use lands here when the subagent would run in the background, which is the default. If you list
Agent, the message reports it under the next group instead. - Matched no tools in this session: the entry is valid but no tool in the current session matches it right now, such as
mcp__github__*with no GitHub MCP server connected, orAgentfor a subagent at the depth limit.
tools field never triggers this refusal. If you leave the tools list empty, or disallowedTools removes every entry in it, Claude Code also skips the refusal and launches the subagent without tools.
Before v2.1.208, the subagent launched with no tools and could return an empty or confusing result.
- Correct each entry the error names against the tools available to subagents
- Remove entries for tools the session doesnât have, such as MCP tools from a server that isnât connected
- For a tool that background subagents drop, such as
CronCreate, remove the entry. To keep the tool, turn fork mode off and ask Claude to run the subagent in the foreground - Delete the
toolsfield instead of listing tools to give the subagent every tool available to subagents - For a
toolslist that contains onlyAgent, raise the depth limit or give the agent at least one other tool: Claude Code withholdsAgentat that limit, so a list with nothing else in it resolves to no tools
File is covered by a Read deny rule
The Edit or Write tool was called on a path matched by aRead deny rule, including creating a new file at that path. Both tools change content Claude has to be able to read back, so Claude Code refuses the call before any file access. NotebookEdit isnât covered by Read deny rules. Before v2.1.228, the rule blocked the Edit tool only, and before v2.1.208, only an Edit deny rule blocked edits.
and cannot be written instead.
What to do:
- If Claude should be able to change the file, remove or narrow the
Readdeny rule in/permissionsor in settings - If the file must stay untouched, keep the rule and add an
Editdeny rule for the same path to block the NotebookEdit tool too
Path cannot contain null bytes
A file tool callâs path or pattern argument contained a null byte, which file systems and search tools canât accept. Read, Write, Edit, NotebookEdit, Glob, and Grep check for this, and the message names the tool and the argument:- Nothing on your side: the error is returned to Claude as the toolâs result, and the message itself tells Claude to remove the null byte and try again
Path contains null bytes, and the tool never ran.
subagent_type is required
subagent_type, and this session has no general-purpose subagent to fall back on. That is the case in two setups:
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1is set in non-interactive mode, which removes every built-in subagent- The sessionâs main-thread agent has a
tools: Agent(...)allowlist that leaves outgeneral-purpose
- Usually nothing: the message lists the subagents the session does have, so Claude can retry with one of them
- If Claude keeps failing, add
general-purposeto thetools: Agent(...)allowlist, or unsetCLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS
Agent type 'general-purpose' not found.
Memory index is over its read limit
Claude wrote to the auto memory indexMEMORY.md and left it over one of its read limits: 200 lines or 25KB. The write succeeded, but only the first 200 lines or 25KB, whichever comes first, load at the start of a session, so everything past the limit is dropped each time the index is read. Before v2.1.210, an over-limit index was silently truncated on the next load with no write-time signal.
- Let Claude rewrite
MEMORY.md, or ask it to: keep one line per entry, move detail into topic files, and merge or drop stale entries - To trim the index yourself, see Audit and edit your memory
pkill pattern matches the Claude Code process
Apkill command in a Bash tool call used a pattern, typically with -f, that matches the Claude Code process itself, so Claude Code refuses the command instead of letting it end the session. Claude Code tests the pattern with pgrep before running pkill and refuses when its own process ID is in the result. The check runs on Linux only; on macOS, pkill runs unmodified. Before v2.1.214, the command ran, and a matching pattern killed the Claude Code session mid-turn.
- Narrow the pattern so it matches only the intended process, for example the full path of the target binary rather than a short substring
- To stop processes started by the current shell, use
pkill -P $$with the pattern, which limits the match to the shellâs own child processes
Failed to write to a teammateâs inbox
Claude Code couldnât write a message to a teammateâs mailbox file under~/.claude/teams/{team-name}/inboxes/, so the recipient received nothing. The write fails when Claude Code canât create or update the file, for example because the disk is full, the directory isnât writable, or another agent holds the inbox lock for too long. Before v2.1.224, Claude Code reported the message as sent even when the write failed.
The error appears in the sending agentâs tool result rather than as a banner in your terminal, and its text tells Claude to try again:
Failed to write the <message> to <name>'s inbox â nothing was sent. The plan approval in that list is the leadâs decision approving a teammateâs plan; the teammateâs plan submission is the separate plan approval request message. That message and two other protocol messages carry their own message text and consequence:
Failed to write the plan approval request to the lead's inbox â plan not submitted; try again: the teammateâs plan never reached the lead, and the teammate stays in plan mode until a resubmission succeedsThe permission request could not be delivered to the team lead (mailbox write failed): the teammateâs permission request never reached the lead, so nobody approved the tool callThe confirmation could not be written to team-lead's inbox.: the shutdown approval itself took effect and the teammate exits; only the confirmation to the lead is missing
@name followed by the message in the lead session, the same failure appears as a notification, Couldn't write to @name's inbox â message not sent. Try again., and Claude Code keeps your text in the prompt box so you can send it again.
What to do:
- Ask the sender to resend the message; contention for the inbox lock is transient and clears on retry
- Check free disk space, and check that
~/.claude/teamsand the files under it are writable by your user
Teammateâs agent definition was not restored
Claude messaged a stopped agent team teammate, and Claude Code brought it back without re-applying the subagent definition it was spawned from. The notice follows the resume report in the sending agentâs tool result and names the reason. When the definition file came from a folder with no saved trust, it reads:.claude/agents/ directory of the project or of an --add-dir directory, and accepting the trust dialog for a parent folder doesnât satisfy it.
What to do:
- Run
claudein the folder the debug log names and accept the trust dialog. The definition is re-applied the next time Claude Code brings the teammate back; you donât need to restart the lead session - Or set the
hasTrustDialogAcceptedentry totruein~/.claude.json, using the exactprojects["<path>"]key the debug log prints
Message too large for cross-session delivery
Claudeâs cross-session message to another of your sessions on this machine was too long to send. Claude Code refused it, and the receiving session got nothing. The refusal appears in the sending sessionâs tool result, not as a banner in your terminal. It names both sizes and how to make the message fit:- Ask Claude to summarize the message, or to put the bulk content in a file and send the fileâs path
- Ask Claude to split the content across several shorter messages
Too many messages to this session just now
Claude sent a rapid burst of cross-session messages to one of your sessions on this machine, and the burst reached what that sessionâs inbox accepts. Claude Code refused the next send, and the receiving session got nothing from it. The refusal appears in the sending sessionâs tool result, not as a banner in your terminal:- Usually nothing: Claude batches the remaining content into one message, or waits before sending more
- If you prompted the burst yourself, ask Claude to combine whatâs left into a single message
Cross-session message was dropped at the recipient sessionâs inbox
Claude sent a cross-session message to another of your sessions on this machine, and that sessionâs inbox discarded it before Claude in that session read it. The line names the recipient and, when the recipient gave a reason, adds the reason after a dash:Cross-session messages (12) were dropped. To find which session an address belongs to, compare it with the Peer address row that /status shows in each session.
After the dash, the line gives one or more of these reasons:
its queue of undelivered peer messages was full: the recipient already held as many undelivered messages from other sessions as its queue allowsyou sent faster than that session accepts: the sending sessionâs messages arrived faster than the recipient accepts from one senderit repeated your previous message: the message was identical to one the sending session sent this recipient shortly beforea relay loop between sessions was cut: the message continued a chain of sessions messaging each other, and the chain had passed through the recipient too many times or grown too long
- Assume the recipient never saw the dropped messages. Claude Code tells Claude the same, and tells it to include anything that still matters in one later message instead of resending right away
- If your sessions send each other frequent updates, ask Claude to send fewer, larger messages, such as one report when a session finishes its work
- For
a relay loop between sessions was cut, type the next instruction into one of the sessions yourself. A message Claude sends in response to your own prompt begins a new chain
Refusing to send a cross-session message
Before Claude Code writes a cross-session message to another of your sessions on this machine, it checks that the target sessionâs inbox socket is the endpoint the message was addressed to. When a check fails, Claude Code refuses the send in the sending session, and the target session receives nothing. For a message Claude sends, the refusal appears in the sending sessionâs tool result:Refusing to send: names the check that failed:
reply target is a symlink: a symbolic link sits at the target sessionâs socket path. Claude Code doesnât deliver through it, because a link there could redirect the message to an endpoint the target session didnât create.cannot vet reply target: Claude Code couldnât inspect the target path at all, for example because reading it failed with a permission error.
- Usually nothing: the checks keep a message from reaching an endpoint other than the session it was addressed to, and nothing was sent
- If
reply target is a symlinkrepeats for one session, check what created a link at that sessionâs socket path, shown in its/statusunderPeer address
Refusing to read, write, or search a path
Claude Code checks a file pathâs permission rules, then confirms that resolution again when the tool opens the file or starts the search. When it canât confirm that the path still leads to the location the check approved, Claude Code refuses the operation instead of following it. The refusal appears in the tool result:its symlink resolution changed after permission was checked: a symlink along the path, or at a Grep or Glob search root, was replaced between the permission check and the operation. In a read refusal, the parenthesized phrase names which comparison failed.its parent-directory symlink resolution changed after permission was checked: a directory the write path passes through no longer resolves to the approved locationwhere it leads on disk could not be determined (a link on the way could not be examined, or the links do not resolve): Claude Code couldnât follow the path to a final location on disk, for example because symlinks on it form a loopit is a symbolic link. Write to the link's target path instead: a symbolic link sits at the requested write location itself, for example aCLAUDE.mdthat is a symlink toAGENTS.md; the message directs Claude to the linkâs targetRefusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.: the same condition caught when another writer opens the file, such as a write to a symlinked.mcp.jsonRefusing to write into symlinked directory: <path>: the directory that holds the file is itself a symbolic link, for example a projectâs.claude/directory linked to another locationa path one of its Read deny rules is written through changed while the search was being prepared. Retry.: aReaddeny rule for the search names a path that passes through a symlink, and that link changed while Claude Code was preparing the searchit could not be opened (EACCES) â it is unreadable, or is being replaced concurrently.: the search root exists but couldnât be opened; the parenthesized code is the operating system errorits permission check expired before it ran (too many concurrent file operations). Retry.: Claude Code evicted the approval record under many simultaneous file operations before the tool used it; retrying runs a fresh permission checkripgrep was found only by name on PATH, and a search outside the working directory cannot apply your Read deny rules in that configuration: Claude Code couldnât resolve thergbinary to an absolute path, so it refuses searches outside the working directory rather than run one your deny rules donât cover
- Usually nothing: the refusal reaches Claude as the tool result, and the refused operation doesnât run
- If a symlink refusal repeats on one path, find what keeps rewriting a link there, such as a build tool or file watcher, or ask Claude to use the fileâs resolved path instead of the linked one
- If this refusal appears for every file while Claude Code runs on Windows inside an AppContainer or restricted-token sandbox, upgrade to v2.1.265 or later
- If a read refusal appears on macOS for a file that nothing is rewriting, such as a screenshot dragged into the prompt, upgrade to v2.1.273 or later
- For the ripgrep refusal, install ripgrep with your package manager so
rgresolves to an absolute path onPATH, or keep searches under the working directory
where it leads on disk could not be determined refusal didnât appear.
Task output swap refused
Claude Code saves each Bash commandâs output to a file under its temp directory. Every time it opens one of these files, it checks that the path still leads to the file it created, with no symbolic link, extra hard link, or moved directory redirecting it. This message means that check failed, so Claude Code refused the operation rather than write or read output through that path. The message appears in the Bash tool result:output symlink was re-pointed, output file identity changed, and not a regular file all report the same condition: something at or along the output path is no longer the file Claude Code created. Only some reasons carry a To recover: sentence.
If the check fails while a command is still running, Claude Code stops the command, and its result reports:
- Upgrade to v2.1.260 or later. Earlier versions sometimes showed this message when no link or moved directory was present
- Restart Claude Code with
CLAUDE_CODE_TMPDIRset to a fresh directory - Or check your projectâs directory under the Claude Code temp directory,
/private/tmp/claude-501/-Users-you-my-projectin the example message. If that path is a symbolic link, or a directory that shouldnât be there, remove the link or directory itself rather than the linkâs target, and restart Claude Code - If the refusal repeats, a process is replacing, linking, or removing entries under Claude Codeâs temp directory while the session runs. Set
CLAUDE_CODE_TMPDIRto a directory nothing else manages and restart
Disk quota or temp filesystem is full
Claude Code saves each Bash and PowerShell commandâs output to a file under its temp directory. When a command exits with a nonzero code and no output at all, Claude Code checks whether the filesystem holding that file is out of space or inodes, or whether your disk quota on it is used up. If so, a diagnostic appears in the commandâs result in place of the empty output:Your disk quota is full ... (EDQUOT): your own quota on that filesystem is used up. A quota can be full while the filesystem still shows free spaceThe filesystem with Claude Code's temp directory ..., or your disk quota on it, is full (ENOSPC): the filesystem, or your quota on it, has no space leftCommand output was lost: the temp filesystem at ... is fullor... is out of inodes: the filesystem has almost no free space left, or is running out of inodes
- Delete files you no longer need on the filesystem that holds Claude Codeâs temp directory. For
EDQUOT, delete files that count against your own quota. Forout of inodes, delete many files rather than a few large ones, since each file takes one inode whatever its size - Or restart Claude Code with
CLAUDE_CODE_TMPDIRset to a directory on a filesystem with room - Then have Claude run the command again. The output it printed was lost, not truncated
The source file is not valid UTF-8 text
Claude tried to publish an artifact from a file whose bytes donât decode as text, or whose text already contains the replacement characterU+FFFD, so Claude Code refused the publish before uploading anything. The message appears in the Artifact tool result and names the first position to fix:
UTF-16 and still tells you to rewrite the file as UTF-8. When more positions follow the named one, the message adds a count such as (+2 more) after the position.
What to do:
- Usually nothing: Claude rewrites the file and publishes again
- If the file is one you wrote or exported, save it again as UTF-8, and replace each
U+FFFDwith the character an earlier edit, paste, or conversion lost - To show an intentional
U+FFFDon the page, write it as�in the HTML instead of the literal character
Not published: that file is on a network share
Claude tried to publish an artifact from a file at a path that names a network host:- On Windows, a
\\server\sharepath that isnât under a mapped network drive you passed at launch with--add-dir - On macOS or Linux, an automount path such as
/net/<host>/page.html
- Nothing, if you donât need that exact file: the message tells Claude to publish a file from the sessionâs own folders instead
- To publish that exact file, copy it into a folder on a local disk and ask again
- On Windows, to let Claude publish directly from the share, map it to a drive letter and pass the drive when you start Claude Code. In PowerShell, for example, run
net use Z: \\server\shareand thenclaude --add-dir Z:\. Claude can then publish files from that drive. Adding the drive mid-session with/add-dirisnât enough. - On macOS or Linux, mount the share at a directory such as one under
/mntor/Volumes, and publish from that path instead of the automount path
Reading a local file from outside the connected folders in a Cowork session
In a Cowork session running on your machine in the Claude Desktop app, Claude named a local file for an artifact. Claude Code couldnât confirm the file is a plain file inside the sessionâs connected folders: the path sits outside those folders, passes through a symbolic link, or is spelled in a way that can name a different file than it appears to. Reading such a file needs your approval, and in a session that canât show you the approval card, such as one set to skip all approvals, Claude Code refuses the read. The refusal appears in the Artifact tool result; when the file couldnât be examined at all, it names that failure instead:- Usually nothing: the message tells Claude to use a plain file inside the connected folders instead
- To put that exact file in the artifact, copy it into one of the sessionâs connected folders as a regular file, not a symlink, and ask again
WebFetch cannot fetch localhost
Claude called WebFetch with a URL whose hostname has no dot, such ashttp://localhost:3000 or a bare intranet name like http://wiki/. WebFetch refuses these URLs before making any request:
- Usually nothing: the message points Claude at
curlthrough the Bash tool, which can reach local and intranet servers
Invalid URL error.
WebFetch domain safety check failed
Before fetching a URL, WebFetch sends the URLâs hostname toapi.anthropic.com to check it against Anthropicâs domain safety blocklist. If the check canât complete, WebFetch canât confirm that the domain is safe, so it doesnât fetch the page and the tool result carries one of these messages instead:
rate-limited: the check endpoint answered with HTTP429. The message tells Claude to continue without the page and to try again at most once later. Claude Code doesnât cache a failed check, so a later fetch of that domain runs the check again. If sessions on your network hit this often, you can skip the check withskipWebFetchPreflight: truein settings.Unable to verify: the check request failed, timed out, or got another error status. If your network blocksapi.anthropic.com, allowlist that domain, or skip the check withskipWebFetchPreflight: truein settings.
The safety check for domain example.com is temporarily rate-limited (too many domain checks from this network). Retry after about a minute; retrying sooner will fail the same way..
Before v2.1.285, a rate-limited check was reported with the Unable to verify message instead.
Background session errors
Background sessions run without an interactive terminal of their own, so commands that need one behave differently there. These messages appear in the transcript of a background session, in the terminal that attaches to one, in the session or shell you dispatch from, or, for the worktree-guard entries below, in any session isolated in a worktree or running a worktree-isolated subagent; where a message is specific to one surface, its entry says so.Commands refused in a background session
Commands that open an interactive dialog canât do so while no terminal is attached to a background session./install-github-app, the /mcp settings list, and the authentication actions in the MCP server menu respond with a message. For /install-github-app and the /mcp settings list, the session also appears under Needs input in agent view so you can find it, attach, and run the command again. While a terminal is attached, these commands work normally.
Before v2.1.216, the session didnât appear under Needs input after /install-github-app or the /mcp settings list was refused. In v2.1.213 through v2.1.215, the commands still worked while a terminal was attached, and the refusal message told you to attach and run the command again. From v2.1.208 through v2.1.212, Claude Code refused them even while a terminal was attached, with a message such as Can't open MCP settings in a background session; on those versions, run the command from a regular claude session instead, or upgrade. Before v2.1.208, they opened their dialog inside the background session. In v2.1.208 only, Claude Code also refused the /model picker in a background session, and /upgrade printed the upgrade URL instead of opening a browser.
The wording names the command. The /mcp settings list reports:
- Attach to the session from agent view and run the command again
- Or use the form the message names, such as
/mcp reconnect <server>,/mcp enable, or/mcp disable, which work without attaching
Write or command blocked because the path cannot be safely resolved
Claude addressed a file or working directory through a spelling that the worktree-isolation guard canât resolve to one verifiable location. The guard checks writes and command working directories in any session isolated in a worktree, interactive or background, and in worktree-isolated subagents. It resolves symlinks before checking that the operation doesnât reach the shared checkout, and when resolution fails, it blocks the operation rather than letting it land there. The message names the path forms it refuses and how to retry:re-run the command from its direct symlink-free path. Before v2.1.217, the guard compared path spellings without resolving symlinks, so these spellings werenât blocked and a write routed through a symlink could land in the shared checkout.
What to do:
- Usually nothing: the full message goes to Claude as a tool error, and Claude retries with the direct path it names. For a blocked file edit, the conversation view shows only a short
Error editing fileline; the full message appears in the transcript view, which you open withCtrl+O. A blocked command prints it in its command output. - If the block repeats on the same file, the path likely runs through a committed symlink whose target contains
.., such asdocs/current -> ../README.md; ask Claude to edit the target file by its real path instead of through the link
Write or command blocked because the path names a network location
Claude addressed a file or working directory through a path that names a drive that isnât on your machine, a UNC share such as\\server\share\file or a /net automount path, while the sessionâs checkout is on a local disk. The same worktree-isolation guard canât verify that such a path stays out of the shared checkout, so it blocks the operation. Isolating the session in a worktree doesnât lift the block. The message names the form of path to use instead:
re-run the command from its local, plainly-spelled path. Before v2.1.217, the guard compared path text only, so addressing a file inside the checkout through a UNC or /net path wasnât blocked.
What to do:
- Usually nothing: Claude retries with the local spelling the message asks for
Command blocked by the worktree isolation checks
Claude ran a Bash or Monitor command in a session isolated in a worktree, and Claude Code refused it for one of two reasons:- The command points git at the main checkout.
- Claude Code canât verify from the command text that any git the command runs stays inside the worktree. A command that never names git can still be refused for this reason, because expanding a variable indirection such as
${!name}or running a Bash function substitution such as${ command; }produces a value at runtime that can itself be a command.
- Usually nothing: Claude reads the message and rewrites the command the way its final sentence asks
- If a command you asked for keeps being refused, spell the flagged value literally: replace the indirection or substitution with its value, and run git as its own plain command from inside the worktree
- To act on the main checkout on purpose, run the command yourself in a terminal outside the session
This session has no saved transcript
You attached to a stopped background session that was backgrounded from another conversation withâ or /background and stopped before its first response finished. Until that first response finishes, the conversation still lives only in the session it was backgrounded from, so claude attach refuses to start the stopped session rather than begin a blank conversation under the same session ID. The message ends with the claude respawn command for this session:
Press enter again to restart this session fresh below the list instead, and a second Enter on the row restarts the session with an empty conversation. Before v2.1.212, opening the row showed the refusal message with no way to restart from agent view. Before v2.1.211, opening the stopped session silently started that blank conversation and could re-run the sessionâs original prompt.
What to do:
- The conversation you backgrounded from is intact: resume it with
claude --resumeor keep working in it - To start the stopped session fresh anyway, run
claude respawn <id>with the ID from the message, or pressEntertwice on its row in agent view - If the session did finish a response and you still see this refusal on a version before v2.1.214, an unreadable folder in
~/.claude/projectscould make the transcript scan miss the saved conversation; update to v2.1.214 or later, which tolerates unreadable folders during the scan
This session is running in another terminal
You opened a stopped sessionâs row in agent view, and its saved conversation is already open in another live Claude Code process on this machine, so Claude Code refuses to start a second process that would write to the same transcript. Which message you see depends on what holds the conversation:running in another terminal: a terminal holds the conversation, for example one where you resumed it withclaude --resumeor/resume. The row also showsOpen in a terminal.already open in another running Claude session: another non-interactive Claude Code process holds it, for example a background session process for the same conversation that hasnât exited yet.
- Continue the conversation in the process that has it open, or exit that process and open the row again
already open in another running Claude session refusal existed: a conversation resumed in a terminal didnât count as open, and opening the row started a second Claude Code process writing to the same conversation.
This sessionâs saved conversation is no longer on disk
You opened a background session that ended while the background service was off, and transcript cleanup has since removed its saved conversation, for example after the machine was off for weeks. Opening such a row normally resumes its saved conversation. With nothing left to resume, Claude Code refuses rather than re-run the sessionâs original prompt without asking:claude attach <id> prints this text. In agent view, the footer is shorter and ends with ctrl+x deletes the row.
What to do:
- Run
claude rm <id>to delete the row. When one of the kept cases applies,claude rmkeeps the row and the worktree instead and names the reason - To run the sessionâs original prompt again as a fresh conversation, run
claude respawn <id>
Worktree has commits that are not pushed anywhere
You tried to delete a background session whose worktree holds commits Claude Code canât confirm are saved elsewhere. Claude Code keeps the worktree and the session row rather than destroy the commits unseen.claude rm names the branch and the unpushed commits, and says how to proceed:
The worktree has unpushed commits instead. In agent view, the sessionâs row shows not deleted with the same reason.
Commits on a remote donât block the delete. Neither do commits on the local copy of your origin remoteâs default branch, as long as that branch is checked out in your main checkout, the repository directory itself rather than a worktree.
What to do:
- To keep the commits, push the worktreeâs branch, or merge it into the default branch checked out in your main checkout, then delete the session again
- To discard the commits, run the
claude rm <id> --discard-unpushedcommand the message printed, or pressCtrl+Xtwice on the sessionâs row in agent view again. This removes the session and the worktree along with its branch, the unpushed commits, and any uncommitted changes. If the worktree has gained a commit since the refusal, Claude Code keeps it again and shows the updated state - When the message says the worktree is also recorded by another finished session, deleting again doesnât discard it: push the commits, then delete the session again
claude rm put the commit summary on the kept line itself. When claude rm couldnât summarize the commits, the kept line read worktree has commits that are not pushed anywhere in place of the summary.
Before v2.1.260, the message didnât name the branch or the commits, and deleting again was refused the same way: deleting the session without pushing meant removing the worktree yourself with git worktree remove --force <path>, then running claude rm <id> again.
Before v2.1.248, the default branch checked out in your main checkout didnât count: a branch you had already merged there still triggered this refusal until its commits reached a remote.
Terminal host process died
Each background sessionâs terminal runs in a host process under the background service, and that process died while the service still held its connection, so the session couldnât be reached. On Linux and WSL, the background service checks each host process every few seconds, marks the session failed when the process has exited but its connection to the service never closed, and shows the reason on its row in agent view:claude attach <id> restarts a session already marked failed for a dead host, and otherwise prints the cause and exits:
terminal host process died â its output is gone; the command was not run again, and claude attach prints This command's terminal host process died â its output is gone and the command was not run again. Claude Code never reruns the command for you.
What to do:
- In agent view, press
Enteron the failed row; the session restarts on a fresh host process and the conversation resumes - From the shell, run
claude attach <id>again. Claude Code printsSession <id>'s terminal host died â restarting it on a fresh oneâĶand reopens the session - You canât restart a shell-command row this way; dispatch the command again to rerun it
openingâĶ Â· esc to cancel indefinitely and claude attach <id> waited without reporting an error.
Session isnât responding
You opened a background session and the background service accepted the open, but no output arrived for about ten seconds, so Claude Code concludes that the process relaying the sessionâs terminal canât deliver output, and ends the attempt instead of waiting. In agent view, Claude Code offers a restart in the footer:claude attach <id> prints the cause and exits:
- In agent view, press
Enteron the same row again. Claude Code stops the unresponsive process and restarts the session, and the conversation resumes. Nothing is stopped without that second press - From the shell, run
claude stop <id>, thenclaude attach <id> - For a shell-command row, press
Ctrl+Xin agent view or runclaude stop <id>to stop it; dispatch the command again to rerun it
Session was stopped while the respawn was in flight
You opened a background session whose process wasnât running, and while Claude Code was restarting it, another Claude Code process stopped it, for exampleclaude stop in another terminal. Claude Code keeps the session stopped:
- If you didnât stop the session, open its row again in agent view or run
claude respawn <id>to restart it - If you stopped it yourself, nothing remains to do: the session stays stopped
Session agent no longer available
You resumed a session that was running a custom agent, started with--agent or the agent setting, and Claude Code didnât find an agent by that name. It searches the sessionâs original directory first, when you have trusted that workspace, then the directory you resume from. The session still resumes, but with the default tools, so the agentâs tool restrictions no longer apply:
/resume or claude --resume, or resume in non-interactive mode, where it also goes to stderr. Sessions using --input-format stream-json donât show it, because the Agent SDK supplies agents after startup.
Claude Code doesnât save the fallback to the session, so the warning repeats on each resume until you act. The built-in claude agent doesnât trigger the warning, since falling back to the default toolset changes nothing for it. Before v2.1.216, Claude Code silently continued as the default agent, and the lookup covered only the directory you resumed from, so a project-scoped agent was lost on any resume from another directory.
What to do:
- Re-create the agent file at
.claude/agents/<name>.mdin the sessionâs project, or at~/.claude/agents/<name>.mdfor a personal agent, then resume again - Or resume with
--agent <name>naming an agent that does exist, to run the session as that agent instead - If the agent is project-scoped and you havenât trusted the sessionâs original directory, run Claude Code there once, accept the trust dialog, then resume again
CLAUDE_CODE_PROCESS_WRAPPER launcher errors
CLAUDE_CODE_PROCESS_WRAPPER is set, and its value canât be used, so Claude Code refuses to start the affected process rather than run it without the launcher. Configuration problems are reported with a message that starts with the variable name and states the reason, for example:
must exec, not daemonize, followed by anything the launcher printed. A session that canât start or reach the background service because of the launcher reports the launcher problem as the reason inside Couldn't reach the background service (...).
What to do:
- Set the variable to the absolute path of an executable that ends by calling
exec "$@". See the launcher contract for the full contract - Check
/status, which shows the resolved launch command in its Self-exec entry and warns when the running background service doesnât match it, or runclaude daemon statusfrom a shell - After fixing the value in the
envblock of settings, restart the background service withclaude daemon stop --anyso the next dispatch starts a wrapped one
EUNKNOWN when starting a background session
Windows refused to start a program with an error code that has no standard name, so the failure surfaces asEUNKNOWN. The usual trigger is a software restriction policy, such as Group Policy or AppLocker, blocking the program being started. The error appears when you start a background session with /background or claude --bg:
daemon in place of background service.
On an npm installation, an EUNKNOWN that appears while npm install -g @anthropic-ai/claude-code is replacing the binary has the same cause as EACCES during a reinstall and clears when you retry after the install finishes.
Claude Code starts the background service through PowerShell so the service survives closing the terminal, using PowerShell 7 when itâs installed and Windows PowerShell 5.1 otherwise. When neither PowerShell can run, Claude Code starts the service directly instead, so a policy that blocks only PowerShell doesnât cause this error.
Before v2.1.212, Claude Code used only Windows PowerShell 5.1 to start the service, so any machine where Group Policy blocked PowerShell 5.1 failed with Couldn't start the session â EUNKNOWN: unknown error, uv_spawn, even with PowerShell 7 installed.
What to do:
- If the message reads
Couldn't start the session, upgrade to v2.1.212 or later. On earlier versions you can also runclaude daemon runin a separate terminal first, then start the background session again. That command runs the background service in the terminalâs foreground, so the service lasts only as long as that terminal stays open. - If an npm install was replacing the binary, wait for it to finish, then start the background session again
- If the error appears on v2.1.212 or later while no npm install is running, check with your Windows administrator whether a restriction policy blocks the Claude Code executable
- If the background service stops when you close the terminal, Claude Code started it without PowerShell. Install PowerShell 7, or ask your administrator to unblock PowerShell, so the service can outlive the terminal.
EACCES when starting a background session
Claude Code couldnât run its own binary to start the background service that hosts background sessions. On an npm installation, this usually meansnpm install -g @anthropic-ai/claude-code was replacing the binary at that moment, whether you ran it or the auto-updater did. The error appears when you open a session from agent view:
/background or claude --bg, the same reason appears inside Couldn't reach the background service (...). During the same reinstall window the error can name another code instead, such as ENOENT or ENOEXEC, or EUNKNOWN or EPERM on Windows; an EUNKNOWN that persists across retries has a different cause.
On an npm installation, Claude Code waits for the reinstall to finish and retries on its own: up to ten seconds, and up to two minutes while an npm install of Claude Code is visibly still running on the machine, which covers another Claude Code process downloading an update. When the install outlasts that wait, the failure names the update instead of the bare error code:
- Wait a few seconds, then open the session or dispatch again. When the message says Claude Code is being updated, retry after the update finishes.
- If the error persists while no npm install is running, your user canât run the installed binary. Check its permissions and its directoryâs, or reinstall Claude Code.
Background service exited before it became reachable
The process Claude Code started as the background service exited before it accepted connections, so Claude Code couldnât open your session. When the service printed an error before exiting, the reason in parentheses gives the exit code or signal and the first line the service printed, which names what stopped it:Couldn't start the background service â. When the service printed nothing before exiting, the message says nothing on stderr instead.
Claude Code reports the failure with the serviceâs error line. Before v2.1.246, the failure surfaced only after a 45-second wait, as background service did not become reachable within 45s, without the serviceâs error line.
Two quoted reasons have known causes:
Error: claude native binary not installed.: an npm install was replacing the Claude Code binary at that moment, so the service ran npmâs placeholder instead. Retry after the install finishes; if the line persists with no install running, complete the npm install. Before v2.1.257, a macOS npm self-update produced this failure on every start during the install window.nothing on stderrwith exit code 1, on every start, on Windows:daemon.locknames a process that Claude Code can neither signal nor prove is gone, so each new service concludes another one holds the lock and exits. A lock whose writer Claude Code can prove is gone is replaced on its own and doesnât produce this failure. When the failure repeats on every start, delete~/.claude/daemon.lock, then open the session or dispatch again. Before v2.1.257, such a lock blocked every start until you deleted the file.
- If the message quotes a line, fix what it names, then open the session or dispatch again. The next attempt starts the service again
- Run
claude daemon statusto check whether a service is running now
Working directory no longer exists when starting a background session
The directory you started a background session in was removed while the session was starting. Claude Code doesnât start the session, and the message names the missing directory:could not be resolved on disk.
What to do:
- Recreate the directory the message names, or dispatch from a directory that exists, then try again
Workspace not trusted when dispatching a background session
You started or restarted a background session in a directory you havenât trusted, and the workspace trust dialog couldnât appear to ask you. Claude Code doesnât start the session:The home directory is trusted one session at a time: the sessionâs directory is your home directory. Claude Code never saves trust for the home directory, so accepting the dialog there in an earlier session doesnât count.<path> could not be resolved on disk: Claude Code couldnât find the sessionâs directory on disk.
- Run
claudein the directory the message names and accept the trust dialog, then run the command again - For the home-directory message, run the command from a terminal in your home directory so the dialog can appear, or start the session from a project directory instead
- For the
could not be resolved on diskmessage, recreate the directory, or start a new session from a directory that exists
Wrapper and IDE errors
These errors come from the program that launched Claude Code for you, such as an IDE extension or an Agent SDK application, rather than from Claude Code itself.Claude Code process exited with code N
The underlyingclaude process exited with a non-zero code. The exit code alone doesnât say what failed: the real error is in the processâs own output, which the wrapper appends when it captured any and otherwise keeps in its logs.
4294967295 right after a turn completes. When that exit lands at a turn boundary, with no message waiting and no background task running, the VS Code extension closes the session quietly instead of showing this error. Your next message resumes the conversation.
Before v2.1.273, the extension showed the error for that exit at every turn boundary, even though nothing was lost.
What to do:
- In VS Code, follow the View output logs link shown with the error to see the underlying failure
- In an Agent SDK application, catch the error around your message loop. The entries under CLI process exit cover what your code receives in each SDK language.
- Run
claudein a terminal in the same project. The failure usually reproduces there with its real error message, which you can then look up on this page. - Run
claude doctorin a terminal to check the installation and configuration
Could not locate the Claude CLI on PATH
The VS Code extension shows this error on Windows when you open Claude Code in the integrated terminal, the terminalâs shell is PowerShell, and the extension canât find the installedclaude executable on PATH. The extension refuses to launch Claude Code until it finds the installed claude on PATH.
- Open a new PowerShell window outside VS Code and run
where.exe claude. If it doesnât print a path, the CLI isnât on your PATH: add its install directory by following Verify your PATH. If it prints a path, the entry comes from your PowerShell profile or from a PATH change VS Code hasnât picked up yet; the next two steps cover those cases. - Set the PATH entry as a user or system environment variable, not in your PowerShell profile. The extension doesnât run your profile, so a PATH edit that lives only there never reaches it.
- Restart VS Code after changing PATH. The extension checks the PATH that VS Code captured at startup, so a PATH change takes effect only after a restart.
The connection to Claude Code ended before this message completed
The VS Code extension sent your message to theclaude process, and the connection ended without an error before the process acknowledged or finished it. The extension canât tell whether the message was processed, so it asks you to send it again:
- Send the message again. The next message starts a fresh
claudeprocess that resumes the conversation. - If it repeats, run
claudein a terminal in the same project. A failure that keeps ending the process usually reproduces there with its real error message.
Rewind warnings and errors
These messages come from a/rewind code restore. Restored the code, but skipped N files is a warning that Claude Code skipped some paths. No files were restored is an error that means it restored nothing.
Restored the code, but skipped files
A/rewind code restore skipped one or more tracked paths instead of writing or deleting through them. Claude Code skips a path when:
- it is, or became, a symlink, hard link, or other non-regular file
- its directory changed since the checkpoint
- its backup canât be safely read
/rewind wrote and deleted through links at tracked paths, and didnât report a partial restore.
- Identify which files were skipped so you can handle each one with the steps below. The message gives only a count; the debug log at
~/.claude/debug/<session-id>.txtnames each skipped path as the restore runs, so turn on debug logging with/debugbefore your next restore. On macOS or Linux, you can instead find the links directly:find . -type lfor symlinks andfind . -type f -links +1for hard-linked files. - If a skipped file is a link you created on purpose, such as a config file managed by a dotfile manager or a file hard-linked by tools like pnpm, the rewind left its contents alone. To undo the sessionâs changes to it, ask Claude to reverse the edit or edit the file yourself
- If you didnât create the link, inspect the path before trusting its contents
No files were restored
Claude Code shows this message when you restore code with/rewind and it canât restore any of the files in that checkpoint. For each file, either the backup Claude Code saved before editing it is missing, or Claude Code couldnât write to or delete the file.
/rewind still lists its checkpoints, but rewinding to one of them can fail with this error. If the message also says N paths were skipped for link safety, see Restored the code, but skipped files for those paths.
When you fork a session, for example with --fork-session or /branch, Claude Code copies the original sessionâs backups into the fork. When Claude Code canât copy a backup, for example because the disk is full, that backup is missing in the fork. Rewinding to a checkpoint that needs it can fail with this error.
What to do:
- Undo the changes another way: ask Claude to reverse its edits, or restore the files from version control. When the backups are gone, running
/rewindagain fails the same way. - If Claude Code couldnât write or delete a file, fix what blocks the write, such as file permissions, then run
/rewindagain. - To keep backups longer in future sessions, raise
cleanupPeriodDays.
Session saving warnings
Claude Code shows these warnings on a persistent line below the input box when it isnât saving your session transcript. The session keeps working either way; the warnings tell you the session may be missing from--resume later.
Transcript writes are failing
Claude Code saves the transcript to disk as you work, and its writes to the transcript file are failing. The message names the cause with the underlying error code, for example a full disk:- On the first failure for conditions that donât clear on their own: a full disk, an exceeded disk quota, a read-only filesystem, a path over the filesystemâs length limit, or, on macOS and Linux, a permission error
- After repeated failures spanning at least a minute for everything else, including permission errors on Windows, where an antivirus scan can fail a single write that then succeeds on retry
--resume missing recent messages was the first sign.
What to do:
- Fix the condition the error code names: free disk space for
ENOSPC; raise or clear the quota forEDQUOT; restore write access to the transcript location forEACCES,EPERM, orEROFS - The warning clears on its own at the next successful write; no restart is needed
- Messages sent while the warning was showing may still be missing when you resume the session later
Transcript saving is off because CLAUDE_CODE_SKIP_PROMPT_HISTORY is set
This session started withCLAUDE_CODE_SKIP_PROMPT_HISTORY set, so Claude Code writes no transcript or prompt history for it:
- If you set the variable on purpose, no action is needed; the notice confirms the session wonât appear in
--resume,--continue, or up-arrow history - If you didnât, remove the variable from the shell or script that launches
claude, then start a new session. Messages from the current session arenât saved retroactively.
Transcript saving is off because of an inherited CLAUDE_CODE_CHILD_SESSION marker
Claude Code setsCLAUDE_CODE_CHILD_SESSION in the subprocesses it spawns, and treats an interactive session that inherits it as nested: Claude Code saves no transcript for it, so sessions that Claude itself starts donât fill your --resume list. This notice means your current session inherited the marker:
claude from inside another Claude Code session; it signals a misclassification when the marker leaked through a long-lived intermediary, for example a terminal, screen session, or launcher that a Claude Code session originally started.
Inside tmux, Claude Code detects a marker that arrived through the tmux serverâs global environment and keeps saving, so this notice doesnât appear for that case.
What to do:
- If you started this session from inside another Claude Code session on purpose, no action is needed
- If this is a top-level session, exit and restart with
CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1set. Saving applies from the restart, so messages sent before it arenât saved. - To fix future launches from the same terminal or launcher, remove
CLAUDE_CODE_CHILD_SESSIONfrom its environment
Configuration warnings
Claude Code writes most of these messages to stderr, not into the conversation, and writes most of them at startup. An entry says so when its message appears somewhere else, such as in the debug log or as a startup notice in the conversation view, or at another time, such as the unrecognized-model diagnostic line at request time.Claude Code exited after an unrecoverable interface error
Claude Code prints this message when it exits because its terminal interface hit an error it canât recover from, in either renderer. The second sentence appears only when the error happened while the fullscreen renderer was starting:- Start Claude Code again. To pick the conversation back up, run
claude --resumein the same directory. - If the message names the fullscreen renderer, Fullscreen rendering says what the next launch does, which depends on how you turned fullscreen on, and how to try fullscreen again or keep the classic renderer.
Agent descriptions are over the 15.0k-token limit
Claude Code shows this warning as a startup notice in the conversation view rather than on stderr. The combined descriptions of your subagents, except the built-in ones, exceed 15,000 tokens as Claude Code estimates them. Each agent counts its name plus itsdescription frontmatter. Claude Code loads every agent whether or not the total is over the limit, so the warning doesnât change what loads.
- Shorten the
descriptionfrontmatter of your agent files, or ask Claude to trim them for you. - Remove agent files you no longer use.
A skill, command, or workflow wasnât loaded because its name is reserved
A skill folder, a frontmattername, a file or subfolder in .claude/commands/, or a saved workflow uses the name anthropic-skills or a name that starts with anthropic-skills:. Claude Code reserves that name for skills synced from claude.ai and doesnât load that item.
Claude Code shows this warning as a startup notice in the conversation view rather than on stderr:
name: line to edit, or a workflow to rename. When more than one item was refused, the notice ends with a count such as · 2 more, and the debug log names each one.
What to do:
- Rename the item the notice names, or edit the
name:line it points to, then restart the session.
Workspace has not been trusted
Claude Code foundpermissions.allow rules or permissions.additionalDirectories entries in the projectâs .claude/settings.json or .claude/settings.local.json and didnât apply them, because allow rules from project settings require workspace trust. The count, the setting name, and the file named in the message vary with your configuration. deny and ask rules arenât affected.
- Run
claudein the directory and accept the trust dialog. Project allow rules and workspace trust says which folder that acceptance covers. - In non-interactive mode with
-pno dialog is shown. Set thehasTrustDialogAcceptedentry in~/.claude.jsonusing the exactprojectskey the message prints. - If the message names
.claude/settings.local.jsonand you started Claude Code outside a git repository or in your home directory, update to v2.1.200 or later. Versions 2.1.196 through 2.1.199 treated your own.claude/settings.local.jsonas repository-supplied in those workspaces. On v2.1.207 and later, updating isnât enough outside a git repository if you havenât trusted the folder: determining that a folder isnât inside a repository runs git, and Claude Code runs that check only after you accept the trust dialog, so use the first step. Your home directory and any other configuration home are exempt and donât wait for the dialog. See Project allow rules and workspace trust.
Working directory is a network path
Claude Code doesnât add network paths as working directories. Looking up a network path can contact the host it names, and on Windows that contact can send the host your credentials, so Claude Code refuses the path without looking it up. You see this message when you run/add-dir with such a path, or as a warning at startup. When it appears at startup, Claude Code starts without that directory.
- UNC shares such as
\\server\share - Automount paths such as
/net/<host>, unless you launched Claude Code from a directory under that hostâs automount - Local paths that reach a network location through a symbolic link or junction
\\wsl$ paths donât count as network paths.
What to do:
- On Windows, map the share to a drive letter, for example with
net use Z: \\server\share, and pass the drive at launch withclaude --add-dir Z:\. - On macOS or Linux, mount the share at a local path and add that path instead.
- If the path is in
permissions.additionalDirectories, remove it from the settings file that lists it.
Remote managed settings failed to load
Your session is eligible for server-managed settings, but Claude Code couldnât fetch them or couldnât apply what the server returned, so it shows this warning in interactive sessions. The parenthesized cause names what failed, such asnetwork error, request timed out, or authentication rejected (401). The cause no setting in the server response could be applied as written means the server answered but none of the settings it returned passed validation. Before v2.1.282, this cause read server returned invalid settings.
The rest of the line says which policy the session runs on:
- Settings cached from an earlier successful fetch: Claude Code runs the session on that cached policy, except the withheld environment variables, and the line reads
using cached policy. - No cache: Claude Code runs the session without server-managed settings, and the line reads
no remote policy applied.
- Act on the cause the message names: for a network cause, check that this machine can reach
api.anthropic.com; for an authentication cause, check your sign-in with/status - For
no setting in the server response could be applied as written, ask your administrator to correct the settings on the server - Run
/statusorclaude doctorfor the full diagnostic
Managed settings were not approved
Your organizationâs server-managed settings include settings that need your approval, and you declined the security approval dialog, so Claude Code exits without applying them:- Start Claude Code again and approve the dialog to continue under your organizationâs settings. A declined dialog isnât remembered, so it appears again at the next start.
- If youâre unsure about a setting the dialog lists, ask whoever maintains your organizationâs managed settings before approving
Managed settings block the default model
Your organizationâs managed settings block the model the Default option resolves to and every model it could step down to. A session that would start on the Default option exits at startup instead of running a blocked model. Which message you see depends on the setting that blocks it. When adeniedModels list blocks it, the message reads:
availableModels list with availableModelsMatch set to "exact" omits it, the message reads:
- If you administer the settings, add a model your users can run to
availableModels, or narrow thedeniedModelsentries that block every fallback. Block specific models or versions describes how the Default option steps down - If you donât administer them, send the message to your administrator. Your own settings files canât widen a managed
availableModelsordeniedModelslist
Managed settings donât allow this API provider
Your organizationâs managed settings set anallowedProviders list, and the sessionâs API provider isnât on it or the session uses an endpoint that isnât pinned the way that entry requires. Claude Code refuses at startup, before a login, or when the session next contacts the API. The message begins with the permitted providers:
(allowedProviders lists only unrecognized entries) instead.
What to do:
- Follow the messageâs
To continue:steps - If you administer the settings, the messageâs lines starting
Admins:name the entry to add or the value to pin, and theallowedProvidersentry says which sourceâsenvblock can pin it
MCP server is blocked by enterprise managed policy
You selected Reconnect on a server in/mcp, or turned a disabled server back on there, and a setting that restricts MCP servers blocks that server. Claude Code refuses to connect it and shows:
- A
deniedMcpServersentry that matches the server, including one in your own~/.claude/settings.jsonor the projectâs.claude/settings.json - An
allowedMcpServerslist that the server doesnât match strictPluginOnlyCustomizationwithmcplocked, which blocks servers configured in~/.claude.jsonand.mcp.jsondisableClaudeAiConnectors, when the server is a claude.ai connector
- Check your own user and project settings files for one of these settings and change or remove it
- If none of your own settings explains the block, ask your administrator which managed setting blocks the server
/mcp could connect a server that a mid-session policy update blocked.
Managed settings document could not be parsed
Your organization deploys managed settings, and one of the deployed documents is present but canât be parsed as a JSON object, so Claude Code exits with code 1 at startup instead of running without the policy the document carries. The line names the failed source before the message:- The path of the
managed-settings.jsonfile or a drop-in file undermanaged-settings.d - The macOS managed preferences profile,
per-user managed preferencesordevice-level managed preferences - The Windows registry value,
Registry: HKLM\SOFTWARE\Policies\ClaudeCode\Settings
claude -p, Agent SDK sessions, background sessions, and most subcommands, claude doctor included. The refusal fails closed on purpose: settings in a document Claude Code canât parse canât be enforced, and starting anyway would run sessions without the organizationâs controls.
A schema problem in a parseable document doesnât produce this error. Find entries Claude Code dropped covers what Claude Code does with one.
When a managed-settings.d/ directory exists but canât be listed, Claude Code reports Managed settings drop-in directory could not be read: followed by the underlying error instead. Find entries Claude Code dropped covers when a read failure exits at startup.
What to do:
- If you administer the machine, fix the named document so it parses as a JSON object, or remove the file, profile, or registry value. An empty
managed-settings.jsoncounts as{}and doesnât block launch. - If you donât, ask your administrator to fix the deployed document. Nothing in your own settings files causes or clears this error.
Unable to read managed policy settings
Your organization deploys managed settings, and one of the deployed sources exists but couldnât be read, for a reason such as an I/O error rather than the operating system denying the read. With no other admin source supplying a policy, Claude Code exits at startup rather than run without the policy the source may carry:claude gateway server are refused with a variant of the first line that names allowedProviders.
A read that the operating system denied, such as on a root-only file, doesnât produce this exit: the session starts without that sourceâs policies. For a source that canât be parsed, Claude Code exits with a different message naming the source.
What to do:
- If you administer the machine, fix the problem the
Detail:line names so the deployed source can be read, or remove the source - If you donât, send the message to your administrator. Nothing in your own settings files causes or clears this error
otelHeadersHelper failed
Claude Code shows this warning as a notification in the terminal interface, once per interactive session, when theotelHeadersHelper script fails or prints output that doesnât meet the script requirements.
While the script keeps failing, exports fail and your telemetry backend receives nothing from the session.
The text after See /status: says what failed, such as the scriptâs exit code followed by its error output:
- Run
/statusto read the failure detail. - Fix the script so it exits 0 within 30 seconds and prints a JSON object of string header values on stdout. See script requirements.
- If your organization deploys the script through managed settings, ask whoever maintains them to fix it.
-p, the same failure appears on stderr as otelHeadersHelper failed (OpenTelemetry export headers unavailable): <error> instead.
headersHelper not run
Claude Code connected an MCP server with its staticheaders alone and skipped the serverâs headersHelper, because the helper is a shell command and the folder has no saved trust. A folder gets saved trust when you set its entry in ~/.claude.json by hand or, outside your home directory, when you accept the trust dialog for it in an interactive session. See Trust a folder before its headersHelper runs for which servers this check applies to.
Claude Code writes this line in non-interactive mode only, once per server. In an interactive session it writes the same refusal to the debug log instead.
projects key the message prints is the folder Project allow rules and workspace trust says Claude Code keys the trust on. Accepting the trust dialog for a parent folder doesnât satisfy the check, and a -p or SDK session doesnât satisfy it either.
What to do:
- Run
claudein the folder the message names, accept the trust dialog, then run your-por SDK command again - Set the
hasTrustDialogAcceptedentry in~/.claude.jsonyourself, using the exactprojectskey the message prints - If you started the session in your home directory, work from a project directory you have trusted. When you accept the trust dialog in your home directory, Claude Code holds that trust for the current session only.
Malformed Tool(content) rule
A permission rule in one of your settings files doesnât have the shapeTool or Tool(content), for example because text follows the closing parenthesis or one of the parentheses is missing. Claude Code skips the rule and lists it in the invalid-settings dialog when an interactive session starts, and in claude doctor output:
- In the settings file listed with the message, rewrite the rule so it ends at its closing parenthesis, for example
Bash(ls *)in place ofBash(ls) x - Leave parentheses inside the content as they are. Theyâre literal, so a rule such as
Edit(./Finance (2024)/**)is valid without escaping
Mismatched parentheses.
Is not matched by file permission checks
Claude Code found aWrite, NotebookEdit, MultiEdit, or Glob permission rule with a path in one of your settings files, in managed settings, or in a --allowedTools, --disallowedTools, or --settings flag value. It checks file permissions against Edit and Read rules only, so it never consults a path rule that names one of the other file tools. It keeps the rule and changes nothing else; the warning names the rule, its source in parentheses, and the replacement to write:
- Replace
Write(path),NotebookEdit(path), and legacyMultiEdit(path)rules withEdit(path).Editrules cover all file-editing tools. - Except in
--allowedTools, where Claude Code accepts aGlobrule without warning, replaceGlob(path)rules withRead(path). - Fix the rule at the source the warning names in parentheses: a settings file path, or the flag itself for
--allowed-toolsand--disallowed-tools. Aclaude-settings-<hash>.jsonpath that doesnât exist on disk stands for an inline--settingsvalue. Fix the JSON you pass to that flag. - Leave bare tool-name rules such as
WriteorGlobalone. Claude Code matches them at the tool level and doesnât warn about them. - If the source reads
managed policy settings, forward the warning to whoever maintains your managed settings, since you canât clear it yourself.
--output-format json or stream-json, Claude Code writes the warning to the debug log instead of stderr, so machine-read output stays clean. Run with --debug to capture it at ~/.claude/debug/<session-id>.txt. Before v2.1.210, Claude Code accepted these rules without a warning.
Has a wildcard before the rest of the command
Claude Code found aBash allow rule whose * comes before a later word that determines which command it is, such as Bash(git * main) or Bash(git -C * status *), in one of your settings files, in managed settings, or in an --allowedTools or --settings flag value. The * matches any text, including options inserted at that position: Bash(git * main) also approves git -c core.fsmonitor=<script> diff main, where -c makes git run a program the command names. Wildcard patterns shows the matching rules.
The warning exists so you can narrow a rule whose wildcard is broader than you intended. Claude Code keeps the rule and changes nothing about how it matches; the warning names the rule and its source in parentheses:
- Replace the
*before the subcommand with the exact value you mean:Bash(git checkout main)in place ofBash(git * main). - Move every
*after the subcommand:Bash(git status *)in place ofBash(git -C * status *). Write one rule per subcommand you want to allow. - Fix the rule at the source the warning names in parentheses: a settings file path, or the
--allowed-toolsflag itself. Aclaude-settings-<hash>.jsonpath that doesnât exist on disk stands for an inline--settingsvalue. Fix the JSON you pass to that flag. - If the source reads
managed policy settings, forward the warning to whoever maintains your managed settings, since you canât clear it yourself.
--output-format json or stream-json, Claude Code writes the warning to the debug log instead of stderr, so machine-read output stays clean. Run with --debug to capture it at ~/.claude/debug/<session-id>.txt. Before v2.1.246, Claude Code accepted these rules without a warning.
Denying Bash also turns off the PowerShell tool
You removed the whole Bash tool, for example with--disallowedTools Bash or with a bare Bash or Bash(*) deny rule in one of your settings files. On Windows with Git Bash installed, denying Bash also turns the PowerShell tool off, so the session starts with no shell tool. Claude Code prints this warning at startup:
- To have Claude use PowerShell, set
CLAUDE_CODE_USE_POWERSHELL_TOOLto1in your environment or in theenvblock of a settings file, as Enable the PowerShell tool shows. The PowerShell tool then stays on alongside your Bash deny rule. - To block particular commands instead of the whole tool, replace the bare
Bashentry with scoped rules such asBash(git push *)in the same settings file or flag. Claude keeps the Bash tool, and the PowerShell tool stays off until you also set the variable or add a scopedPowerShellpermission rule.
--output-format json or stream-json, Claude Code writes the warning to the debug log instead of stderr. Run with --debug to capture it at ~/.claude/debug/<session-id>.txt. Before v2.1.287, Claude Code turned the PowerShell tool off the same way without printing a warning.
crossSessionInbound must be one of accept, hold, refuse
A settings file setscrossSessionInbound to a value Claude Code doesnât recognize, such as the typo "reject". The warningâs second sentence depends on which file holds the value; in a user, project, local, or --settings file it reads:
refuse, the most restrictive value, and the warning says cross-session messages are turned away until an administrator fixes it. For how the hold combines with values in your other settings files, see crossSessionInbound.
What to do:
- Set the key to
"accept","hold", or"refuse", or remove it - When the warning names managed settings, ask the administrator to fix the value
ANTHROPIC_FOUNDRY_RESOURCE must be a Foundry resource name
You setANTHROPIC_FOUNDRY_RESOURCE to something other than a bare Microsoft Foundry resource name, such as the endpoint URL or its host name. Claude Code refused the value before sending a request. The message appears in place of Claudeâs reply, not as a startup warning:
- Set
ANTHROPIC_FOUNDRY_RESOURCEto the resource name alone and restart Claude Code. For the endpointhttps://my-resource.services.ai.azure.com/anthropic, the name ismy-resource. - To give the full endpoint URL instead, set
ANTHROPIC_FOUNDRY_BASE_URLto the URL and removeANTHROPIC_FOUNDRY_RESOURCE, then restart Claude Code. Claude Code accepts only one of the two variables.
The 200K limit isnât enforced
You setCLAUDE_CODE_DISABLE_1M_CONTEXT=1, which normally makes auto-compaction hold sessions on 1M-context models to a 200K window, but no compaction threshold caps this session at or below 200K, so the conversation can grow past it.
- The model ID isnât one Claude Code recognizes, such as an LLM gateway alias, and you set
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1or raised the assumed window past 200K withCLAUDE_CODE_MAX_CONTEXT_TOKENS. In this case the message also offersor update to a Claude Code version that recognizes <model>as a remedy. - A
context-1mbeta requested throughANTHROPIC_BETASor the--betasflag still asks the API for the 1M window on a model that accepts that beta, while nothing compacts the session at 200K
- Set
CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000, or theautoCompactWindowsetting to200000, so auto-compaction compacts at the 200K boundary - If the message names a model ID this version doesnât recognize, run
claude update. A version that recognizes the ID as a 1M-context model enforces the limit without further configuration. - If you want the session to use the modelâs full window instead, unset
CLAUDE_CODE_DISABLE_1M_CONTEXT; the warning reports only that the 200K limit isnât enforced
--output-format json or stream-json, Claude Code writes the warning to the debug log instead of stderr.
Unrecognized model ID on a request
Claude Code sent a request for a model ID that your Claude Code version doesnât recognize, and found nomodelOverrides entry that maps that ID to a model it does recognize. Claude Code still sends the request with the ID as you configured it, and doesnât exit or switch models.
[claude-code:unrecognized_model] prefix. After the prefix and one space, Claude Code writes a one-line JSON object. Claude Code can add fields to it in a later version, so ignore any field you donât expect. It writes at least these two:
model: the model string as you configured itquery_source: the request path that used the model. Claude Code reportssdkfor a-prun and a value that starts withagent:for a subagent.
- In non-interactive mode with
-p, Claude Code writes it to stderr under every--output-format, so you can parse stdout without filtering the line out - In an interactive session or a background session, Claude Code writes it to the debug log instead; run with
--debugto capture it at~/.claude/debug/<session-id>.txt
us.anthropic.claude-... IDs, Google Cloudâs Agent Platform IDs with an @ version suffix, and Microsoft Foundry deployment names that contain a Claude model ID. Claude Code checks the model behind an Amazon Bedrock application inference profile ARN rather than the ARN itself. It writes no line for an ARN it canât resolve, such as a mistyped one.
What to do:
-
If you set the ID on purpose, such as an LLM gateway alias, add a
modelOverridesentry to your settings file with the ID as its value. Use an Anthropic model ID as the key, not a family alias such asopus. Formy-proxy-modelfrom the example line, add this entry:Claude Code then treatsmy-proxy-modelasclaude-opus-4-6and stops writing the line. -
If the ID names a model newer than your Claude Code version, run
claude update -
If the ID is a typo, fix it in whichever of the places you can set a model or alias variables holds it. If
query_sourcestarts withagent:, fix it where you set the subagentâs model instead.
Stale sandbox mask files left by a killed session
claude doctor prints this warning in its diagnostics, and /status lists the same line. It appears on Linux and WSL2 when sandboxing is enabled with filesystem isolation on.
While a sandboxed command runs, the sandbox holds a write denial on a file that doesnât exist yet by creating a 0-byte read-only placeholder there, and removes it afterward. A session killed before that cleanup runs, for example by SIGKILL, leaves the placeholders behind. Later sessions bind them read-only again on every start, so a settings write such as saving âYes, and donât ask againâ fails where one sits.
- Quit any other Claude Code session running in that project, then delete each listed file with
rm. The warning names up to three files and counts the rest, so rerunclaude doctorafter deleting until the warning no longer appears. A placeholder that another sessionâs sandbox is still using is a live part of that sessionâs write protection - If a permission choice you saved with âYes, and donât ask againâ didnât stick, save it again after deleting the placeholder
claude doctor didnât flag these files; earlier versions leave the same placeholders behind when a session is killed.
Responses seem lower quality than usual
If Claudeâs answers seem less capable than you expect but no error is shown, the cause is usually conversation state rather than the model itself. Claude Code doesnât silently change model versions. It can switch to a fallback model in these cases:- A configured
--fallback-modeltakes over after an availability error, for that turn only, with a notice in the transcript - An Amazon Bedrock or Google Cloudâs Agent Platform startup check finds your default model unavailable, or your account loses access to it mid-session
- Automatic model fallback on Fable 5.1, Fable 5, Opus 5.5, Sonnet 5.5, and Opus 5 moves the session to the flagged categoryâs fallback model, when that category has one, and shows a notice in the transcript
/model change. Model configuration explains when each fallback applies.
Check these first:
- Model selection: run
/modelto confirm you are on the model you expect. A previous/modelchoice or anANTHROPIC_MODELenvironment variable may have you on a smaller model than you intended. - Effort level: run
/effortto check the current reasoning level and raise it for hard debugging or design work. Defaults vary by model, so check before assuming you are below the maximum. See Adjust effort level for per-model defaults and theultrathinkshortcut. - Context pressure: run
/contextto see how full the window is. If it is near capacity, run/compactat a natural breakpoint or/clearto start fresh. See Explore the context window for how auto-compact affects earlier turns. - Stale instructions: large or outdated
CLAUDE.mdfiles and MCP tool definitions consume context and can steer responses. The/doctorcheckup flags oversized memory files and unused extensions, and/contextshows MCP tool token usage. Before v2.1.205,/doctoropened a diagnostics screen that flagged oversized memory files and subagent definitions.
/rewind to step back to before the bad turn, then rephrase the prompt with more specifics. Correcting in-thread keeps the wrong attempt in context, which can anchor later answers to it. See Checkpointing.
If quality still seems off after checking the above, run /feedback and describe what you expected versus what you got. Feedback submitted this way includes the conversation transcript, which is the fastest way for Anthropic to diagnose a real regression. See Report an error if /feedback is unavailable in your environment.
If Claude warns about a suspected prompt injection, or refuses a request because of a suspected injection, and the text the warning names is context Claude Code adds to the conversation automatically rather than file or web content, run claude update and retry. If the warning repeats after updating, report it rather than pasting the flagged content back into the prompt. Before v2.1.201, Sonnet 5 refused some requests the same way.
Report an error
For errors from components this page doesnât cover, see the relevant guide:- MCP server failed to connect or authenticate: MCP
- Hook script failed or blocked a tool: Debug hooks
- Permission denied or filesystem errors during install: Troubleshoot installation and login
- Run
/feedbackinside Claude Code to send the transcript and a description to Anthropic. The command also offers to open a prefilled GitHub issue. Sending to Anthropic requires authentication. On Amazon Bedrock, Google Cloudâs Agent Platform, Microsoft Foundry, and other third-party providers, or when no Anthropic credentials are configured,/feedbacksaves a local archive you can send to your Anthropic account representative instead. - Run
claude doctorfrom your shell for a read-only diagnostic of your installation, or run the/doctorcheckup inside Claude Code to find and fix setup problems - Check status.claude.com for active incidents
- Search existing issues on GitHub