Claude Code Troubleshooting

A practical guide to fixing Claude Code: a triage method (/doctor, /context, safe mode, clean config, debug logs), and symptom tables for installation and login, configuration that doesn't load (CLAUDE.md, settings, hooks, MCP, skills), API and usage-limit errors, permissions in scripts, performance, context thrashing, search, terminal and clipboard problems.

On this page

Simple definition#

Most Claude Code problems are one of three things: something didn’t load (a file in the wrong place, a typo, an unapproved server), something else overrode it (a higher-precedence setting, a managed policy), or the environment is in the way (PATH, network, proxy, terminal). Look at what actually loaded before guessing, isolate with safe mode, and change one thing at a time.

The triage method#

Troubleshooting triage: look, isolate, fix or report · drawn with Archify · zoom, guided views, search and SVG/PNG export. © 2026 Samir Kumar Sahoo, all rights reserved. Open full screen ↗
Step Command Tells you
1. Check the setup /doctor in a session, or claude doctor if it won’t start Install health, invalid settings files, unused extensions, stale CLAUDE.md content — and proposes fixes
2. See what loaded /context all System prompt, tools, MCP tools, agents, memory files, skills — with sources
/status Version, account, model, setting sources (managed or not)
/memory, /skills, /hooks, /mcp, /permissions Each surface in detail
3. Isolate claude --safe-mode Same session with all customisations off (CLAUDE.md, skills, plugins, hooks, MCP, agents, styles, keybindings); managed policy still applies
CLAUDE_CONFIG_DIR=~/claude-clean/config claude --setting-sources user in an empty directory Fresh user config and no project config
4. Watch it happen claude --debug=mcp,hooks or /debug <issue> Debug log at ~/.claude/debug/<session>.txt
5. Report /feedback (consent screen first) Sends the report; GitHub issues for known bugs

Installation and login#

You see Fix
command not found: claude / 'claude' is not recognized Add the install directory to PATH, open a new terminal
syntax error near unexpected token '<' or HTML in PowerShell The install URL returned a web page (proxy, captive portal) — check network, use an alternative installer
EACCES: permission denied Take ownership of the install directory (e.g. sudo chown -R $(whoami) ~/.local)
TLS connect error, unable to get local issuer certificate Update CA certificates, or configure your corporate CA (NODE_EXTRA_CA_CERTS)
Failed to fetch version, download drops Check proxy (HTTPS_PROXY), retry claude update
Auto-update failed · Run claude doctor Run claude update from your shell
Release verification failed Run claude update or claude install again
Killed during install on Linux Free memory or add swap
Windows: requires either Git for Windows … or PowerShell Install Git for Windows or use PowerShell
Login loops, 403 Forbidden, “organization disabled” /logout then /login; check the right account/org; claude update if the enterprise option is missing
“You haven’t been added to your organization yet” Your seat lacks Claude Code — ask an admin
Bedrock / Vertex / Foundry credential errors Check the provider variables and cloud credentials; /status shows the active provider
ANTHROPIC_API_KEY used instead of your subscription Unset it — when set, it overrides your login

Configuration that doesn’t take effect#

Symptom Likely cause Fix
Claude ignores a CLAUDE.md rule File didn’t load, or the rule is vague, contradicted, or lost in a long file Confirm in /context; shorten; /doctor prompt-audit; use a hook if it must always hold
Subdirectory CLAUDE.md seems ignored Loads on demand when Claude works in that folder Ask Claude to read a file there
Edited CLAUDE.md has no effect Not re-read mid-session Start a new session
A settings.json value seems ignored Same key in settings.local.json, --settings, or managed settings /status for sources; check precedence
Global permissions or hooks ignored Put in ~/.claude.json (app state) Move to ~/.claude/settings.json
Hook never fires matcher is an array, lowercase (bash), misspelled, or hooks are in a standalone file One string, "Edit|Write"; tool names are capitalised; hooks go under "hooks" in settings
Hook listed but doesn’t fire Matcher doesn’t match the tool, or the folder isn’t trusted claude --debug and trigger it; accept workspace trust
Skill not in /skills File at .claude/skills/name.md Use .claude/skills/name/SKILL.md
Skill listed but never used disable-model-invocation: true, or description doesn’t match requests Check the badge in /skills; put the use case first in the description
Sub-agent ignores CLAUDE.md Explore and Plan skip it; omitClaudeMd on custom agents Put the needed context in the task prompt
.mcp.json servers never load File under .claude/, or key is servers instead of mcpServers .mcp.json at the repo root with mcpServers
mcpServers in settings.json ignored Settings don’t read that key Use .mcp.json or claude mcp add --scope user
Project MCP server missing Approval prompt was dismissed Approve in /mcp
MCP server fails from some directories Relative path in command/args Absolute paths; npx/uvx are fine
MCP server connected but zero tools Server not returning a tool list Reconnect in /mcp; claude --debug=mcp for its stderr
Bash(rm *) deny doesn’t stop /bin/rm Rules match the command string PreToolUse hook or the sandbox
Output style didn’t apply Lowercase name in settings, or file edited mid-session Exact case (Concise); restart
Everything works in safe mode One customisation is the cause Re-enable one at a time

