AI Perks curates and provides access to exclusive discounts, credits, and deals on AI tools, cloud services, and APIs to help startups and developers save money.

How to Uninstall Claude Code: The Complete Process
To completely uninstall Claude Code, run npm uninstall -g @anthropic-ai/claude-code in your terminal, then delete the config directory at ~/.claude. This removes the binary, your auth tokens, custom commands, agents, and command history.
If you're switching to a different AI coding tool but still need Claude API access, AI Perks keeps you connected to $1,000-$25,000+ in free Anthropic credits that work with any tool - Cursor, Windsurf, custom apps, or your next setup.
Save your budget on AI Credits
| Software | Approx Credits | Approval Index | Actions | |
|---|---|---|---|---|
Promote your SaaS
Reach 90,000+ founders globally looking for tools like yours
Why Developers Uninstall Claude Code
There are several common reasons:
- Switching tools - Moving to Cursor, Windsurf, Codex, or another coding assistant
- Reinstalling fresh - Fixing a broken installation with a clean slate
- Free up disk space - Removing unused global npm packages
- Privacy concerns - Wiping all locally stored auth tokens and history
- Multi-machine cleanup - Removing from machines you no longer use
Whatever your reason, the uninstall process is the same. And if you ever come back, reinstalling takes one command.
AI Perks curates and provides access to exclusive discounts, credits, and deals on AI tools, cloud services, and APIs to help startups and developers save money.

