Skip to main content

Error Message Catalog

This chapter covers what went wrong and how to recover when you hit an error message while using Claude Code. For installation and login errors (command not found, PATH, OAuth login failures, etc.), see the Level 1 installation chapter; for troubles with model collaboration behavior patterns, see Level 3 troubleshooting.

tip

For the exact error taxonomy and the latest fixes, the official error reference is the base. This chapter distills the cases readers run into most often.

Automatic Retries Happen Firstโ€‹

Server errors, 529 overloads, request timeouts, transient 429 throttles, dropped connections โ€” for all of these, Claude Code automatically retries up to 10 times with exponential backoff before showing an error. The Retrying in Ns ยท attempt x/y countdown on screen is that in action.

An error appearing on screen = the automatic retries have already been exhausted. Two environment variables tune the behavior:

VariableDefaultEffect
CLAUDE_CODE_MAX_RETRIES10Retry count. Lower it in scripts so failures surface quickly. Raise it to ride out long incidents
API_TIMEOUT_MS600000Per-request timeout (ms). Raise it on slow networks or behind proxies

Server Errors โ€” Transient Outagesโ€‹

API Error: 500 Internal server error
API Error: Repeated 529 Overloaded errors
Request timed out

The case where things still fail even after automatic retries. Not a problem with your prompt, settings, or account.

Fixes:

  • Check status.claude.com for active incidents
  • Try again shortly โ€” your previous message stays in the conversation, so for long prompts just typing try again is enough
  • If only one model is under heavy load, switch models with /model (capacity is tracked per model)

Usage Limits โ€” Your Plan Is Tapped Outโ€‹

You've hit your session limit ยท resets 3:45pm
You've hit your weekly limit ยท resets Mon 12:00am
You've hit your Opus limit ยท resets 3:45pm

Your subscription plan's rolling usage limit is exhausted. You're blocked until the displayed reset time.

