Skip to content
AI

How to Uninstall Claude Code: The Clean Removal I Actually Run

Last updated: July 2026. Reflects the native-installer era (Claude Code 2.1.x) and the npm path Anthropic now treats as legacy.

TL;DR

First figure out how you installed Claude Code, because the uninstall command depends on it. Native installer: rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude. Homebrew: brew uninstall --cask claude-code. WinGet: winget uninstall Anthropic.ClaudeCode. npm: npm uninstall -g @anthropic-ai/claude-code. None of those touch your config. To wipe settings, MCP servers, auth tokens and session history, also delete ~/.claude, ~/.claude.json, and any project-local .claude/ and .mcp.json. If claude still runs after all that, you have a second install or an old shell alias.

Why the uninstall is harder than it should be

Claude Code is not one thing you delete. It is a binary, a config directory, a JSON file at your home root, a per-project .claude folder, an MCP file, maybe a VS Code extension, maybe a JetBrains plugin, and maybe the Claude Desktop app, all writing into the same ~/.claude. The docs describe a clean removal in ninety seconds. My reality was that I ran npm uninstall -g @anthropic-ai/claude-code, typed claude, and the CLI still launched. A shell alias from an old install script. Twenty minutes I did not budget.

The other trap is the January 2026 migration. Anthropic moved from npm to a standalone native installer around v2.1.15. If you first installed Claude Code before that, you probably ran npm install -g. If you followed the “migrate” instructions, you now have the native binary at ~/.local/bin/claude and the old npm shim somewhere in your PATH. Uninstalling one and leaving the other is the single most common way people end up with a “how is this still running?” problem.

This post is the checklist I run on my own machines. Nothing here is a trick. It is just the boring surface area you have to sweep.

Step 1: figure out how you installed it

Before you delete anything, ask the shell where it thinks claude lives. On macOS, Linux, or WSL:

which claude
# common answers:
# /Users/you/.local/bin/claude          -> native installer
# /opt/homebrew/bin/claude              -> Homebrew (Apple silicon)
# /usr/local/bin/claude                 -> Homebrew (Intel) or apt/dnf
# /Users/you/.nvm/versions/node/.../bin/claude   -> npm global
# /usr/local/bin/claude (symlink)       -> npm via system Node

On Windows PowerShell:

where.exe claude

If you see more than one path, that is your answer for why the last uninstall attempt did not stick. Handle each install separately, in the sections below.

You can also ask Claude Code itself. Run claude doctor. It tells you the install method it detected, the version, the update channel, and whether the config directory is writable. That output is the fastest way to figure out what you are actually dealing with, and I run it before I touch anything.

Native installer: the one Anthropic recommends

If you installed with curl -fsSL https://claude.ai/install.sh | bash, or the equivalent PowerShell one-liner, you have the native binary. It lives at ~/.local/bin/claude with the version files under ~/.local/share/claude. There is no package manager tracking it, so you delete both by hand.

macOS, Linux, WSL:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Windows PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Older versions of the native installer shipped a claude uninstall subcommand. If you can still run claude --version, try it first. On a current build it just calls the same rm commands, but on older builds it also handled a few edge cases around PATH shims that the manual delete does not. Both paths get you to the same end state.

Homebrew, WinGet, and Linux package managers

If you used a package manager, use the package manager to remove it. Do not rm a Homebrew-installed binary out from under Brew, or you will confuse brew doctor forever.

Homebrew has two casks. If you installed the stable channel:

brew uninstall --cask claude-code
brew cleanup

If you installed the “latest” channel:

brew uninstall --cask claude-code@latest
brew cleanup

The brew cleanup line is not cosmetic. Brew keeps old versions around by default. Skip it and you will have Claude Code artifacts on disk long after you thought you removed them.

WinGet:

winget uninstall Anthropic.ClaudeCode

apt (Debian, Ubuntu):

sudo apt remove claude-code
sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc

dnf (Fedora, RHEL):

sudo dnf remove claude-code
sudo rm /etc/yum.repos.d/claude-code.repo

apk (Alpine):

apk del claude-code
sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories
rm /etc/apk/keys/claude-code.rsa.pub

Removing the repository lines matters. Leave them behind, and your next system update will happily pull Claude Code back in as a “security update” if you ever reinstall by name. Ask me how I know.

npm: the legacy path most people are still on

If you installed before the native installer shipped, or you followed a stale tutorial, you have the npm global package. This is now the legacy path, but it is the one I see most often on other people’s machines.

