
To **uninstall Claude Code completely**, you must remove the executable binary according to your original installation method and delete the persistent configuration directories in your user profile. For native standalone installations on macOS and Linux, delete ~/.local/bin/claude and remove ~/.local/share/claude; on Windows PowerShell, remove $env:USERPROFILE\.local\bin\claude.exe and $env:USERPROFILE\.local\share\claude. If you installed the CLI via a package manager, run the corresponding command such as npm uninstall -g @anthropic-ai/claude-code, brew uninstall --cask claude-code, or winget uninstall Anthropic.ClaudeCode. To achieve a true complete purge, you must also delete the global configuration folder ~/.claude and the credentials file ~/.claude.json.
Standard package removal leaves authentication tokens, prompt histories, tool authorization lists, and local project state intact on your disk. Whether you are troubleshooting a corrupted installation, preparing a clean environment to update Claude Code, or removing the software entirely, this step-by-step guide covers every uninstallation method across macOS, Linux, WSL, and Windows.
## Overview: Uninstallation Commands by Installation Method
Review the uninstallation commands and file locations across operating systems:
| Installation Method | Operating System | Binary Removal Command | State Directory Location |
|---|---|---|---|
| Native Script | macOS / Linux / WSL | rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude |
~/.claude, ~/.claude.json |
| Native Script | Windows PowerShell | Remove-Item "$env:USERPROFILE\.local\bin\claude.exe" -Force |
$env:USERPROFILE\.claude |
| Homebrew | macOS | brew uninstall --cask claude-code |
~/.claude |
| WinGet | Windows | winget uninstall Anthropic.ClaudeCode |
$env:USERPROFILE\.claude |
| APT / DNF / APK | Debian, Fedora, Alpine | sudo apt remove claude-code (or dnf / apk) |
~/.claude |
| Global npm | Cross-platform | npm uninstall -g @anthropic-ai/claude-code |
~/.claude |
## Prerequisites and Pre-Uninstallation Steps
Before running file deletion commands, complete three essential preparatory checks:
### 1. Close Active Sessions and Background Daemons
Claude Code holds active file handles while running. Close any terminal tabs running claude. Terminate lingering background processes:
# On Linux / macOS
killall claude 2>/dev/null || pkill -f claude
# On Windows PowerShell
Get-Process -Name claude -ErrorAction SilentlyContinue | Stop-Process -Force
### 2. Identify Your Installation Source
If you are unsure how Claude Code was originally installed, check the binary path:
which claude
# Or on Windows PowerShell:
Get-Command claude
If the path points to ~/.local/bin/claude or ~/.local/share/claude/, you are using Anthropic’s native installer script. If it points to an npm directory, it was installed via npm. Running claude doctor also outputs the active launcher type.
### 3. Uninstall IDE Extensions and Desktop Integrations
The official Claude Code VS Code extension, JetBrains plugin, and Claude Desktop app share the ~/.claude/ configuration directory. If you delete ~/.claude/ while an IDE plugin is still enabled, it will recreate the folder automatically on startup. Uninstall the extension from VS Code or JetBrains before proceeding.
## Method 1: Uninstall Native Standalone Installation
The standalone native installer is Anthropic’s recommended installation format, placing binaries and symlinks directly in user space.
### On macOS, Linux, and WSL
Delete the executable binary and all downloaded version directories:
# Remove the launcher symlink
rm -f ~/.local/bin/claude
# Remove downloaded version binaries and cache
rm -rf ~/.local/share/claude
The native installer downloads binaries into ~/.local/share/claude/versions/ and manages ~/.local/bin/claude as a launcher symlink. Removing both directories completely eliminates the application files.
### On Windows (PowerShell)
For users running native Windows without WSL (as outlined in our guide on Claude Code on Windows), open PowerShell and run:
# Remove the launcher executable
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force -ErrorAction SilentlyContinue
# Remove all version binaries and cache
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force -ErrorAction SilentlyContinue
If you installed via Windows CMD using install.cmd, these PowerShell commands remove the identical files.
## Method 2: Uninstall Global npm Package
If you installed Claude Code as a global Node.js package, remove it using npm:
npm uninstall -g @anthropic-ai/claude-code
### Verifying npm Path Cleanliness
If npm uninstalls successfully but claude --version still responds, check your global prefix:
npm root -g
If you use Node version managers (such as nvm), run the uninstall command across active Node versions or delete the orphaned symlink in $(npm config get prefix)/bin/claude.
## Method 3: Uninstall via Homebrew, WinGet, and Linux Package Managers
For systems managed by OS package managers, use the standard package removal tools.
### macOS Homebrew
Run the uninstallation command for your installed cask:
# Stable channel cask:
brew uninstall --cask claude-code
# Latest channel cask:
brew uninstall --cask claude-code@latest
brew cleanup
### Windows Package Manager (WinGet)
In PowerShell or Windows Terminal, execute:
winget uninstall Anthropic.ClaudeCode
Ensure all terminal tabs and editors are closed so Windows can release file locks on claude.exe.
### Linux Package Managers (APT, DNF, APK)
Remove both the package and the registered repository:
**Debian and Ubuntu (APT):**
sudo apt remove claude-code
sudo rm -f /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
sudo apt update
**Fedora and RHEL (DNF):**
sudo dnf remove claude-code
sudo rm -f /etc/yum.repos.d/claude-code.repo
**Alpine Linux (APK):**
apk del claude-code
sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories
rm -f /etc/apk/keys/claude-code.rsa.pub
apk update
## Step-by-Step: Removing All Configuration Files and State
To completely uninstall Claude Code, deleting the binary is only half the task. Anthropic stores user preferences, cached sessions, API tokens, and Model Context Protocol configurations in separate locations.
### 1. Delete Global User Configuration and Auth Tokens
Claude Code stores global state in two locations:
– ~/.claude/: Contains settings.json, custom skill workflows, telemetry logs, and auto-memory.
– ~/.claude.json: Contains active session authentication keys and OAuth tokens.
**On macOS, Linux, and WSL:**
rm -rf ~/.claude
rm -f ~/.claude.json
**On Windows PowerShell:**
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force -ErrorAction SilentlyContinue
### 2. Remove Project-Level Configuration and Memory
In repositories where you ran Claude Code, local project files may exist:
– .claude/: Project-specific settings and sub-agent logs.
– .mcp.json: Model Context Protocol server definitions.
Navigate to your project repository and remove them:
**On macOS / Linux / WSL:**
cd /path/to/your-project
rm -rf .claude
rm -f .mcp.json
**On Windows PowerShell:**
Set-Location -Path "C:\path\to\your-project"
Remove-Item -Path ".claude" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path ".mcp.json" -Force -ErrorAction SilentlyContinue
If you previously set up custom routing proxies, such as a Claude Code Router to redirect requests to third-party models, remove any reverse-proxy configurations.
### 3. Clear Environment Variables
Check your shell profiles (~/.bashrc, ~/.zshrc, or Windows Environment Variables) for variables such as ANTHROPIC_API_KEY, CLAUDE_CODE_GIT_BASH_PATH, or DISABLE_AUTOUPDATER. Delete lines referencing Claude Code.
## Verifying Complete Removal
Confirm that all traces have been purged. Open a **brand new** terminal session and run:
claude --version
### Expected Output
Your shell should output:
# On Bash / Zsh:
command not found: claude
# On Windows PowerShell:
claude : The term 'claude' is not recognized as the name of a cmdlet, function, script file, or operable program.
Confirm the binary cannot be resolved along your $PATH:
# macOS / Linux
which claude
# Windows PowerShell
Get-Command claude -ErrorAction SilentlyContinue
If both commands return nothing, the uninstallation is complete.
## Troubleshooting Common Uninstallation Issues
| Issue Symptom | Root Cause | Resolution |
|---|---|---|
| Claude command still works after uninstallation | Dual installation (both npm and native installer present) or shell command hashing. | Run which -a claude (or where.exe claude on Windows). Delete any additional binaries listed, then run hash -r in Bash/Zsh to reset the shell cache. |
| ~/.claude folder reappears after deletion | VS Code extension, JetBrains plugin, or Claude Desktop background service is running. | Disable and uninstall the extension inside VS Code / JetBrains. Terminate Claude Desktop before deleting ~/.claude. |
| Permission Denied (EACCES) during npm uninstall | npm global directory was originally installed with root privileges. | Reclaim ownership with sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}, then rerun npm uninstall. |
### Handling Lingering Shell Aliases
If which claude returns an alias instead of a path, check your shell configuration:
alias claude
If defined, remove the alias line from ~/.bashrc or ~/.zshrc and run unalias claude.
## Frequently Asked Questions (FAQ)
### How do I uninstall Claude Code without losing my custom prompts and CLAUDE.md files?
Remove the binary using your platform’s uninstallation command (rm -f ~/.local/bin/claude or npm uninstall -g @anthropic-ai/claude-code), but leave ~/.claude/settings.json and repository CLAUDE.md files in place. Claude Code will detect your existing configuration if you reinstall later.
### Does uninstalling Claude Code revoke my Anthropic API key or cancel my subscription?
No. Deleting local binaries only clears the local session stored on your computer. Your Anthropic Console API keys, Pro/Team subscriptions, and cloud-stored project data remain active in your Anthropic account at console.anthropic.com or claude.ai.
### How do I switch from the npm installation to the native standalone installer?
First, uninstall the npm package by running npm uninstall -g @anthropic-ai/claude-code. Next, verify that claude --version is no longer recognized. Finally, run Anthropic’s recommended installer script: curl -fsSL https://claude.ai/install.sh | bash on macOS/Linux/WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell.
## Summary
To uninstall Claude Code completely, target both the binary executable and persistent configuration files. Remove the binary according to how it was installed—via native script cleanup commands, global npm uninstall, or system package managers like Homebrew and WinGet. Then, remove ~/.claude and ~/.claude.json to purge authentication tokens, tool approvals, and telemetry data. Finally, restart your terminal and verify with claude --version that the command is no longer found.
Hi, I’m Mark, the author of Clever IT Solutions: Mastering Technology for Success. I am passionate about empowering individuals to navigate the ever-changing world of information technology. With years of experience in the industry, I have honed my skills and knowledge to share with you. At Clever IT Solutions, we are dedicated to teaching you how to tackle any IT challenge, helping you stay ahead in today’s digital world. From troubleshooting common issues to mastering complex technologies, I am here to guide you every step of the way. Join me on this journey as we unlock the secrets to IT success.


