Uninstall Claude Code
Overview
Completely removes Claude Code from the system, including the npm package and all associated configuration and cache files.
Quick Start
Run the uninstallation script:
bash scripts/uninstall.sh
The script will:
- Uninstall the
@anthropic-ai/claude-codenpm package - Uninstall related router packages (
@musistudio/claude-code-router,claude-code-router) - Stop running
claude-code-routerprocesses - Remove all configuration files (
.claude/,.claude.json, backups) - Remove
~/.claude-code-routerand router plugin/log files - Delete cache directories (
~/Library/Caches/claude-cli-nodejs/,~/Library/Caches/claude-code-router/, Linux fallback cache paths) - Remove VSCode extensions (
~/.vscode/extensions/anthropic.claude-code-*) - Verify the uninstallation
Manual Uninstallation
If you prefer to uninstall manually or need to customize the process:
Step 1: Uninstall npm package
npm uninstall -g @anthropic-ai/claude-code
npm uninstall -g @musistudio/claude-code-router claude-code-router
Step 2: Remove configuration and cache
rm -rf ~/.claude ~/.claude.json ~/.claude.json.backup.* \
~/.claude-code-router ~/.claude-code-router.pid \
~/Library/Caches/claude-cli-nodejs ~/Library/Caches/claude-code-router \
~/.cache/claude-cli-nodejs ~/.local/share/claude \
~/Library/Logs/claude-code-router \
~/.cache/claude-code-router ~/.local/share/claude-code-router ~/.config/claude-code-router \
~/.vscode/extensions/anthropic.claude-code-*
Step 3: Verify removal
which claude # Should return "claude not found"
find ~ -maxdepth 3 -name "*claude*" # Check for remaining files
What Gets Removed
npm Package:
@anthropic-ai/claude-code(installed via npm)@musistudio/claude-code-router/claude-code-router(if installed)
Configuration files:
~/.claude/- Configuration directory~/.claude.json- Main configuration file~/.claude.json.backup.*- Configuration backups~/.claude-code-router/- Router config/log/plugin directory~/.claude-code-router.pid- Router pid file
Cache directories:
~/Library/Caches/claude-cli-nodejs/- Application cache (macOS)~/.cache/claude-cli-nodejs/- Application cache (Linux)~/.local/share/claude/- Application data (Linux)~/Library/Caches/claude-code-router/- Router cache (macOS)~/Library/Logs/claude-code-router/- Router logs (macOS)~/.cache/claude-code-router/- Router cache (Linux)~/.local/share/claude-code-router/- Router data (Linux)~/.config/claude-code-router/- Router config (Linux)
VSCode extensions:
~/.vscode/extensions/anthropic.claude-code-*- All versions of the extension
Platform Notes
macOS: The script is designed for macOS. Cache location is ~/Library/Caches/.
Linux: The script also removes ~/.cache/claude-cli-nodejs/, ~/.local/share/claude/, and router cache/config paths.
Windows: Use PowerShell equivalent and update paths to Windows conventions (%APPDATA%, %LOCALAPPDATA%).