npm uninstall -g @anthropic-ai/claude-code

Two things to check afterward. First, run which claude again. If npm was managed by nvm and you have multiple Node versions installed, the package might only be gone from the currently active Node. Switch versions (nvm use 20, nvm use 22) and re-run the uninstall for each one. This is the most common cause of “I removed it but the command still works.”

Second, look at your shell rc file for a shell alias. Some early install scripts, and a few community wrappers, added a line like alias claude="npx @anthropic-ai/claude-code" to ~/.zshrc or ~/.bashrc. That line survives the npm uninstall and will happily re-download Claude Code the next time you type claude. Grep for it:

grep -rn "claude" ~/.zshrc ~/.bashrc ~/.bash_profile ~/.profile 2>/dev/null

Delete anything that references Claude Code, source the file again, and open a new shell.

Config files: the part everyone skips

None of the uninstall commands above touch your configuration. That is deliberate. If you plan to reinstall, you probably want to keep your MCP servers, your allowed-tools list, and your custom slash commands. If you are done with Claude Code, or you are troubleshooting a corrupted config by starting from zero, you have to delete these by hand.

The user-level config on macOS, Linux, WSL:

rm -rf ~/.claude
rm -f ~/.claude.json

On Windows PowerShell:

Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

Project-level state lives inside each repo you used Claude Code in. From the project root:

rm -rf .claude
rm -f .mcp.json

What you are deleting, in order of “you probably do not want to lose this without a backup”: your OAuth session and any Anthropic auth tokens, your local settings including allowed tools and permissions, your MCP server configurations, your custom slash commands, session transcripts, and every CLAUDE.md context file Claude Code has been reading. If any of that matters, copy ~/.claude to a tarball first.

One trap. The VS Code extension, the JetBrains plugin, and the Claude Desktop app all write into the same ~/.claude directory. If you delete ~/.claude and any of those three is still installed, the directory rematerialises the next time you open them. If your goal is a truly clean state, remove the IDE plugins and the desktop app before you nuke the config.

The IDE and desktop surfaces you probably forgot

Claude Code is not just the CLI. Every install method leaves side installs you might not remember.

VS Code extension. If you ever ran Claude Code inside VS Code, or accepted the “install the Claude Code extension?” prompt, there is an extension. Remove it from the Extensions view (search “Claude Code”, click uninstall) or via the CLI: code --uninstall-extension anthropic.claude-code.

JetBrains plugin. Settings → Plugins → Installed. Search “Claude Code,” uninstall, restart the IDE. If you run JetBrains toolbox, it may cache the plugin per project; toolbox settings hold the state.

Claude Desktop app. macOS: drag Claude.app from /Applications to the Trash, then rm -rf ~/Library/Application\ Support/Claude and rm -rf ~/Library/Caches/Claude. Windows: Settings → Apps → Installed apps → Claude → Uninstall. Linux: your package manager if you installed via one, otherwise remove the AppImage or the extracted binary.

None of these are strictly Claude Code, but they all write to ~/.claude and any of them will keep the config directory alive if you forget. The full “is it really gone” check has to include them.

One command per method: the reference table

Install methodUninstall commandConfig still there?
Native installer (macOS/Linux/WSL)rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claudeYes
Native installer (Windows)Remove-Item "$env:USERPROFILE\.local\bin\claude.exe"; Remove-Item "$env:USERPROFILE\.local\share\claude" -RecurseYes
Homebrew (stable)brew uninstall --cask claude-code && brew cleanupYes
Homebrew (latest)brew uninstall --cask claude-code@latest && brew cleanupYes
WinGetwinget uninstall Anthropic.ClaudeCodeYes
aptsudo apt remove claude-code (then remove repo list + key)Yes
dnfsudo dnf remove claude-code (then remove .repo file)Yes
apkapk del claude-code (then remove repo line + key)Yes
npm (legacy)npm uninstall -g @anthropic-ai/claude-code (per Node version)Yes
Config wipe (all methods)rm -rf ~/.claude ~/.claude.json; rm -rf ./.claude ./.mcp.jsonNo

Print this, tape it to your monitor, and never re-derive it from a Stack Overflow answer that was written in the npm era.

Verify it is actually gone

The verification is not a formality. Open a new terminal, then run:

claude --version
# expected: command not found (or equivalent)

