
How Do You Uninstall Claude Code?
Carlos GarciaPublished How Do You Uninstall Claude Code?
Uninstalling a command-line tool should be the easy half of the job. With Claude Code it catches people out, for a specific and avoidable reason: there is no single uninstall command, because there is no single way it was installed.
The native installer, npm, Homebrew, WinGet and the Linux package repositories each put the binary somewhere different and each remove it differently. Run the wrong removal command and you get a confusing result — either an error saying nothing is installed, or a clean-looking success followed by claude still launching perfectly well from a second copy you forgot about.
There is also a second half that most instructions skip entirely. Removing the binary does not remove your settings, your permission grants, your MCP server configuration or your session history. Those live in a separate directory and survive every uninstall route.
This guide covers both halves, in the order that produces a clean machine.
How Do You Uninstall Claude Code?
Find out how it was installed, remove it with the matching command, then delete the configuration directory if you want a complete removal.
If you installed with the recommended native installer on macOS, Linux or WSL, two commands do it:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claudeOn Windows PowerShell, the same native install is removed with:
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -ForceIf you installed through a package manager instead, use that manager's own removal command — npm uninstall -g @anthropic-ai/claude-code, brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, or sudo apt remove claude-code. Each is covered in full below.
Then, if you want the settings gone too, remove ~/.claude and ~/.claude.json. Skipping that step is perfectly reasonable if you expect to reinstall later; it means your configuration will be waiting for you.
Replacing one tool in your stack is a good moment to check the whole thing. Get a free audit at seo-stuff.com/free-audit and see what your current setup is actually measuring.
Free audit
Where do you stand in AI search?
A manual SEO + AI search audit of your site: how ChatGPT, Gemini, Perplexity and Claude read and cite it today, and what to fix first. Report within 48 hours, no credit card.
Get my free auditOr have it all done: AI SEO services, $999 once
Why There Is No Single Uninstall Command
This is the part that makes the rest obvious, and it is worth two minutes.
Five Install Routes, Five Removal Routes
Claude Code is distributed as a native binary, and that binary reaches your machine by whichever path you chose: the install script, npm as a global package, a Homebrew cask, a WinGet package, or a signed apt, dnf or apk repository. Notably, the npm package installs the same native binary as the standalone installer rather than a Node application — but npm still owns the bookkeeping for it.
A package manager keeps a record of what it installed and where, so its uninstall command can undo exactly that. The native installer does not register itself with anything, which is why its removal is two explicit deletions rather than a command.
Where the Binary Actually Lives
On a native install on macOS or Linux, there is a launcher at ~/.local/bin/claude which is a symlink into ~/.local/share/claude/versions/. The versions directory is where the real executables sit, one per installed version, because auto-update installs new versions alongside the old ones rather than overwriting in place.
That is why removing only the launcher leaves hundreds of megabytes behind, and why removing only the versions directory leaves a dangling claude command that fails with a cryptic error. Both deletions are needed.
The Binary and the Configuration Are Separate
Your settings, authentication state, permission decisions, MCP server definitions and conversation history live in ~/.claude and in the file ~/.claude.json, entirely independent of wherever the executable happens to be. Project-level settings live in a .claude directory inside each repository, alongside any .mcp.json you created.
No uninstall command for the binary touches any of these, by design. It means a reinstall picks up exactly where you left off, and it means "I uninstalled it" and "it is gone from my machine" are two different statements.
How to Uninstall Claude Code, by Install Method
Work out which applies to you first. If you are unsure, which claude on macOS or Linux, or where claude on Windows, tells you the path, and the path tells you the installer. A result under ~/.local/bin is a native install; one under a Homebrew or npm prefix points at those.
Native Installation
On macOS, Linux or WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claudeOn Windows PowerShell:
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Forcenpm Global Package
npm uninstall -g @anthropic-ai/claude-codeDo not prefix this with sudo. If the original install needed elevated permissions, the right fix is a user-owned npm prefix rather than a privileged uninstall.
Homebrew
Which cask you remove depends on which you installed. The claude-code cask tracks the stable release channel; claude-code@latest tracks every release as it ships.
brew uninstall --cask claude-codeOr, for the latest channel:
brew uninstall --cask claude-code@latestHomebrew also keeps old versions on disk after upgrades, so brew cleanup afterwards reclaims space the uninstall leaves behind.
Tooling changes; the questions you ask of your data should not. Request a free audit and we will tell you which of your reports still answer a question worth asking.
WinGet
winget uninstall Anthropic.ClaudeCodeapt, dnf and apk
For these, remove the package and then the repository configuration, otherwise your system keeps checking a repository for software you no longer want.
On Debian or Ubuntu:
sudo apt remove claude-code
sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.ascOn Fedora or RHEL:
sudo dnf remove claude-code
sudo rm /etc/yum.repos.d/claude-code.repoOn Alpine:
apk del claude-code
rm /etc/apk/keys/claude-code.rsa.pubOn Alpine you also want to strip the repository line out of /etc/apk/repositories, which the documentation does with a sed one-liner.
How to Remove the Configuration Files
This is the optional second half, and it is genuinely destructive: it deletes your settings, your allowed-tools decisions, your MCP server configurations and your session history. There is no undo and nothing is kept server-side for you to restore.
On macOS, Linux or WSL:
rm -rf ~/.claude
rm ~/.claude.jsonAnd inside any project that had its own configuration:
rm -rf .claude
rm -f .mcp.jsonOn Windows PowerShell, the same two user-level removals are:
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -ForceThere is one ordering trap here that causes most of the "I deleted it and it came back" reports. The VS Code extension, the JetBrains plugin and the Claude Code desktop app all write to ~/.claude as well. If any of them is still installed, the directory is recreated the next time it runs. Uninstall those first, then delete the configuration.
When You Should Uninstall, and When You Should Not
Reaching for an uninstall is often the wrong move for the problem at hand.
Uninstall when you are genuinely done with it, or when you are handing a machine on, or when a corporate policy requires the removal. Those are the clear cases.
Uninstall and reinstall when you have duplicate installations. This is the most common legitimate reason. If claude behaves inconsistently — an old version answering in one terminal and a new one in another — removing every copy and installing once is the fix.
Do not uninstall to get a different version. The native installer accepts a specific version number, and autoUpdatesChannel switches you between the latest and stable channels. Both are less disruptive than a reinstall.
Do not uninstall to stop it updating itself. Setting DISABLE_AUTOUPDATER to 1 in the env block of your settings file stops the background check, and DISABLE_UPDATES blocks manual updates as well.
Do not uninstall to free disk space without checking first. On a native install, ~/.local/share/claude/versions/ accumulates versions. The installer prunes them itself, but a custom launcher disables that pruning, and claude doctor will tell you if yours is non-standard.
A clean machine is worth about as much as a clean dataset. Book a free audit and we will find the stale tags, broken events and duplicate tracking still sitting in your setup.
What Goes Wrong, and Why
Four failure modes account for nearly all of it.
claude still runs after a successful uninstall. Almost always a second installation, or a shell alias left behind by an older installer. Check your shell profile — .zshrc, .bashrc, .bash_profile, or your PowerShell profile — for an alias or a PATH entry pointing at a path that no longer exists.
The uninstall command reports that nothing is installed. You have guessed the wrong install method. Find the real path with which claude or where claude before running anything else.
The configuration directory reappears. An IDE extension or the desktop app recreated it. This is the ordering trap above.
Permission errors on the npm uninstall. A sign the original install used sudo. Fixing the npm prefix ownership is the durable answer; uninstalling with elevated permissions works but leaves root-owned remnants.
Worth knowing too: uninstalling the CLI does not cancel your Claude subscription, and it does not sign you out anywhere else. Claude Code requires a Pro, Max, Team, Enterprise or Console account, and that account is unaffected by what happens on your machine. Billing is managed in your account settings, not by the presence of a binary.
Removing a tool is easy. Knowing whether it was earning its place is the hard part. A free audit gives you a straight read on what your stack is contributing.
Uninstalling vs the Alternatives
If the actual goal is "stop this getting in my way", there are lighter options than removal.
Disabling auto-updates solves the problem of a tool that changes under you, without removing it. One setting, reversible in a second.
Pinning a version with the minimumVersion setting, or installing an exact version with the native installer, holds you at a known-good build. That is usually what people want when an update broke something.
Removing just the integrations — the VS Code extension or the JetBrains plugin — gets Claude Code out of your editor while leaving the terminal command available. If the irritation is an editor sidebar rather than the tool itself, this is the precise fix.
Clearing the configuration without removing the binary resets behaviour to defaults. Useful when settings have accumulated into something you no longer understand, and much faster than a full reinstall cycle.
A full uninstall and reinstall is the right answer only for genuinely broken or duplicated installations. It is the biggest hammer available and it discards your configuration if you take the second half of the procedure as well.
For the reverse journey, our guide to the Claude Code CLI covers the install routes and how updates work, which is the context that makes the removal commands above make sense.
Final Thoughts
The whole procedure is short once you know the shape of it. Identify the install method, run that method's removal command, and then decide separately whether you want the configuration gone as well.
The two things that turn a two-minute job into a frustrating afternoon are both avoidable. Guessing the install method produces uninstall commands that appear to work and change nothing — so check the path first. And forgetting that the editor extensions share the configuration directory produces a file that keeps coming back — so remove those before you delete it.
Decide up front which outcome you want, too. "Uninstalled" and "no trace left" are different results with different commands, and most people who ask for the second actually want the first, because they intend to come back. Either way, verify when you are done: open a new terminal and run claude --version, and a command-not-found error is what success looks like.
Want this done for you?
SEO Stuff gets businesses cited by ChatGPT, Gemini, Perplexity and Claude, and ranking in Google. Start with the free audit, a call, or the package.
See where you stand
A free, manual SEO + AI search audit of your site, with a report within 48 hours. No credit card, no sales call.
Get my free auditTalk it through
A free 15-minute call with the founder about whether AI search is a meaningful opportunity for your business.
Free strategy callHave it done
The Done-For-You Package: audit, 10 pages of content, 3 DR50+ placements, dashboard. $999 once, delivered in 21 business days.
See the package

