Claude Code not working: a diagnostic order that finds it

Most Claude Code problems are one of six things. Checking them in the right order finds the answer in about two minutes instead of an afternoon of reinstalling.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Run claude doctor first: it reports install health, PATH, duplicate installations, invalid settings files, and credential state in one command. Then check version, authentication with /status, configuration with /context and /doctor, and network reachability. If the cause is still not obvious, relaunch with claude --safe-mode, which disables every customization at once. Reinstalling is almost never the fix and destroys the evidence that would have told you what was wrong.

What you need to know
  • claude doctor first, always. It answers three of the six.
  • --safe-mode disables every customization in one flag. Use it to bisect.
  • ~/.claude.json and ~/.claude/settings.json are different files. This trips up everyone.
  • One invalid entry can make Claude Code reject an entire settings file.
  • /status tells you which credential is actually billing.
  • Do not reinstall first. It destroys the evidence.

The order

Two minutes, top to bottom. Stop at the first check that says something surprising.

From the shell, before you start a session.
# 1. install health, PATH, duplicate installs, settings validity, credentials
claude doctor

# 2. version - the bug may already be fixed
claude --version

# 3. which binary is actually running, and are there several?
which -a claude

# 4. is your config even valid JSON?
jq . ~/.claude/settings.json
jq . .claude/settings.json
jq . .claude/settings.local.json

# 5. can you reach the API at all?
curl -I https://api.anthropic.com
Then inside a session.
/doctor        # setup checkup, proposes fixes it applies after you confirm
/status        # active settings sources, and which credential is billing
/context       # what actually loaded: memory, skills, MCP tools, subagents
/mcp           # server connection status
/hooks         # hooks registered for this session
/permissions   # the allow and deny rules actually in effect

Symptom to cause

SymptomLikely causeFix
command not foundPATH, or a moved Node prefixSee the dedicated guide
Starts, then exits immediatelyAuth failure/login; check ANTHROPIC_API_KEY
Asks to log in every launchCredential store not writablemacOS: unlock the login keychain
Billed per token on a subscriptionANTHROPIC_API_KEY is setunset it and delete the export
403 Forbidden after loginSubscription inactive, or missing Console roleCheck claude.ai settings, or ask an admin
Settings have no effectWrong file, or a schema error/status, then claude doctor
Hooks never fireMatcher is an array, or lowercaseSingle string, "Edit|Write", capitalized
MCP server missingFailed to start, or awaiting approval/mcp, then claude --debug=mcp
Skill never appearsFile is name.md, not name/SKILL.mdUse a folder with SKILL.md inside
Very slow, or high memoryHuge context, or an extension/context, then --safe-mode
Forgets things mid-sessionThe window filled and compacted/compact deliberately, or /clear
Cannot see files it shouldLaunched from the wrong directoryStart at the repo root, or /add-dir
Search misses files that existBundled ripgrep will not runInstall ripgrep, set USE_BUILTIN_RIPGREP=0
Boxes or smeared glyphs in an IDE terminalGPU renderer/terminal-setup
Errors on every requestService incidentstatus.claude.com
Worked yesterday, not todayAuto-updateclaude --version, then check the changelog

Configuration that silently does nothing

This is the category that wastes the most time, because there is no error. You wrote the rule, Claude Code read a different file, and nothing tells you.

The four traps worth memorising.

You didWhat happened
Put permissions, hooks, or env in ~/.claude.jsonThat file holds app state and UI toggles. Those keys belong in ~/.claude/settings.json.
Set a key in settings.json that is also in settings.local.jsonsettings.local.json wins. Both beat ~/.claude/settings.json.
Wrote a hook matcher as an arraySchema error. Claude Code rejects the whole file, so every other hook in it stops too.
Wrote a matcher as "bash"Matching is case-sensitive. Tool names are Bash, Edit, Write, Read.
Confirm what loaded, rather than what you wrote.
# valid JSON?
jq . ~/.claude/settings.json && echo OK

# which sources are active, including any managed policy
#   (inside a session)
/status

# did the memory file, skills and MCP tools actually load?
/context

Isolate it: safe mode, then a clean config

When the cause is not obvious, stop reading files and bisect. Two commands cover the whole surface.

01

Disable every customization at once

claude --safe-mode

Safe mode launches with CLAUDE.md, skills, plugins, hooks, MCP servers, and custom commands and agents all disabled. Authentication, model selection, built-in tools, and permissions work normally. If the problem disappears, one of those surfaces is the cause and the targeted checks above will find which.

02

If it persists, bypass your configuration entirely

cd /tmp && CLAUDE_CONFIG_DIR=/tmp/claude-clean claude

