Official Docs Breakdown: Troubleshooting
hippo: Running into issues with Claude Code is inevitable—failed installs, broken logins, non-working search, or an IDE that refuses to connect. Think of this post as a quick-reference triage manual distilled from the official troubleshooting guide. Check here first whenever something breaks.
1. What Is This Feature?
The Troubleshooting page is Claude Code’s official guide to diagnosing and fixing common problems across installation, authentication, performance, IDE integration, Markdown formatting, and more.
Its workflow is straightforward: diagnose first (/doctor) → check common issues → file a bug report. /doctor is Claude Code’s built-in health check tool. It automatically inspects your installation type, version, search functionality, auto-update status, invalid config files, MCP server errors, context usage warnings, and more. In most cases, a single /doctor run pinpoints the root cause immediately.
2. Official Docs Breakdown
2.1 Installation Issues: Native Install vs. npm Install
Anthropic now strongly recommends Native Installation—a standalone setup with zero npm/Node.js dependency. A single command handles everything, automatically detecting your OS and CPU architecture:
1 | # Native install on macOS / Linux / WSL |
1 | # Native install on Windows PowerShell |
If you previously installed via npm, Claude Code ships a built-in migration command that switches you to a local native install (no sudo required):
1 | claude /migrate |
Side-by-side comparison of both installation methods:
| Dimension | Native Install | npm Install |
|---|---|---|
| Dependencies | None (self-contained) | Requires Node.js 18+ |
| Install command | curl ... | bash |
npm install -g @anthropic-ai/claude-code |
| Permissions | User-level, no sudo | May require sudo |
| Updates | Automatic | Manual npm update |
| Official recommendation | Recommended | Supported, not preferred |
WSL pitfalls: WSL brings its own class of install failures—wrong OS detection, Node not found, and nvm version conflicts. The root cause is that WSL imports the Windows PATH by default, letting Windows nvm/npm binaries shadow Linux ones. Make sure nvm is loaded explicitly in your shell profile:
1 | # Add to ~/.bashrc or ~/.zshrc |
After reloading your shell, run which npm—it should resolve to a Linux path under /usr/, not a Windows mount under /mnt/c/.
2.2 Permissions and Authentication
Repeated permission prompts: If you find yourself approving the same commands over and over, use /permissions to configure auto-allowed tools. For example, if your project runs hexo frequently, add an allow rule in /permissions so Claude Code executes it without prompting every time.
Authentication issues: Follow this sequence when login breaks—run /logout, exit Claude Code, then relaunch and sign in again. If the browser fails to open automatically, press c to copy the OAuth URL to your clipboard and paste it manually.
If none of that works, delete the auth file to force a clean login from scratch:
1 | rm -rf ~/.claude/auth.json |
Relaunching claude after removing auth.json triggers the full authentication flow.
If you hit 403 Forbidden after signing in, check by account type: Claude Pro/Max users should verify their subscription status at claude.ai/settings; Console users must confirm their account has been assigned the "Claude Code" or "Developer" role.
2.3 Performance and Stability
High CPU / memory usage: Extended sessions can gradually consume more memory and become sluggish. Three habits help keep resource usage in check: run /compact periodically to trim context, restart between major tasks, and add node_modules/ and build artifact directories to .gitignore to keep them out of indexing.
Search not working: This is a frequent issue. Claude Code’s search functionality, @file references, custom agents, and custom slash commands all rely on ripgrep. If search misbehaves, install system-wide ripgrep and point Claude Code to it:
1 | # Install ripgrep on each platform |
1 | # Tell Claude Code to use system ripgrep instead of the bundled binary |
Slow search in WSL: Working on repositories stored under /mnt/c/ suffers from cross-filesystem I/O overhead. The simplest fix is to move your projects onto the Linux filesystem (under /home/) instead of a Windows-mounted directory.
Markdown formatting issues: Claude Code occasionally outputs fenced code blocks without language tags (``` instead of ```bash). Explicitly request "properly formatted markdown with language-tagged code blocks", document the rule in CLAUDE.md, or configure post-processing hooks to fix untagged blocks automatically.
2.4 IDE Integration Issues
JetBrains IDE not detected on WSL2: This typically happens under WSL2’s default NAT networking mode, where Linux and Windows cannot reach each other cleanly. You have two options:
Option 1: Configure Windows Firewall to allow traffic from the WSL2 subnet (run from an elevated PowerShell session).
Option 2: Switch to mirrored networking by creating or editing .wslconfig in your Windows user profile directory:
1 | [wsl2] |
Save the file and run wsl --shutdown to restart WSL. In mirrored mode, WSL and Windows share a network stack, which resolves most connectivity issues automatically.
ESC key not working in the JetBrains terminal: This is a shortcut conflict. Open Settings → Tools → Terminal and uncheck "Move focus to the editor with Escape", or remove the "Switch focus to Editor" binding in keymap settings.
When reporting a Windows IDE integration issue, include the following details:
| Field | Details |
|---|---|
| Environment type | Native Windows (Git Bash) or WSL1/WSL2 |
| WSL networking mode | NAT or mirrored (WSL users only) |
| IDE name and version | e.g., IntelliJ IDEA 2024.1 |
| Claude Code extension version | Found in IDE plugin settings |
| Shell type | Bash, Zsh, PowerShell, etc. |
3. Hippo’s Field Notes
hippo: Real-world pitfalls from my own usage:
3.1 Networking: Essential Proxy Setup in Mainland China
When using Claude Code from mainland China, networking is the first hurdle. Even the install command (curl -fsSL https://claude.ai/install.sh | bash) can fail to connect, and day-to-day API requests require a stable proxy.
I set the proxy environment variables directly in my shell profile:
1 | # Add to ~/.zshrc or ~/.bashrc |
This routes both installation and daily CLI requests through the proxy. Adjust the URL if your proxy requires authentication or listens on a different port.
3.2 Corporate TLS Certificate Troubleshooting
On a corporate network, I ran into TLS handshake failures with the error unable to get local issuer certificate. The company ran a TLS-inspecting proxy using an internal self-signed CA that Node.js does not trust by default.
The fix is to point NODE_EXTRA_CA_CERTS at your corporate CA certificate bundle:
1 | export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem |
To obtain the CA certificate, ask corporate IT or export it from your browser: open Browser Settings → Certificate Management → locate the corporate root certificate → export as PEM.
3.3 Diagnosing with /doctor in Practice
At one point, search stopped working out of nowhere and @file references began failing. Running /doctor pinpointed the issue immediately: the bundled ripgrep binary was corrupted—it had been accidentally overwritten during a system upgrade. Installing system-wide ripgrep and exporting USE_BUILTIN_RIPGREP=0 fixed everything.
Recommendation: Run /doctor first whenever anything acts up. It checks your installation type and version, search functionality, auto-update status, invalid settings files, MCP server misconfigurations, context usage warnings, and more—saving hours of manual guesswork.
4. FAQ
Q: Can native installation and npm installation coexist?
A: Not recommended. If you previously installed via npm, uninstall it first with npm uninstall -g @anthropic-ai/claude-code, then run the native installer—or migrate directly with claude /migrate.
Q: What if installation gets Killed in WSL?
A: The Linux OOM killer terminated the process due to insufficient memory (Claude Code requires at least 4 GB of RAM). Add swap space and retry:
1 | sudo fallocate -l 2G /swapfile |
Q: Where are the config files located, and how do I reset them?
A: User-global settings live in ~/.claude/settings.json, project-level settings in .claude/settings.json, and global state (OAuth, MCP, etc.) in ~/.claude.json. To reset authentication, run rm -rf ~/.claude/auth.json; to wipe all configuration, run rm -rf ~/.claude/ (use with caution).
5. Summary
When something breaks, run /doctor first—it automatically diagnoses most common failures. Prefer native installation for setup issues, install system ripgrep when search breaks, use /permissions to eliminate repetitive prompts, and delete auth.json to reset stubborn auth states. If you’re still stuck, report it with /bug.
Series Navigation
- Index: Claude Code Complete Guide · Series Index
- Previous: Official Docs Breakdown: Enterprise Deployment Overview
- Next: Official Docs Breakdown: CLI Reference
Based on the official Troubleshooting - Claude Code Docs.
Last updated: 2026-03-31





