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).
Windows: running scripts is disabled on this system
Windows PowerShell blocks .ps1 files by default (execution policy Restricted), and typing claude in PowerShell goes through npm's claude.ps1 shim. Open PowerShell and run once:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedThen open a new terminal. (Our install script is not affected — it calls npm through cmd to sidestep this.)
Windows: EBUSY: resource busy or locked
Claude Code is running (another terminal, or VS Code), so npm cannot overwrite claude.exe. The current script detects this case: it skips the upgrade and still updates your settings — you can keep working right away. To upgrade the CLI itself, close every window running claude and re-run the install command.
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.