This session loads nothing from ~/.claude and, because /tmp has no .claude folder, no project configuration either. Expect first-run setup screens; seeing them confirms the clean directory is in effect. On Linux and Windows you will be asked to log in again, since credentials live under the config directory. On macOS they come from the Keychain and carry over.

03

Reintroduce one thing at a time

Copy files into the temporary directory one by one, or launch from your project again, until the problem returns. That is your culprit. If the problem survives even the clean session, the cause is outside your user and project configuration: check managed settings with /status, then environment variables.

Slow, hung, or eating memory

  1. Run /compact. Most "Claude Code got slow" reports are a context window that has been growing for hours.
  2. Add large build directories to .gitignore so they stop being walked.
  3. Restart between major tasks. claude --resume in the same directory picks the conversation back up, so nothing is lost.
  4. Relaunch with claude --safe-mode. If memory drops, a plugin, MCP server, or hook is responsible.
  5. If memory stays high, run /heapdump. It writes a heap snapshot and a -diagnostics.json breakdown to your Desktop and prints a summary.

One error worth recognising by name: Autocompact is thrashing: the context refilled to the limit.... Compaction succeeded and a file or tool output immediately refilled the window several times in a row, so Claude Code stopped retrying. Ask for a line range instead of a whole file, run /compact with a focus that drops the large output, move the work to a subagent, or /clear.

Things that look like bugs and are not

  • It cannot see a file outside the launch directory. That is working-directory scope, and it is a feature. Use --add-dir, /add-dir, or /cd.
  • A subdirectory CLAUDE.md seems ignored. Those load on demand, when Claude reads a file in that directory with the Read tool, not at session start.
  • The Explore and Plan agents ignore CLAUDE.md. By design. Restate the instruction in your delegating prompt.
  • It forgot a decision from earlier. The window filled and older material was compacted. Compact deliberately at task boundaries instead.
  • It refused an action. A deny rule matched, or a PreToolUse hook exited 2. Both are the system working.
  • Permission prompts stopped appearing. Check the mode. Shift+Tab cycles them and is easy to hit by accident.
  • A large table is cut off in the terminal. Tables over 200 rows render the first 200 with a "more rows not shown" line. The full table is still in the conversation.

When to actually reinstall

Almost never, and only after the checks above. If you do, your configuration and history live outside the package and survive it.

# these survive a reinstall, deliberately
#   ~/.claude/         settings, memory, sessions, commands, skills
#   ~/.claude.json     app state and per-project MCP entries

# remove duplicates first, then install the native binary
npm uninstall -g @anthropic-ai/claude-code
rm -rf ~/.claude/local
curl -fsSL https://claude.ai/install.sh | bash
claude doctor

Questions people ask

Run claude doctor from your shell. It reports install health, PATH, duplicate installations, invalid settings files, and credential state in one read-only command, which covers three of the six common causes without starting a session.

claude doctor runs from the shell and prints read-only diagnostics, so it works when Claude Code will not start. /doctor runs inside a session and goes further: it flags invalid settings, duplicate subagent names, unused extensions, and redundant CLAUDE.md content, and proposes fixes it applies only after you confirm.

Three usual causes. The keys are in ~/.claude.json, which holds app state, instead of ~/.claude/settings.json. A closer scope such as settings.local.json overrides them. Or a schema error, like a hook matcher written as an array, made Claude Code reject the entire file. Run /status and claude doctor to see which.

Launch with claude --safe-mode, which disables CLAUDE.md, skills, plugins, hooks, MCP servers, and custom commands and agents in one flag while leaving auth, models, tools, and permissions working. If the problem disappears, bisect from there.

The credential store is not persisting. On macOS this is usually a locked login keychain: run claude doctor to check Keychain access, then security unlock-keychain ~/Library/Keychains/login.keychain-db. Also check that your system clock is accurate, since token validation depends on it.

It is scoped to the directory you launched it from. Start at the repository root, add another directory with --add-dir or /add-dir, or relocate the session with /cd, which also loads the new directory CLAUDE.md.

The bundled ripgrep binary may not run on your system. Install your platform ripgrep package, then set USE_BUILTIN_RIPGREP to 0 in your environment or the env block of settings.json, and confirm with claude doctor that the Search line shows your system path.

Almost never, and not first: reinstalling destroys the evidence that would have told you what was wrong. Work through doctor, version, auth, configuration, network, and safe mode. If you do reinstall, remove duplicate installs first and use the native installer.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code: debug your configuration
  2. Claude Code troubleshooting
  3. Claude Code settings reference
  4. Anthropic status
Try it

Fewer moving
parts.

Continuum launches agents with resolved paths and an explicit environment, removing a whole class of environment failures.

free app · your subscriptions · local-first