Omniscio

OmniscioGuidesClaude Code error messages

Claude Code error messages explained

The messages Claude Code prints when something stops it, word for word, with what each one means and the steps that clear it. Every message and every fix comes from Anthropic's own documentation or from the GitHub issue where a user reported it, and each section links its source.

Messages checked against their sources on October 13, 2026. Updated .

Prompt is too long, or Context limit reached

Prompt is too long
Context limit reached · /compact or /clear to continue

What it means. The conversation, plus the files attached to it, no longer fits in the model's context window. The second line is how an interactive session shows the same error.

How to fix it

  1. Run /compact to summarize the earlier turns and free space, or /clear to start a fresh conversation.
  2. Run /context to see what is taking the space: the system prompt, tools, memory files and messages.
  3. Turn off MCP servers you are not using with /mcp disable <name>. Their tool definitions are sent with every request.
  4. Trim a large CLAUDE.md file.
  5. If you turned auto-compact off in /config or with DISABLE_AUTO_COMPACT, turn it back on. It is on by default and normally stops this error from appearing.

Source: Anthropic, Claude Code error reference.

Error during compaction: Conversation too long

Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.
Prompt is too long · automatic compaction failed: <the underlying error>

What it means. Claude Code tried to summarize the conversation to make room, and the summary step failed. The first line is the older wording users reported; current versions print the second, which names what went wrong.

How to fix it

  1. If the message names an error after automatic compaction failed:, fix that error first, using its own section on this page. /compact fails on the same error until you do.
  2. On the older wording, do what it says: press Esc twice to go back a few messages, then try again.
  3. If /compact answers Not enough messages to compact., the space is taken by a single prompt. Run /clear and send it again with less pasted text or smaller attachments.
  4. Update with claude update. Before version 2.1.269, compaction failed whenever it could not summarize a whole exchange.

Sources: Anthropic, Claude Code error reference; the older wording from GitHub issue #26518.

API Error: 529 Overloaded, or 500 Internal server error