Fixes:

  • Wait for the reset time
  • Check plan limits and reset times with /usage
  • Pro and Max can buy extra usage with /usage-credits. Team and Enterprise should ask their admin
  • To see limits coming before you hit them, add the rate_limits field to a custom statusline (see Velog journal #50 on statusline)

Authentication โ€” Credential Problemsโ€‹

A Stale Environment Variable Overriding Your Subscriptionโ€‹

Your ANTHROPIC_API_KEY belongs to a disabled organization ยท Unset the environment variable to use your other credentials

The most common trap. An ANTHROPIC_API_KEY set at a previous job or project is still in your shell profile, and that key belongs to a deactivated organization. The environment variable takes precedence over /login subscriptions, so the stale key gets used first even if you have a Pro or Max subscription.

Fix:

unset ANTHROPIC_API_KEY
claude

Permanently remove the export ANTHROPIC_API_KEY=... line from ~/.zshrc, ~/.bashrc, and ~/.profile. On Windows, check the PowerShell profile ($PROFILE) and user environment variables. Afterwards, confirm the currently active credentials with /status.

Expired Loginโ€‹

OAuth token revoked ยท Please run /login
OAuth token has expired ยท Please run /login

Re-authenticate with /login. If it recurs, run /logout first โ†’ /login. An inaccurate system clock makes token validation fail, so check your clock.

Network โ€” Cannot Connectโ€‹

Unable to connect to API. Check your internet connection
fetch failed
SSL certificate verification failed

Corporate proxies, VPNs, and firewalls are the usual causes.

Fixes:

  • In the same shell, try curl -I https://api.anthropic.com (on Windows PowerShell use curl.exe โ€” avoid the Invoke-WebRequest alias)
  • Behind a corporate proxy, set HTTPS_PROXY before starting Claude Code
  • If routing through an LLM gateway, set ANTHROPIC_BASE_URL
  • If a corporate proxy intercepts TLS, point to your company's CA bundle with the NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem environment variable. Never use NODE_TLS_REJECT_UNAUTHORIZED=0 (it turns off certificate verification entirely)

Request Errors โ€” Prompt Too Long or Broken Stateโ€‹

The Prompt Exceeds the Context Windowโ€‹

Prompt is too long

Fixes:

  • Summarize earlier turns with /compact โ†’ free up space. Or start fresh with /clear
  • Check how much the system prompt, memory, MCP tools, and messages each occupy with /context (see Velog journal #38)
  • Remove tool definitions of unused MCP servers with /mcp disable <name>
  • Split a giant CLAUDE.md using path-specific rules so parts load only when needed

/compact Itself Failsโ€‹

Error during compaction: Conversation too long. Press esc twice to go up a few messages and try again.

The case where /compact doesn't even have room to produce a summary. Press Esc twice to go back a few turns, drop some recent messages, then run /compact again. If that still fails, start a new session with /clear โ†’ the previous conversation can be restored with /resume.

Image/PDF Size Exceededโ€‹

Image was too large. Double press esc to go back and try again with a smaller image.
PDF too large (max 100 pages, 32 MB).

When this error occurs, the image stays in the conversation history and blocks subsequent messages with the same error. Press Esc twice to go back before that turn and re-attach a smaller image. Single images: longest edge up to 8000px; multiple images: 2000px or less.

Tool-Call Flow Gets Tangledโ€‹

API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.

The case where a tool call was interrupted mid-way and the history lost consistency. Use /rewind or Esc twice to rewind to just before a checkpoint, then continue. (For checkpoints, see Level 2 checkpointing.)

Response Quality Suddenly Droppedโ€‹

No errors, but the answers are weaker than usual. The model does not silently change โ€” the cause is almost always conversation state.

Check in this order:

  • /model โ€” confirm it's the model you intended. A previous /model selection or the ANTHROPIC_MODEL environment variable may have pinned you to a smaller model
  • /effort โ€” check the current reasoning level. Raise it for hard debugging or design work. Defaults differ by model, so don't assume it's at maximum (see Velog journal #44)
  • /context โ€” check how full the window is. If it's full, /compact or /clear
  • /doctor โ€” detects a bloated CLAUDE.md or subagent definitions

On a turn where the response went wrong, rewind with /rewind rather than correcting via follow-up messages, then retry with a more specific prompt. In-thread corrections leave the failed attempt in context, pulling later answers in that direction too.

Auto Mode โ€” The Classifier Failed to Decideโ€‹

<model> is temporarily unavailable, so auto mode cannot determine the safety of ...
Auto mode could not evaluate this action and is blocking it for safety
Auto mode classifier transcript exceeded context window

Auto Mode (see Velog journal #43) could not make an auto-approval decision. Reads, searches, and edits inside the working directory skip the classifier, so those keep working.

Fixes:

  • First two messages = retry shortly; Claude sees the same message and usually retries automatically
  • Third message = in an interactive session it usually falls back to a permission prompt. In non-interactive mode (-p) it aborts โ€” shrink with /compact

Diagnostics and Reportingโ€‹

For errors not on this page, or when the fixes above don't work:

  • /feedback โ€” run inside Claude Code. Sends the transcript and a description to Anthropic and offers a prefilled GitHub issue. With third-party providers like Bedrock, Vertex, or Foundry, it saves a local archive instead
  • /doctor โ€” automatically diagnoses local configuration problems
  • status.claude.com โ€” check active incidents
  • GitHub issues โ€” search existing reports

Summaryโ€‹

CategoryFirst action
Server errors (5xx, 529, timeout)status.claude.com โ†’ retry shortly โ†’ switch with /model
Usage limitsCheck /usage โ†’ wait for reset or /usage-credits
Authentication (stale env)unset ANTHROPIC_API_KEY โ†’ remove from shell profile permanently โ†’ confirm with /status
Networkcurl -I https://api.anthropic.com โ†’ proxy settings, CA bundle
Prompt length/compact โ†’ if that fails, Esc twice โ†’ /clear
Tangled tool flow/rewind
Response quality drop/model โ†’ /effort โ†’ /context โ†’ /rewind then retry
Auto Mode failureRetry shortly โ†’ fall back to permission prompt โ†’ /compact if needed

Next level: โš™๏ธ Level 3 โ€” Intermediate