Permissions in scripts and the SDK#

Symptom Fix
Tool calls denied in claude -p or Agent SDK runs after an upgrade Pass the mode explicitly: --permission-mode / permissionMode / permission_mode, and an allowlist
Run stops on a permission it can’t ask about --allowedTools for what it needs, --permission-mode dontAsk to refuse the rest
SDK canUseTool never called Bare tool names in allowedTools or bypassPermissions approve first — use specifiers
Auto mode keeps blocking routine work Add context in autoMode.environment / allow (user settings, keep "$defaults"); /auto-mode-setup
Session unexpectedly starts in auto mode It’s the interactive default; set permissions.defaultMode or cycle with Shift+Tab

API and usage errors#

You see Meaning Do
API Error: 500 Server error (already retried) Retry; check status.claude.com
Repeated 529 Overloaded errors API at capacity — not your quota Wait a few minutes; consider --fallback-model
429 / “temporarily limiting requests” Rate limited Wait; reduce parallel agents
“You’ve hit your session limit” Plan usage limit /rate-limit-options: wait and auto-continue, usage credits, or upgrade
“Credit balance is too low” API account out of credit Top up in the Console
model not found / no access Model not available on your plan or provider /model to pick an available one; check availableModels
Invalid API key, 401 Wrong or expired credential Fix the key or apiKeyHelper; /login
“The response above may be incomplete” Stream broke mid-response; not retried automatically because a resend could repeat a tool call Check what completed, then ask Claude to continue

Claude Code retries transient failures up to 10 times with exponential backoff before showing an error.

Performance and stability#

Symptom Fix
High CPU or memory /compact; restart between big tasks; .gitignore build folders; claude --safe-mode to rule out plugins, MCP, hooks
“Critical memory usage” (heap > 2.5 GB) Restart and claude --continue; /heapdump writes diagnostics — share only the -diagnostics.json, never the .heapsnapshot (it contains your conversation and credentials)
Autocompact is thrashing A file or output refills the window: read in chunks, /compact keep only the plan and the diff, move the work to a sub-agent, or /clear; check /context for what loads at start
Hangs or freezes Ctrl+C; if stuck, close the terminal and claude --resume
Slow, expensive long sessions /clear between tasks; /usage to see where it goes

Search, terminal and environment#

Symptom Fix
Search, @file, agents or skills not found Bundled ripgrep can’t run: install ripgrep and set USE_BUILTIN_RIPGREP=0; claude doctor shows which one is used
Few search results on WSL Project on /mnt/c — move it under /home, or search more specifically
Garbled text in VS Code/Cursor terminal /terminal-setup (GPU renderer setting)
Shift+Enter doesn’t add a newline /terminal-setup, or \ + Enter
Display broken Ctrl+L to redraw; /tui default for the classic renderer
pbcopy/xclip fail with sandbox on Ask Claude to print the text, then /copy
/copy over SSH doesn’t reach your clipboard Terminal must support OSC 52 (enable it in iTerm2), or hold the native-selection key, or CLAUDE_CODE_DISABLE_MOUSE=1
Corporate proxy HTTPS_PROXY, custom CA, and allowlist Anthropic domains — see network configuration

Getting help#

  1. /doctor, then /mcp for server status.
  2. Ask Claude — it can read its own documentation (“why isn’t my hook firing?”).
  3. /feedback to report to Anthropic; search the GitHub issues.
  4. Account or billing: claude.ai (or platform.claude.com) → initials → Get help.

Common mistakes#

Review questions#

A hook works for a teammate but not for you. What do you check first? /hooks to see if it loaded, then workspace trust for the folder, then the matcher’s case and spelling with claude --debug.

The problem disappears with claude --safe-mode. What next? The cause is one of your customisations; re-enable them one at a time (CLAUDE.md, skills, plugins, hooks, MCP) until it returns.

Does a 529 error count against your usage limit? No — it means the API is at capacity; wait and retry.

References#