API Error: Repeated 529 Overloaded errors. The API is at capacity — this is usually temporary. Try again in a moment. If it persists, check https://status.claude.com.
API Error: 500 Internal server error. This is a server-side issue, usually temporary — try again in a moment. If it persists, check https://status.claude.com.
API Error: 529 {"type":"error","error":{"type":"overloaded_error","message":"Overloaded.
https://docs.claude.com/en/api/errors"},"request_id":"req_011CZTEFvft13DajMTp9pp64"}

What it means. Both are on Anthropic's side. A 529 means the API is at capacity for all users; it is not your usage limit and does not count against your quota, and Claude Code has already retried several times before it shows the message. A 500 means something failed inside the API, and your prompt, settings and account did not cause it. The last line is the raw API response one user reported from Claude Code 2.1.85, in GitHub issue #39745.

How to fix it

  1. Check status.claude.com for an incident or a capacity notice.
  2. Wait a few minutes and send the message again. After a 500, your original message is still in the conversation, so you can type try again instead of pasting it.
  3. For a 529, run /model and switch to another model to keep working now. Capacity is tracked per model.
  4. If a 500 keeps happening and no incident is posted, run /feedback so Anthropic can look at your request.

Sources: Anthropic, Claude Code error reference (529) and (500); Anthropic API errors; the raw form from GitHub issue #39745.

You've hit your session limit, or 5-hour limit reached

You've hit your session limit · resets 3:45pm
You've hit your weekly limit · resets Mon 12:00am
5-hour limit reached ∙ resets 12pm

What it means. Your Claude subscription's rolling usage allowance has run out, and Claude Code blocks requests until the time shown. The last line is the older wording of the session limit.

How to fix it

  1. Wait for the reset time in the message.
  2. Run /usage to see your plan's limits and when each one resets.
  3. If the message names Opus or Sonnet, switch to a model outside that family with /model. The session and weekly limits are shared across all models, so switching does not help with those.
  4. On Pro and Max, /usage-credits buys more usage. On Team and Enterprise it sends the request to your admin.

Sources: Anthropic, Claude Code error reference; the older wording from GitHub issue #6457.

You've hit your org's monthly spend limit

You've hit your monthly spend limit · raise it at https://claude.ai/settings/usage?from=cc_cli_limit_message
You've hit your org's monthly spend limit · visit https://claude.ai/admin-settings/usage to raise it

What it means. Your plan's included usage cannot cover the request, and the usage credits that would pay for it have reached a spend limit. The message names whose limit it is, yours or your organization's, and the text after the dot says how to get it raised.

How to fix it

  1. On Pro and Max, raise your monthly spend limit in Settings > Usage on claude.ai, or run /usage-credits.
  2. On Team and Enterprise, raise it in Organization settings > Usage if you manage billing. If you do not, /usage-credits sends the request to your admin for you.
  3. If the message also names a reset time for your plan's window, you can wait for it instead.
  4. Run /usage to see your plan's windows and when each one resets.

Source: Anthropic, Claude Code error reference.

API Error: Request rejected (429)

API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check https://status.claude.com.

What it means. Your requests hit the rate limit set for your API key, Amazon Bedrock project or Google Cloud project.

How to fix it

  1. Run /status and confirm the active credential is the one you expect. A stray ANTHROPIC_API_KEY in your environment can send requests through a low-tier key instead of your subscription.
  2. Check your provider's console for the limits in force, and request a higher tier if you need one.
  3. Send fewer requests at once: run fewer subagents in parallel, lower CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY, or use a smaller model with /model for high-volume scripted runs.

Sources: Anthropic, Claude Code error reference; Anthropic API errors.

OAuth token has expired, or Not logged in

Please run /login · API Error: 401 OAuth token has expired ...
OAuth token revoked · Please run /login
Not logged in · Please run /login

What it means. Your saved login is no longer valid. Expired means the automatic refresh failed during the session; revoked means you signed out everywhere or an admin removed your access.

How to fix it

  1. Run /login at the Claude Code prompt and sign in again.
  2. If a claude -p command or an Agent SDK program hit the error, run claude in the same environment, complete /login, then run the command again.
  3. For automation that cannot sign in by hand, use an ANTHROPIC_API_KEY or a long-lived token from claude setup-token.
  4. If it asks you to log in on every launch, work through the system clock and macOS credential-storage checks in Anthropic's install troubleshooting.

Source: Anthropic, Claude Code error reference.

Invalid API key

Invalid API key · Fix external API key
Invalid API key · Please run /login

What it means. The API rejected the key Claude Code sent from the ANTHROPIC_API_KEY environment variable or an apiKeyHelper script. The second line is an older wording users reported.

How to fix it

  1. Check the key for typos, and confirm in the Claude Console that it has not been revoked.
  2. In the same shell, run env | grep ANTHROPIC, or in PowerShell Get-ChildItem Env:ANTHROPIC*. direnv, dotenv shell plugins and IDE terminals can load a stale key from a .env file in your project.
  3. To use your subscription instead, unset ANTHROPIC_API_KEY and run /login.
  4. Run /status to confirm which credential Claude Code is using now.

Sources: Anthropic, Claude Code error reference; the older wording from GitHub issue #5167.

Claude requested permissions to use Bash, but you haven't granted it yet

Error: Claude requested permissions to use Bash, but you haven't granted it yet.

What it means. Claude tried to use a tool without approval: no allow rule covered the call, or a deny rule prevented it. The report this wording comes from was a claude -p run with Bash(git commit:*) in its allowed tools.

How to fix it

  1. Run /permissions. It lists every permission rule and the settings file each one comes from.
  2. Remove or narrow the rule that blocks the tool. Rules are checked deny first, then ask, then allow, and the first match wins.
  3. For claude -p, allow the tool up front with --allowedTools, either the whole tool ("Bash") or a pattern such as "Bash(git commit *)".
  4. If your organization's managed settings deny the tool, no other setting can allow it. Ask your admin.

Sources: Anthropic, Claude Code permissions; Anthropic, running Claude Code programmatically; the message from GitHub issue #1520.

MCP server not connecting: Failed to connect, or Connection closed

✘ Failed to connect
MCP error -32000: Connection closed

What it means. Claude Code could not start or reach one of the MCP servers in your configuration. claude mcp list prints the first line beside that server; the failure is the server's, not the list command's.

How to fix it

  1. Run claude mcp get <name> and read its Issue: line. It carries the status code or error code and any text the server sent back.
  2. Open /mcp inside Claude Code and choose Reconnect from that server's menu.
  3. If the server lives in a project's .mcp.json and shows Pending approval, run claude in that folder and approve it.
  4. Give local scripts in command or args as absolute paths. A relative path is why a server starts from one directory and fails from another.
  5. If the server is slow to start, raise MCP_TIMEOUT from its default of 30000 milliseconds, for example MCP_TIMEOUT=60000 claude.

Sources: Anthropic's Claude Code MCP docs and configuration debugging page; the Connection closed report, which was intermittent at session start, is GitHub issue #90844.

Auto mode is unavailable: the server returned no safety verdict

The server-side auto mode classifier gave no verdict (timed out), so auto mode cannot determine the safety of <tool>.
Auto mode is unavailable — the server returned no safety verdict for the last 10 responses, so Claude stopped. Send a message to try again, or switch out of auto mode.

What it means. In auto mode a separate classifier model reviews each action before it runs, and with server-side review that check happens on Anthropic's servers. When it gives no verdict, auto mode denies that action, and after ten responses in a row with no verdict it stops the turn.

How to fix it

  1. Send another message to have Claude try again. The count of responses starts over.
  2. If your requests go through an LLM gateway or proxy and the stop repeats, check whether it cuts streaming responses short or rewrites them.
  3. Set CLAUDE_CODE_AUTO_MODE_SERVER=0 before you start Claude Code to have it make its own classifier requests instead. On a direct connection to the Anthropic API this needs version 2.1.281 or later, so run claude update first.
  4. To approve the actions yourself, switch out of auto mode.

Source: Anthropic, Claude Code error reference.

command not found: claude

zsh: command not found: claude
bash: claude: command not found
'claude' is not recognized as an internal or external command

What it means. The install finished, but the folder it put claude in is not on your PATH. The installer uses ~/.local/bin on macOS and Linux and %USERPROFILE%\.local\bin on Windows.

How to fix it

  1. Check the program is there: ls -la ~/.local/bin/claude. If the file does not exist and you did not install Claude Code another way, such as with npm, Homebrew or a Linux package manager, install it again.
  2. On macOS with Zsh, run echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc and then source ~/.zshrc. With Bash on Linux, use ~/.bashrc in both commands.
  3. On Windows, add the folder to your user PATH and open a new terminal.
  4. If claude now runs but misbehaves, run claude doctor for installation diagnostics.

Source: Anthropic, Claude Code install troubleshooting.

Running several sessions at once

The context errors at the top of this page are easier to prevent than to clear, and with several sessions open it is hard to keep an eye on each one. Omniscio, the desktop app we make for running many Claude Code sessions at once, shows how full each session's context is and warns you at 75% and 90%. The features page lists the rest of it, and the download page has the installers.

Common questions

Does a 529 Overloaded error count against my usage limit?

No. Anthropic's error reference says a 529 is not your usage limit and does not count against your quota. It means the API is at capacity for everyone, so wait a few minutes or switch models with /model.

What is the difference between a usage limit and a 429?

A usage limit belongs to a Claude subscription and lifts at the reset time the message shows. A 429 is the rate limit on an API key or a cloud provider project, and you request a higher tier in that provider's console.

How do I see which login or API key Claude Code is using?

Run /status. It names the active credential. An approved ANTHROPIC_API_KEY in your environment takes precedence over your subscription login, which can explain a 401 or a 429 you did not expect.

Where is the full list of Claude Code errors?

Anthropic keeps an error reference at code.claude.com/docs/en/errors and an install troubleshooting page beside it. This page covers twelve common messages and links each one to its source.