Authentication & Login Problems
- Run
claude auth logoutto clear cached tokens - Run
claude auth login— a browser tab will open for OAuth - Complete the consent screen; credentials are stored in
~/.claude/ - If browser doesn't open, copy the URL from terminal and paste manually
- Go to console.anthropic.com → API Keys and confirm the key is active
- Create a new key if the old one was compromised or expired
- Export cleanly:
export ANTHROPIC_API_KEY="sk-ant-your-key-here" - Verify:
echo $ANTHROPIC_API_KEY | head -c 10— should showsk-ant-api
- Set proxy:
export HTTPS_PROXY=http://proxy.company.com:8080 - Or use
ANTHROPIC_BASE_URLto point to an internal gateway - Ask IT to whitelist
api.anthropic.comon port 443 - Test connectivity:
curl -I https://api.anthropic.com
Slow Performance & Timeouts
- Run
/compactto compress conversation history — biggest single fix - Create
.claudeignoreto excludenode_modules/,dist/,.git/,*.lock - Check status.anthropic.com for API incidents
- If rate limited, wait 60s or upgrade your usage tier
.claudeignore example: node_modules/ dist/ build/ .next/ *.lock *.log coverage/ .git/
- Break large tasks into smaller chunks (ask Claude to plan first, then execute step by step)
- For very large codebases, run Claude from a sub-directory rather than the repo root
- Set
CLAUDE_TIMEOUT_MS=120000(2 min) for slower connections
Context Window & Memory Errors
- Run
/compactimmediately — Claude will summarize the conversation so far - Use
/clearto start a brand new session if/compactisn't enough - Break work into focused sessions: one session per feature/bug
- Don't paste entire files into the chat — let Claude read them with tools
- Put persistent instructions in
CLAUDE.mdat the project root — Claude always loads this - Use
/compactperiodically to keep the important context fresh - See the CLAUDE.md memory guide for structuring persistent instructions
VSCode Extension Issues
- Press Ctrl+Shift+P → "Developer: Reload Window"
- Check Extensions panel: verify Claude Code is installed and enabled
- Update CLI:
npm update -g @anthropic-ai/claude-code - Open VSCode's Output panel and select "Claude Code" from the dropdown for error details
- Enable: Settings → Extensions → Claude Code → Enable Inline Suggestions
- If Copilot is installed, pause it temporarily — both can conflict for the same keybinding
- Try the keyboard shortcut
Ctrl+K(Win/Linux) orCmd+K(Mac) to trigger Claude manually
- Install globally:
npm install -g @anthropic-ai/claude-code - Verify:
which claude— should return a path - If VSCode uses a different PATH, set Settings → Claude Code → CLI Path to the absolute path
- Restart VSCode after installing — extensions don't pick up PATH changes in the current session
MCP (Model Context Protocol) Issues
- Run the MCP server manually in a terminal to see its startup errors
- Validate your
~/.claude/mcp.jsonwithcat ~/.claude/mcp.json | python3 -m json.tool - Check that
node≥ v18 is on your PATH:node --version - Try
claude mcp listto see registered servers and their status
- Run Claude with
--debugto see raw MCP request/response logs - Check the server's
argsinmcp.json— missing env vars are the most common cause - See the full MCP setup guide for per-server configuration
Git & Permission Errors
- Approve git commands when prompted, or use
--dangerously-skip-permissionsin trusted environments - Add git to your project's allowed commands in
CLAUDE.md:# Allowed: git add, git commit, git push - Check
claude settingsfor current permission level
- Check permissions:
ls -lain the target directory - Fix ownership:
sudo chown -R $USER:$USER . - Never run Claude as root — it will warn you and refuse certain operations
Frequently Asked Questions
Claude Code installed but the `claude` command is not found
Your shell's PATH doesn't include npm's global bin directory. Run npm config get prefix to find the npm prefix, then add <prefix>/bin to your PATH in ~/.bashrc or ~/.zshrc.
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc source ~/.zshrc which claude # should now return a path
How do I completely reset Claude Code?
To clear all state: rm -rf ~/.claude/ then re-authenticate with claude auth login. This removes all conversations, settings, and credentials — use as a last resort.
Claude Code is producing different results than before
Claude's responses are non-deterministic by design. For consistent results: pin exact instructions in CLAUDE.md, use specific task descriptions rather than vague ones, and break complex tasks into smaller deterministic steps.
How do I report a Claude Code bug?
File issues at github.com/anthropics/claude-code/issues. Include: claude --version output, OS version, the exact command or prompt that failed, and the error message. For security issues use Anthropic's responsible disclosure process instead.
Claude Code says I'm out of credits — what do I do?
Go to console.anthropic.com → Billing and add credits or upgrade your plan. Claude Code uses the same API credits as direct API calls. There's no separate "Claude Code" billing — it all comes from your Anthropic account balance.
Still Stuck?
These resources help when the above fixes don't resolve your issue:
- status.anthropic.com — check for API outages before assuming a local issue
- GitHub Issues — search for your error; many issues have existing fixes in the comments
- Anthropic Discord — #claude-code channel for community help
- Claude Code best practices — avoid the issues before they happen
- Installation guide — verify your setup is correct from the start