If you still get a version number, do these three things in order. First, which claude and where.exe claude to find the surviving binary; delete it. Second, grep -rn "claude" ~/.zshrc ~/.bashrc ~/.bash_profile ~/.profile ~/.config/fish/config.fish 2>/dev/null to catch aliases and PATH additions. Third, if you use nvm or asdf or fnm, iterate through every Node version and re-run npm uninstall -g @anthropic-ai/claude-code for each. That covers the three ways I have seen a “phantom” Claude Code survive an uninstall.

Then check the config directory really is gone:

ls -la ~/.claude ~/.claude.json 2>/dev/null
# expected: nothing

If ~/.claude keeps coming back, the culprit is almost always the VS Code extension, the JetBrains plugin, or the Claude Desktop app respawning it. Kill those, delete the folder again, and it stays dead.

When you should not uninstall

Half the time someone tells me they uninstalled Claude Code, they did not need to. If your goal is to fix an authentication problem, run claude logout then claude to re-auth. If your goal is to reset a broken config, delete ~/.claude.json alone and leave ~/.claude in place. If your goal is to switch models, use /model inside a session, or the autoUpdatesChannel and minimumVersion settings for version pinning. None of that requires a full removal.

Uninstall makes sense in three specific cases. You are moving off Claude Code entirely, probably to Codex CLI or a different agent. You are on a corporate machine and the security team told you to remove it. Or you are debugging something so deeply that a clean reinstall is faster than diagnosing the failure. Anything else, and the config wipe alone is enough.

If you are removing Claude Code because you found it noisy in your editor or in your git history, that is a workflow problem, not a Claude Code problem. Fix the workflow first. My own guardrails post covers the PreToolUse hooks I run to stop the agent from writing to sensitive files, which is the fix most people actually need. And if you are trying to decide between Claude Code and its competitors before you commit either way, the honest comparisons are in Cursor vs Copilot vs Claude Code and the Copilot audit.

Frequently asked questions

Does npm uninstall -g @anthropic-ai/claude-code remove my Claude Code config?

No. The npm uninstall only removes the package binary. Your ~/.claude directory, ~/.claude.json file, any project-local .claude/ folders, and .mcp.json files are untouched. If you want them gone, delete them by hand. That separation is intentional, so a reinstall or a temporary removal does not blow away your MCP servers and session history.

Why does claude still run after I uninstalled?

Three usual causes. You have a second install through a different method, for example npm and native side by side. You have a shell alias in your ~/.zshrc or ~/.bashrc from an old install script. Or you use nvm or asdf and only removed the package from the currently active Node version. Run which claude (or where.exe claude) and grep -rn "claude" ~/.zshrc ~/.bashrc to find the culprit.

Is there a single “claude uninstall” command?

Older native installer builds shipped a claude uninstall subcommand that removed the binary and version files. The current documented path is the pair of rm commands for ~/.local/bin/claude and ~/.local/share/claude. If claude uninstall works on your version, use it. It does not remove config either way.

How do I uninstall Claude Code on Windows?

If you installed with WinGet, run winget uninstall Anthropic.ClaudeCode. If you used the PowerShell native installer, remove $env:USERPROFILE\.local\bin\claude.exe and the $env:USERPROFILE\.local\share\claude directory. To wipe config, also delete $env:USERPROFILE\.claude and $env:USERPROFILE\.claude.json. The Claude Desktop app is separate: uninstall it from Settings → Apps.

How do I uninstall Claude Code on macOS?

Depends on how you installed. Homebrew: brew uninstall --cask claude-code (or claude-code@latest). Native installer: rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude. npm: npm uninstall -g @anthropic-ai/claude-code. For a full removal, also run rm -rf ~/.claude ~/.claude.json and drag Claude.app to the Trash if you had the desktop app.

Will uninstalling Claude Code cancel my Anthropic subscription?

No. Your Claude Pro, Max, Team, or Enterprise plan is a billing relationship with Anthropic, tied to your account. Deleting the CLI on your machine does nothing to it. To cancel, sign in at claude.ai and change your plan there. This is worth checking before you uninstall in a rage, because the two are unrelated.

Should I back up ~/.claude before deleting it?

Yes if you have configured any MCP servers, written custom slash commands, or built up a set of allowed tools you would rather not re-approve. tar -czf claude-backup-$(date +%Y%m%d).tgz ~/.claude ~/.claude.json is thirty seconds of insurance. On a clean reinstall you can restore the tarball and skip most of the setup.