Run diagnostics first
Before investigating a specific issue, run/doctor inside Claude Code. The doctor screen checks your environment automatically and reports problems with authentication, Node version compatibility, network connectivity, and configuration files.
/doctor reports a problem, follow the suggested fix before continuing.
Common issues
Claude Code won't start
Claude Code won't start
claude command fails immediately, shows an error on launch, or the terminal hangs.Steps to resolve:Check your Node version
nvm or fnm.Verify the binary is on your PATH
PATH:Run /doctor
Authentication failed
Authentication failed
Re-run the login flow
Check your API key directly
Check for environment variable conflicts
ANTHROPIC_API_KEY environment variable in your shell overrides stored credentials. Run echo $ANTHROPIC_API_KEY to see if one is set. Unset it or update it to the correct value.Permission denied errors
Permission denied errors
Check file system permissions
chmod or chown.Review Claude Code permission rules
/permissions to see active allow and deny rules. A deny rule for the path you are working in will block file access even if the OS allows it.Check for sudo requirements
/etc, /usr) require elevated privileges. Claude Code does not run as root. Move your project to a directory your user owns, or adjust the directory permissions.Claude is not responding
Claude is not responding
Check your internet connection
Check Anthropic API status
Interrupt and retry
Ctrl+C to interrupt the current request and try again. If Claude is stuck mid-tool-call, this will abort the operation and return you to the prompt.Restart the session
/clear to reset the conversation, or exit with /exit and relaunch. This clears any stale state that may be blocking responses.MCP server not connecting
MCP server not connecting
/mcp shows the server as disconnected, or Claude reports it cannot find a specific MCP tool.Steps to resolve:Verify the server process is running
Check your MCP configuration
/mcp to review the configured servers. Confirm the transport type, command, and arguments match what the server expects. Common issues include incorrect paths, missing environment variables, or wrong port numbers.Restart Claude Code
/exit and relaunch for the changes to take effect.Check the server logs
Out of context / token limit reached
Out of context / token limit reached
Run /compact
Start a new session
/clear to start fresh. If you have important context you want to carry forward, describe it briefly in the first message of the new session.Switch to a model with a larger context window
/model to switch to a model that supports a larger context window. Claude Opus and Claude Sonnet models support up to 200K tokens.Wrong model being used
Wrong model being used
/model to see the currently active model and switch to a different one:/config.High API costs
High API costs
Check your current session cost
/cost to see a breakdown of token usage and estimated cost for the current session.Use /compact to reduce token usage
/compact regularly to summarize and shrink the conversation. This is the single most effective way to reduce costs during a long session.Switch to a faster, cheaper model
/model and select a smaller model (e.g., Claude Haiku) for tasks that do not require high capability. Reserve larger models for complex reasoning tasks.Monitor usage over time
/usage to see aggregate usage across recent sessions. This helps you identify which types of tasks consume the most tokens.IDE integration not working
IDE integration not working
Install the IDE extension
- VS Code: Search for “Claude Code” in the Extensions panel
- JetBrains: Search for “Claude Code” in the Plugins marketplace
Use /desktop to hand off to the desktop app
Restart both the IDE and Claude Code
Log files
Claude Code writes diagnostic logs you can inspect when the above steps do not resolve a problem. Log files are stored in your Claude configuration directory:ERROR lines to identify what went wrong.
Getting help
Submit feedback
/feedback inside Claude Code to open the feedback form. Include steps to reproduce the issue and the relevant log output.GitHub issues
/doctor.