Step 1: Uninstall the Claude Code Package
Open your terminal and run:
npm uninstall -g @anthropic-ai/claude-code
This removes the global npm package and the claude command from your PATH. The uninstall takes about 5 seconds.
Verify it worked:
claude --version
If you see command not found: claude, the uninstall succeeded. If the version still prints, you may have multiple installations - jump to the troubleshooting section.
Step 2: Remove Claude Code Config and Data
The npm uninstall removes the binary, but config files, auth tokens, custom commands, and history persist in your home directory. To completely wipe Claude Code:
macOS / Linux
rm -rf ~/.claude
rm -rf ~/.claude.json
Windows (PowerShell)
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude"
Remove-Item -Force "$env:USERPROFILE\.claude.json"
What Lives in ~/.claude?
| File / Folder | Contents |
|---|---|
settings.json | Permissions, hooks, environment variables |
agents/ | Custom subagent definitions |
commands/ | Custom slash commands |
skills/ | Skill definitions |
projects/ | Per-project session history and memory |
auth/ | API keys and OAuth tokens |
mcp.json | MCP server configurations |
Before deleting, consider backing up ~/.claude if you want to restore your setup later:
cp -r ~/.claude ~/claude-backup-$(date +%Y%m%d)
Step 3: Remove Auth Tokens (Optional but Recommended)
Claude Code stores OAuth tokens in your system keychain. To fully revoke them:
macOS
security delete-generic-password -s "claude-code"
Linux
secret-tool clear service claude-code
Windows
Open Credential Manager > Windows Credentials > delete any entries containing "claude-code" or "anthropic".
You can also revoke API keys directly from your Anthropic Console.
Step 4: Clean Up Shell Aliases and PATH Entries
If you added custom Claude Code aliases or PATH entries to your shell config, remove them:
Bash
Edit ~/.bashrc and ~/.bash_profile:
nano ~/.bashrc
Look for and remove any lines like:
alias cc="claude"
export CLAUDE_API_KEY="..."
export PATH="$PATH:/path/to/claude"
Zsh
Edit ~/.zshrc:
nano ~/.zshrc
Remove the same kinds of lines.
Fish
Edit ~/.config/fish/config.fish:
nano ~/.config/fish/config.fish
Reload your shell after editing:
source ~/.zshrc # or ~/.bashrc, etc
Troubleshooting Uninstall Issues
Issue: "claude" command still works after uninstall
You probably have multiple installations. Check all npm prefixes:
which claude
which -a claude # Lists all matches
For each path returned, uninstall manually:
npm uninstall -g @anthropic-ai/claude-code --prefix /path/to/install
Issue: Permission denied during uninstall
Add sudo (macOS/Linux) or run PowerShell as Administrator (Windows):
sudo npm uninstall -g @anthropic-ai/claude-code
Issue: Can't delete ~/.claude folder
Some files may be locked by a running Claude Code process. Kill any active processes first:
pkill -f claude
Then retry the deletion.
Issue: Uninstall worked but Claude still appears in npm list
Clear npm cache and rebuild the registry:
npm cache clean --force
npm list -g --depth=0
What to Do With Your Anthropic API Credits After Uninstalling
Here's something developers miss: uninstalling Claude Code doesn't cancel your Anthropic API credits. Your Anthropic account, API keys, and credit balance all remain active.
You can still use those credits with:
- Cursor - Add your Anthropic API key in settings
- Windsurf - Configure Claude as your model provider
- Cline / Roo Code - Use Anthropic API directly
- Custom apps - Any code that calls the Anthropic SDK
- Claude Desktop - Browser-free Claude chat
- Claude.ai web - Same account, different interface
If you have free Anthropic credits from AI Perks, they keep working across all of these tools. Credits are tied to your Anthropic account, not the Claude Code CLI.
Free Anthropic Credits Work With Any AI Coding Tool
Most developers don't realize they can stack $1,000-$25,000+ in free Claude API credits through programs that work with whatever tool they switch to next:
| Credit Program | Available Credits | How to Get |
|---|---|---|
| Anthropic Claude (Direct) | $1,000 - $25,000 | AI Perks Guide |
| AWS Activate (Bedrock - Claude) | $1,000 - $100,000 | AI Perks Guide |
| Google Cloud Vertex (Claude) | $1,000 - $25,000 | AI Perks Guide |
| Microsoft Founders Hub | $500 - $1,000 | AI Perks Guide |
| VC Partner Programs | $1,000 - $5,000 | AI Perks Guide |
Total potential: $4,500 - $156,000+ in free Claude credits
Whether you're switching to Cursor, building your own coding agent, or just keeping Claude as a backup model, AI Perks keeps your AI bill at zero.
Step-by-Step: Clean Uninstall + Keep Your Credits
Step 1: Save Your Anthropic API Key
Before wiping ~/.claude, copy your API key from ~/.claude/auth/ or from the Anthropic Console. You'll want this for any future tool.
Step 2: Uninstall Claude Code
npm uninstall -g @anthropic-ai/claude-code
Step 3: Remove Config and Data
rm -rf ~/.claude ~/.claude.json
Step 4: Clean Shell Configs
Remove aliases and exports from ~/.zshrc, ~/.bashrc.
Step 5: Keep Your Free Credits Active
Subscribe to AI Perks to maintain access to free Anthropic credit programs that work with any tool you use next.
Frequently Asked Questions
Does uninstalling Claude Code cancel my Claude Pro or Max subscription?
No. Subscriptions are billed through your Anthropic account, not the CLI. To cancel Pro or Max, log into claude.ai and manage your subscription in account settings. The CLI uninstall only removes the local tool.
Will I lose my Claude Code custom commands and agents?
Yes, if you delete ~/.claude. Back up the folder first if you want to keep your custom commands, agents, skills, and MCP server configs. You can restore them by copying the backup back to ~/.claude after reinstalling.
Can I reinstall Claude Code after uninstalling?
Yes. Just run npm install -g @anthropic-ai/claude-code@latest and authenticate again. Your Anthropic credits and account remain active. With free credits from AI Perks, you can rebuild your setup at zero cost.
How do I uninstall Claude Code on Windows specifically?
Open PowerShell as Administrator and run npm uninstall -g @anthropic-ai/claude-code. Then delete %USERPROFILE%\.claude and %USERPROFILE%\.claude.json folders. Check Credential Manager for stored Anthropic tokens.
Does uninstalling Claude Code delete my chat history?
Local session history in ~/.claude/projects/ is deleted if you remove the config folder. Cloud-synced history (if enabled) remains in your Anthropic account. Web chats at claude.ai are completely separate and unaffected.
What's the difference between claude uninstall and npm uninstall?
There is no built-in claude uninstall command. Use npm uninstall -g @anthropic-ai/claude-code to remove the package globally. The npm command is the official supported method.
Should I uninstall Claude Code if I'm switching to Cursor?
Not necessarily. Many developers run both. Cursor uses Claude as a model option and works alongside the CLI. If disk space and clutter aren't issues, you can keep both installed and use whichever fits the task. Free Anthropic credits via AI Perks work with both tools.
Switching Tools? Keep Your Free Credits Active
Uninstalling Claude Code doesn't mean giving up Claude. AI Perks ensures you keep access to $1,000-$25,000+ in free Anthropic credits that power Claude in any tool - Cursor, Windsurf, your own apps, or whatever you use next.
- Step-by-step credit application guides
- Stacking strategies for $50,000+ runway
- 200+ additional startup perks beyond AI credits
- Credit programs that follow you across tools
Uninstall Claude Code in 2 commands. Keep your free Anthropic credits forever at getaiperks.com.