Troubleshooting guide for Claude Code problems. Authentication errors, slow responses, context issues, and solutions for common bugs.
Claude Code Not Working? Common Issues and Fixes
Claude Code is powerful but not perfect. Here's how to fix the most common problems.
Authentication Issues
Error: "Not authenticated" or "Invalid token"
Symptoms:
- Claude Code won't start
- Error message about authentication
- Prompted to log in repeatedly
Fixes:
- Re-authenticate:
claude logout
claude login
Check subscription:
Ensure your Claude Pro subscription is active at claude.ai.
Clear credentials:
rm -rf ~/.claude
claude
- Check network:
Ensure you can reach api.anthropic.com.
Error: "Subscription required"
Cause: You need Claude Pro ($20/month) to use Claude Code.
Fix: Subscribe at claude.ai.
Connection Issues
Error: "Network error" or "Connection failed"
Symptoms:
- Timeouts during responses
- Partial responses cut off
- "Network error" messages
Fixes:
- Check internet connection:
ping api.anthropic.com
Try a different network:
Some corporate networks block API calls.
Disable VPN:
Some VPNs interfere with API connections.
Wait and retry:
Sometimes Anthropic's servers are busy. Wait a few minutes.
Slow Responses
Symptoms:
- Long delays before responses
- Responses take 30+ seconds
Causes:
- Large context (big codebase)
- Complex queries
- Server load
Fixes:
- Reduce context:
/compact
Be more specific:
Instead of asking about the whole project, focus on specific files.
Use ignore file:
Create .claudeignore to exclude large directories:
node_modules/
dist/
.git/
*.log
- Try off-peak hours:
Evenings and weekends can be slower.
Context Issues
Error: "Context too long"
Symptoms:
- Error about context length
- Claude Code refuses to process
Fixes:
- Compact the conversation:
/compact
- Start fresh:
/clear
- Ignore large files:
Add to
.claudeignore:
*.min.js
*.bundle.js
large-data-file.json
- Focus on specific files:
/add src/specific-file.ts
Instead of loading everything.
Claude Code Doesn't See Files
Symptoms:
- "File not found" errors
- Claude Code doesn't know about files that exist
Fixes:
- Check working directory:
pwd
Make sure you started Claude Code in the right folder.
- Explicitly add files:
/add path/to/file.ts
Check .claudeignore:
Your file might be ignored.
Check permissions:
ls -la path/to/file.ts
File Editing Issues
Changes Not Applied
Symptoms:
- Said "yes" but file unchanged
- Partial changes applied
Fixes:
- Check file permissions:
ls -la filename
chmod 644 filename # if needed
- Ensure edit mode:
/edit
Check for locks:
Make sure no other program has the file open.
Manual review:
Open the file in your editor and verify content.
Wrong File Edited
Symptoms:
- Claude Code edited the wrong file
- Changes in unexpected location
Fixes:
- Be explicit:
Edit src/components/Button.tsx (not the test file)
- Use full paths:
Modify /Users/me/project/src/specific-file.ts
- Confirm before applying:
Always review the diff before saying "yes".
Performance Issues
High CPU/Memory Usage
Symptoms:
- Computer slows down
- Claude Code using excessive resources
Fixes:
- Ignore large directories:
# .claudeignore
node_modules/
.git/
*.log
- Close and restart:
Ctrl+C
claude
- Limit context:
Only add files you're actively working with.
Hanging/Freezing
Symptoms:
- No response for 2+ minutes
- UI appears frozen
Fixes:
- Cancel and retry:
Ctrl+C
Then try a simpler prompt.
Break up the task:
Instead of one complex prompt, use multiple smaller ones.
Restart Claude Code:
exit
claude
Code Quality Issues
Bad Code Suggestions
Symptoms:
- Code doesn't work
- Wrong patterns used
- Missing error handling
Fixes:
- Provide more context:
We use TypeScript strict mode.
Our error handling uses a custom AppError class.
Follow the patterns in src/services/UserService.ts.
- Be specific about requirements:
Add input validation that:
- Checks email format with regex
- Validates password has 8+ chars, 1 number, 1 uppercase
- Returns specific error messages for each failure
- Ask for explanation:
Explain your approach before implementing.
- Request alternatives:
Show me 2-3 different ways to implement this
with pros and cons for each.
Outdated Patterns
Symptoms:
- Using old syntax
- Deprecated APIs
- Old library versions
Fixes:
- Specify versions:
We're using Next.js 14 with App Router.
Use React 18 patterns with Server Components.
- Reference documentation:
Follow the latest React Query v5 patterns.
- Provide examples:
Use the same pattern as our existing UserService.
Installation Issues
npm Install Fails
Error:
npm ERR! code EACCES
Fix:
sudo npm install -g @anthropic-ai/claude-code
Or fix npm permissions:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
Command Not Found
Error:
claude: command not found
Fixes:
- Check installation:
npm list -g @anthropic-ai/claude-code
- Check PATH:
echo $PATH
Ensure npm global bin directory is included.
- Reinstall:
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code
Getting Help
Check Version
claude --version
View Logs
cat ~/.claude/logs/latest.log
Community Support
Contact Support
For billing issues or account problems:
support@anthropic.com
Quick Fixes Summary
| Problem |
Quick Fix |
| Not authenticated |
claude logout && claude login |
| Slow responses |
/compact or simplify prompt |
| Context too long |
/clear or add .claudeignore |
| File not found |
Check directory, use /add |
| Changes not applied |
Check permissions, use /edit |
| Hanging |
Ctrl+C and retry simpler prompt |
| Command not found |
Reinstall via npm |
Most issues are solved by:
- Restarting Claude Code
- Being more specific
- Reducing context size
- Re-authenticating
Need help with Claude Code or AI development tools? Cedar Operations provides support and training. Book a consultation →
Related reading: