Claude Code not working? Fixes for common errors
Claude Code errors and their fixes, checked against Anthropic's docs on Nov 20, 2026: command not found, login loops, usage and rate limits, model not available, MCP server failed to connect, constant permission prompts and failed updates.
Last checked: 2026-11-20, against Anthropic's Claude Code docs: Troubleshoot installation and login, the Error reference, Debug your configuration, Connect to MCP servers and Configure permissions. The newest release in the Claude Code changelog that day was 2.1.329 (November 19, 2026). Error messages are quoted from the docs, sometimes shortened with "..."; older versions word some of them differently.
Start every fix the same way: type /doctor inside Claude Code for an automated check of your install, settings, extensions and context use, or run claude doctor in your shell if claude will not start at all. Then find your message below.
Claude Code: command not found after install
The install directory is not on your PATH. The native installer puts claude at ~/.local/bin/claude on macOS and Linux, or %USERPROFILE%\.local\bin\claude.exe on Windows, and it does not change PATH itself. Check the file exists, then add the folder for your shell (Zsh shown; use ~/.bashrc for Bash on Linux):
ls -la ~/.local/bin/claude
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc- The installer warns about this under Setup notes with the line "Native installation exists but ~/.local/bin is not in your PATH".
- If you only installed the VS Code extension, there is no claude command: the extension bundles a private copy of the CLI and does not add it to PATH. Run the standalone installer to get one.
- On Windows, if 'claude' is not recognized right after an update, the troubleshooting page has a separate fix that restores claude.exe from its backup.
Claude Code keeps asking me to log in
Run /login, and if the prompt keeps coming back, check that your system clock is correct, because token validation depends on accurate timestamps. When the cause is unclear, Anthropic's suggested reset is: /logout, close Claude Code, start claude and log in again.
- macOS: Claude Code stores the login in the login Keychain. If the Keychain rejects the write, for example when it is locked in an SSH session, the login falls back to the plaintext file ~/.claude/.credentials.json; never share or commit that file. claude doctor shows a warning that starts with "macOS Keychain is not writable"; unlock it with security unlock-keychain ~/Library/Keychains/login.keychain-db, then /logout and /login. Logging out also removes saved MCP server logins and plugin secrets.
- SSH, WSL 2 or a container: press c to copy the login URL, sign in in a browser on your own machine, and paste the code it shows at the "Paste code here" prompt. If pasting does nothing, claude auth login reads the code from standard input.
- "OAuth error: Invalid code. Please make sure the full code was copied" means the code expired or was cut off; "That doesn't look like the full code" means copy all of it, including the # in the middle.
- Before v2.1.211, waking the machine from sleep could log every open session out at once; update if you are older.
Logged in but every request fails: 403, 401 or "organization has been disabled"
Run /status to see which credential is actually in use. The most common cause is an old ANTHROPIC_API_KEY in your environment that overrides your Claude subscription once you have approved it, and that is always used in -p mode.
- "This organization has been disabled" with an active subscription: unset ANTHROPIC_API_KEY, remove the export line from ~/.zshrc, ~/.bashrc or ~/.profile (on Windows, your PowerShell $PROFILE and user environment variables), and restart claude.
- "API Error: 403 Request not allowed": check that your Pro, Max or Ultra subscription is active at claude.ai/settings. Console users need the Claude Code or Developer role; a corporate proxy can also cause it.
- "API Error: 401 Invalid authentication credentials": if /status shows an API key row, rotate or unset the key; if it shows only your login, run /login once.
"You've hit your session limit": what to do
Wait for the reset time printed in the message, or switch model if the message names a model family. Session and weekly limits are shared across all models, so switching does not help there; the Opus and Sonnet limits apply only to that family, so /model to a model outside it keeps you working.
- /usage shows your plan limits and when each resets. /usage-credits buys extra usage on Pro, Max and Ultra, or sends a request to your admin on Team and Enterprise.
- Since v2.1.234, an interactive session signed in with a claude.ai subscription can wait and continue the interrupted task shortly after the reset. The setting is "Continue automatically at usage limit" in /config.
- "API Error: Server is temporarily limiting requests (not your usage limit)" is a short server-side throttle, not your quota. Since v2.1.199 Claude Code retries it automatically.
- "Request rejected (429)" is the rate limit of an API key, Bedrock project or Google Cloud project. Check /status for a stray key, and run fewer parallel subagents.
- "Repeated 529 Overloaded errors" means the API is at capacity for everyone. It does not count against your quota; check status.claude.com or switch model, since capacity is tracked per model.
Our usage limits guide covers the session and weekly limits in more detail.
"There's an issue with the selected model" or model not available
Run /model and pick a model your account can use, and prefer an alias such as sonnet or opus over a full versioned ID, because aliases resolve to a maintained default and do not go stale. In -p mode, pass --model or set ANTHROPIC_MODEL instead.
- If the wrong model keeps coming back, a stale ID is set somewhere. Check the places you can set a model, in the priority order the model configuration page gives, and remove the stale value.
- "Claude Opus is not available with the Claude Pro plan": choose a model your plan includes. If you upgraded recently, run /logout and then /login, because the stored token reflects the plan you had when you signed in.
- "Claude Code 2.1.x does not support this model; version ... or newer is required": run claude update. On the stable channel, claude update may not reach the required version; switch to the latest channel or ask your admin if the channel is pinned.
- "Model ... is restricted by your organization's settings": an admin disabled the model in the claude.ai admin console, or managed settings exclude it through an availableModels allowlist or a deniedModels list. The notice names the model the session uses instead.
MCP server failed to connect
Check the server's status with /mcp in a session or claude mcp list in your shell. Since v2.1.219, claude mcp list and claude mcp get <name> print the HTTP status or error code and the server's own error text next to "Failed to connect", which often names the problem directly, such as a missing header or a rejected token.
claude mcp list
claude mcp get <name>
MCP_TIMEOUT=60000 claude # 60-second startup timeout- Remote (HTTP) server: run curl -I against its URL. A 404 or 405 means the server is up, since many endpoints only answer POST; 401 or 403 means you need to authenticate; no answer means a wrong URL or a network problem.
- Local (stdio) server: run the configured command yourself, for example npx -y @playwright/mcp@latest. If it errors, the message names what is missing; if the command differs from claude mcp get, you probably left out the -- separator when adding it.
- Timed out at startup: the default startup timeout is 30 seconds, and a first npx download can be slower. Raise it with MCP_TIMEOUT as shown above.
- No servers listed: Claude Code reads ~/.claude.json and <project>/.mcp.json, with servers under the mcpServers key. It does not read ~/.claude/mcp.json, .claude/.mcp.json or an mcpServers key in settings.json.
- Project servers from .mcp.json need a one-time approval, for security reasons. If you dismissed it, run claude mcp reset-project-choices and restart, and approve only servers you trust. Edits to .mcp.json apply only after a restart.
- A server that connects but lists no tools usually lacks an environment variable such as an API key; pass it with --env KEY=value.
Claude Code asks permission for every command
You are most likely in Manual mode, which prompts before most file edits, shell commands and network requests. Since v2.1.283, interactive terminal and VS Code sessions start in auto mode by default; claude -p, the Agent SDK and sessions where auto mode is off or unavailable start in Manual, as does a session whose flag or defaultMode setting picks it. To stop repeat prompts, pick "Yes, and don't ask again", add allow rules with /permissions, or switch modes.
"Don't ask again" for a shell command or a web domain is saved to .claude/settings.local.json at the root of the git repository; approval for file edits lasts only until the session ends. Rules are checked deny first, then ask, then allow, so an allow rule cannot override a matching deny. Our example settings file, adapted from the permissions docs, lets Claude run your npm scripts and git commits without asking and refuses commands that begin with git push:
{
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git commit *)"],
"deny": ["Bash(git push *)"]
}
}A rule matches the command text, so git -C . push slips past this deny rule; it is not a guarantee. Allow npm run * only where you trust the scripts, and put the * after the subcommand: Bash(git *) would allow every git command. Of the other modes, acceptEdits accepts file edits and common file commands such as mkdir, mv and cp inside the working directory; auto lets a classifier model review actions instead of you; bypassPermissions is meant only for isolated containers or VMs, and even there deny rules block and explicit ask rules prompt. Shift+Tab cycles modes in the CLI.
Claude Code update failed
Run claude update in your shell. The red "Auto-update failed · Run claude doctor" footer means a background update did not install; claude doctor only records the date, while claude update prints the real error.
- "The connection dropped while downloading the update": Claude Code already tried three times. Run claude update again, set HTTPS_PROXY if your network needs a proxy. "Download timed out: exceeded the total deadline" means the download ran past 10 minutes; retry on a faster network.
- "Release verification failed for Claude Code": nothing was installed and your current version keeps working. If the reason starts with sidecar_fetch_, run the command again; otherwise try later.
- claude update hangs after "Checking for updates": before v2.1.214, a directory at a shell config path such as ~/.zshrc caused this. Move it aside, or rerun the install script.
- Homebrew, WinGet, apt, dnf and apk installs do not auto-update by default. Use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode or your package manager's upgrade command.
Claude Code freezes or says "Autocompact is thrashing"
For a hang, press Ctrl+C; if that does nothing, close the terminal and run claude --resume in the same folder, which brings the conversation back. "Autocompact is thrashing" means a large file or tool output refilled the context right after each compaction: have Claude read the file in smaller pieces, run /compact with a focus, or /clear.
Where to report a Claude Code bug
Use /feedback inside Claude Code, or check github.com/anthropics/claude-code for known issues. For install problems, the install page asks you to open an issue with your operating system, the install command you ran and the full error output. Account problems such as a subscription that is not recognized go to Anthropic support: sign in at claude.ai, click your initials in the lower left and choose Get help.
Frequently asked questions
- How do I check which Claude Code version I have? Run claude --version. The newest release on November 20, 2026 was 2.1.329; our version history lists every release.
- Why does Claude ignore an MCP server in my settings.json? settings.json has no mcpServers key. Put project servers in .mcp.json at the repository root, or use claude mcp add --scope user.
- Can a CLAUDE.md line stop Claude from running a command? No. CLAUDE.md is guidance; permission rules and hooks are what Claude Code enforces.
Related on claudefox
- How to install Claude Code on Mac, Windows and Linux
- Claude Code usage limits explained: 5-hour and weekly caps
- Claude Code version history and changelog (Nov 2026)
- Best Claude Code MCP servers and skills (Nov 2026): 25 picks by job
- Claude Code hooks and subagents: a practical guide
Source: Troubleshoot installation and login (Claude Code docs), Error reference (Claude Code docs), Troubleshooting (Claude Code docs), Debug your configuration (Claude Code docs), Connect to MCP servers (Claude Code docs), Connect Claude Code to tools via MCP (Claude Code docs), Configure permissions (Claude Code docs), Advanced setup: updates and release channels (Claude Code docs), Choose a permission mode (Claude Code docs), Claude Code changelog