Guide de résolution des problèmes courants.
Total: 16 problèmes documentés
API
API key not recognized
Sévérité: 🔴 Critical
Symptôme: Error: Invalid API key or authentication failed
Cause: Missing or incorrect ANTHROPIC_API_KEY environment variable
Solution:
- Generate API key from console.anthropic.com
- Set environment variable: export ANTHROPIC_API_KEY="sk-ant-..."
- Add to ~/.bashrc or ~/.zshrc for persistence
- Restart terminal or source config file
Commande de correction:
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrcContext
Context window overflow
Sévérité: 🟡 Medium
Symptôme: Error: Context limit exceeded, conversation too long
Cause: Too many files loaded, large CLAUDE.md, or lengthy conversation history
Solution:
- Use /compact to compress history
- Use /context stats to check usage
- Add patterns to .claudeignore
- Split large CLAUDE.md into .claude/rules/
- Clear conversation with /clear
Commande de correction:
/compact
/context stats
/clearGit
Git operations failing in Claude
Sévérité: 🟡 Medium
Symptôme: Git push/pull/merge commands error or get stuck
Cause: Merge conflicts, detached HEAD, or uncommitted changes blocking operations
Solution:
- Check git status manually
- Resolve conflicts outside Claude first
- Ensure clean working directory
- Use claude commit for commits
- Handle complex git operations manually
- Review permissions for .git directory
Commande de correction:
git status
git stash
claude commitHooks
Hook not triggering
Sévérité: 🟡 Medium
Symptôme: Hook script exists but never executes
Cause: Incorrect matcher pattern, missing execute permissions, or wrong settings.json structure
Solution:
- Verify hook script has execute permissions (chmod +x)
- Check matcher pattern in settings.json
- Test hook event is actually firing
- Review hook JSON structure
- Check hook output with verbose logging
- Verify hook location (user vs project)
Commande de correction:
chmod +x ~/.claude/hooks/my-hook.sh
# Check settings.json structureInstallation
Installation fails on macOS/Linux
Sévérité: 🟠 High
Symptôme: curl command fails or installation script errors
Cause: Network issues, permissions, or incompatible shell
Solution:
- Check internet connection
- Run with sudo if needed
- Verify bash/zsh compatibility
- Try manual download from GitHub releases
Commande de correction:
curl -fsSL https://claude.ai/install.sh | bashCommand 'claude' not found
Sévérité: 🟠 High
Symptôme: bash: claude: command not found or zsh: command not found: claude
Cause: Command not found in PATH, incomplete installation, or shell profile not loaded
Solution:
- Restart terminal after installation
- Source shell config: source ~/.bashrc or source ~/.zshrc
- Check PATH: echo $PATH
- Reinstall Claude Code
- Verify installation location: which claude
- Add to PATH manually if needed
Commande de correction:
source ~/.bashrc
# Or
source ~/.zshrc
# Check installation:
which claudeLSP
LSP server not starting
Sévérité: 🟡 Medium
Symptôme: No diagnostics, goToDefinition fails, hover not working
Cause: Missing .lsp.json config, LSP server not installed, or incorrect command path
Solution:
- Install LSP server (e.g., npm install -g @vtsls/language-server)
- Create .lsp.json at plugin root
- Verify command path and args
- Check extensionToLanguage mappings
- Restart Claude Code
Commande de correction:
npm install -g @vtsls/language-server
# Create .lsp.json with proper configMCP
MCP server connection failed
Sévérité: 🟠 High
Symptôme: MCP tools not available, OAuth fails, connection timeout
Cause: Server not configured, invalid URL, network issues, or missing authentication
Solution:
- Use /mcp to check server status
- Verify URL and transport type (http/sse/stdio)
- Check OAuth authentication
- Test network connectivity
- Review .mcp.json configuration
- Use claude mcp list to view servers
Commande de correction:
/mcp
claude mcp list
claude mcp get `<server-name>`Memory
CLAUDE.md not being loaded
Sévérité: 🟡 Medium
Symptôme: Claude doesn't follow instructions from CLAUDE.md
Cause: File in wrong location, incorrect filename, or not in current directory hierarchy
Solution:
- Use /memory to check loaded files
- Verify filename: CLAUDE.md (exact case)
- Check file location: project root or .claude/
- For local overrides: CLAUDE.local.md
- Review .claude/rules/ structure
- Restart Claude Code session
Commande de correction:
/memory
# Check file exists at correct pathModes
Cannot switch to Plan Mode
Sévérité: 🟢 Low
Symptôme: Shift+Tab doesn't work or stuck in Normal/Auto mode
Cause: Not pressing Shift+Tab or incorrect mode sequence
Solution:
- Use Shift+Tab to cycle: Normal → Auto → Plan → Normal
- Check terminal keybinding support
- Use --permission-mode plan CLI flag as alternative
- Verify status indicator at bottom of terminal
- Run /terminal-setup for iTerm2/VS Code
- Restart Claude Code if stuck
Commande de correction:
claude --permission-mode plan
Shift+Tab (press twice from Normal mode)Network
Cannot connect to Anthropic API
Sévérité: 🟠 High
Symptôme: Connection timeout, network errors, or SSL certificate issues
Cause: Corporate firewall, proxy settings, or network restrictions blocking claude.ai/anthropic.com
Solution:
- Check internet connectivity
- Configure proxy if behind corporate firewall
- Set HTTP_PROXY and HTTPS_PROXY environment variables
- Check firewall rules for anthropic.com
- Try different network connection
- Contact IT for API access permissions
Commande de correction:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080Performance
Claude Code running very slowly
Sévérité: 🟡 Medium
Symptôme: Long delays between responses, slow file operations
Cause: Large files in context, too many file reads, or inefficient CLAUDE.md
Solution:
- Use .claudeignore to exclude large files/directories
- Reduce CLAUDE.md size, split into .claude/rules/
- Clear conversation history with /clear
- Use /compact to reduce context
- Avoid loading unnecessary files
- Check network latency if using remote models
Commande de correction:
/compact
/clear
# Add to .claudeignore: node_modules/, dist/, *.logPermissions
Permission denied on file operations
Sévérité: 🟠 High
Symptôme: Claude cannot write/edit files, permission errors
Cause: File permissions, write access restricted, or blocked by settings.json
Solution:
- Check file/directory permissions
- Review .claude/settings.json deny rules
- Use /permissions to audit configuration
- Add file patterns to allow list
- Verify additionalDirectories setting
Commande de correction:
/permissions
chmod u+w filename.txtSkills
Skill not being invoked
Sévérité: 🟡 Medium
Symptôme: Skill exists but Claude never uses it
Cause: Poor description field in SKILL.md, missing trigger keywords, or file not in correct location
Solution:
- Improve description with specific trigger terms
- Verify SKILL.md location: ~/.claude/skills/ or .claude/skills/
- Check YAML frontmatter: name and description required
- Keep SKILL.md body under 500 lines
- Test with explicit mention in prompt
- Restart Claude Code session
Commande de correction:
# Explicitly mention skill in prompt:
"Use the [skill-name] skill to process this PDF"Sub-Agents
Sub-agent not invoking automatically
Sévérité: 🟡 Medium
Symptôme: Sub-agent exists but Claude never calls it
Cause: Poor description field, missing/vague trigger keywords, or incorrect agent file location
Solution:
- Improve description with specific trigger terms
- Add clear use-case keywords
- Verify file location: ~/.claude/agents/ or .claude/agents/
- Check YAML frontmatter format
- Test with explicit invocation first
- Review name field uniqueness
Commande de correction:
# Use explicit invocation to test:
"Use the [agent-name] subagent to analyze this"Thinking
Ultrathink not working as expected
Sévérité: 🟢 Low
Symptôme: No visible extended thinking, or thinking budget not increasing
Cause: MAX_THINKING_TOKENS set but ultrathink keyword used, or conflicting configurations
Solution:
- Check if MAX_THINKING_TOKENS is set (overrides ultrathink)
- Unset MAX_THINKING_TOKENS if using ultrathink keyword
- Use /config to enable extended thinking
- Verify with Ctrl+O to see thinking output
- Remember: ultrathink only works without MAX_THINKING_TOKENS
- Use explicit keywords: 'ultrathink' or 'think harder'
Commande de correction:
unset MAX_THINKING_TOKENS
/config
Ctrl+O