Claude Code
Troubleshooting
Fixes for common problems installing and running Claude Code
claude: command not found after installing
npm finished installing, but your current terminal hasn't reloaded PATH. Open a new terminal and try again.
If it still fails, check that npm's global bin directory is on your PATH:
npm config get prefix
# that directory + /bin must be on $PATHEACCES: permission denied during npm install
See the detailed fix on the Codex troubleshooting page — it's identical (change the npm prefix or use nvm).
Wrong or expired key (401 / unauthorized)
- Open
~/.claude/settings.jsonand check theANTHROPIC_AUTH_TOKENvalue is your key - To switch keys, re-run the install command with the new key — old settings are backed up automatically
Claude Code isn't using the model I expect
Check in settings.json:
"model": "default"— Claude Code picks the model from theANTHROPIC_DEFAULT_*_MODELvariables- During a session, type
/modelto view and switch the active model
Long tasks get cut off
The default configuration sets API_TIMEOUT_MS = 3000000 (50 minutes). If you've hand-edited your settings before, re-run the install command to restore the standard configuration.
Restoring old settings
ls ~/.claude/*.bak.*
# restore by copying back, e.g.
cp ~/.claude/settings.json.bak.20260811120000 ~/.claude/settings.jsonStill stuck?
Contact support with a screenshot of the error — see the channels on Getting started.