Uninstall Claude Code cleanly on Mac, Windows, and Linux

There are six ways Claude Code can be on your machine and each has its own removal command. Running the wrong one leaves the binary in place, which is why so many people uninstall it twice.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Find how Claude Code was installed with which -a claude, then use the matching removal: rm the native install at ~/.local/bin/claude and ~/.local/share/claude, npm uninstall -g @anthropic-ai/claude-code, brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, or your Linux package manager. Configuration lives separately in ~/.claude and ~/.claude.json and is shared with the desktop app and IDE extensions.

What you need to know
  • Run which -a claude first. More than one result is normal and is why it survives.
  • Native install: delete ~/.local/bin/claude and ~/.local/share/claude.
  • npm: npm uninstall -g @anthropic-ai/claude-code. Never with sudo.
  • Homebrew has two casks. Uninstall the one you installed.
  • Config in ~/.claude is shared with Desktop and the IDE extensions, and gets recreated.

First, find out how it got installed

Do not skip this. The removal command is different for each install method, and a machine that has been in use for a while frequently has two: an original npm install and a later native one, or a Homebrew cask sitting next to both. Uninstalling one and finding claude still on your PATH is the single most common outcome of guessing.

macOS and Linux. Every line is a check; nothing here changes anything.
# every claude on your PATH, in resolution order
which -a claude

# the native installer puts a symlink here, into ~/.local/share/claude/versions/
ls -la ~/.local/bin/claude

# a legacy local npm install, created by older versions
ls -la ~/.claude/local/

# a global npm install
npm -g ls @anthropic-ai/claude-code 2>/dev/null

# a Homebrew cask, and which one
brew list --cask 2>/dev/null | grep claude
Windows.
where.exe claude
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
winget list Anthropic.ClaudeCode
npm -g ls @anthropic-ai/claude-code

Match what you found to the section you need.

What you foundInstall methodGo to
~/.local/bin/claude symlinked into ~/.local/share/claude/versions/Native installerNative
A package listed by npm -g lsGlobal npmnpm
~/.claude/local/ existsLegacy local npmLegacy local
claude-code or claude-code@latest in brew list --caskHomebrewHomebrew
winget list shows Anthropic.ClaudeCodeWinGetWinGet
dpkg -l claude-code or equivalentapt / dnf / apkLinux packages
Nothing, but the Claude app is installedBundled with the desktop appDesktop app
One uninstall removes one of the copies on your PATH, leaving the others resolving first, and it never touches the configuration directories that other Claude apps also write to one machine, three installs and one configuration which -a claude /opt/homebrew/bin/claude still runs ~/.local/bin/claude uninstalled /usr/local/bin/claude npm -g no uninstall touches these ~/.claude/ settings, history ~/.claude.json user config, MCP <repo>/.claude/ project settings <repo>/CLAUDE.md project memory The VS Code extension and the desktop app write to ~/.claude too, and recreate it. which -a lists every match on your PATH, not only the one that wins.

Native installer

This is the default install on every platform and the most likely answer. Two paths: the launcher and the versions directory.

macOS, Linux, and 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

Deleting only the launcher leaves several hundred megabytes of downloaded versions behind, which is worth knowing if you are doing this to reclaim disk. Deleting only the versions directory leaves a dangling symlink that reports a confusing error rather than command not found.

npm, and the legacy local install

The global package. This is what "npm uninstall claude" is looking for.
npm uninstall -g @anthropic-ai/claude-code

Older versions of Claude Code created a second, local npm install under ~/.claude/local/. It is not removed by the global uninstall and it is a frequent cause of a claude that survives everything else.

# macOS and Linux
rm -rf ~/.claude/local

# Windows PowerShell
# Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local"

Homebrew, WinGet, and Linux packages

Homebrew

Homebrew publishes two casks: claude-code tracks the stable channel and claude-code@latest tracks the latest one. Uninstall the one you actually installed; running the wrong name reports that the cask is not installed and leaves the binary in place.

# stable cask
brew uninstall --cask claude-code

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

# Homebrew keeps old versions around; reclaim the space
brew cleanup

WinGet

winget uninstall Anthropic.ClaudeCode

apt, dnf, and apk

Remove the package and the repository configuration, otherwise your next system update re-offers it.

Debian and Ubuntu.
sudo apt remove claude-code
sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
Fedora and RHEL.
sudo dnf remove claude-code
sudo rm /etc/yum.repos.d/claude-code.repo
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

The configuration, which is shared

Removing the binary does not remove your settings, permission rules, MCP server configuration, or session history. Those live separately.

PathWhat is in it
~/.claude/Settings, skills, agents, project state, session transcripts
~/.claude.jsonUser-scope config and MCP servers
<repo>/.claude/Project settings and commands
<repo>/.mcp.jsonProject MCP servers
<repo>/CLAUDE.mdProject memory. Usually committed; usually keep it
macOS, Linux, WSL. This deletes settings, allowed tools, MCP config, and history.
rm -rf ~/.claude
rm ~/.claude.json

# project-specific, from inside the repo
rm -rf .claude
rm -f .mcp.json
Windows PowerShell.
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

Remove-Item -Path ".claude" -Recurse -Force
Remove-Item -Path ".mcp.json" -Force

Uninstalling the desktop app

The desktop app bundles Claude Code, so removing the CLI does not remove the app, and removing the app does not remove a separately installed CLI. They are two things.

PlatformHow
macOSQuit Claude, then move it from Applications to the Trash
WindowsSettings, Apps, Installed apps, Claude, Uninstall
Linuxsudo apt remove claude-desktop

On Linux, removing the package also removes the repository entry and signing key that the package registered. A repository line you added by hand during install has to go separately.

sudo apt remove claude-desktop
sudo rm /etc/apt/sources.list.d/claude-desktop.list

It still runs after uninstalling

Almost always one of four things, in this order of likelihood.

  1. A second installation. Run which -a claude again. It lists every match on your PATH, not just the winner. Remove the others with their own method.
  2. A shell alias or function left behind by an older installer. type claude tells you if the name resolves to an alias rather than a file, and the definition is somewhere in ~/.zshrc, ~/.bashrc, or ~/.zprofile.
  3. The shell is caching the old path. hash -r in bash or zsh clears the command lookup table. Opening a new terminal does the same thing.
  4. A custom launcher you or a tool created at ~/.local/bin/claude. Since v2.1.207 the updater leaves a launcher it did not create in place rather than replacing it, so a script there survives an uninstall that only targeted the versions directory.
The full sweep, once you have removed the install you knew about.
which -a claude
type claude
hash -r
command -v claude || echo "gone"

Questions people ask

Run which -a claude to find how it was installed. For the standard native install, rm -f ~/.local/bin/claude and rm -rf ~/.local/share/claude. For Homebrew, brew uninstall --cask claude-code. For npm, npm uninstall -g @anthropic-ai/claude-code.

npm uninstall -g @anthropic-ai/claude-code. Do not run it with sudo. Older versions also created a local install at ~/.claude/local, which the global uninstall does not touch.

brew uninstall --cask claude-code for the stable cask, or brew uninstall --cask claude-code@latest if you installed that one. Follow with brew cleanup, because Homebrew keeps old versions on disk.

For the native install, remove %USERPROFILE%\.local\bin\claude.exe and %USERPROFILE%\.local\share\claude. For WinGet, winget uninstall Anthropic.ClaudeCode. For npm, npm uninstall -g @anthropic-ai/claude-code.

You almost certainly have a second installation. Run which -a claude, which lists every match on your PATH rather than only the one that wins. A leftover shell alias and a cached command lookup are the other two causes; hash -r or a new terminal clears the cache.

No. Those live in ~/.claude and ~/.claude.json and survive the uninstall. Delete them separately, and remove the desktop app and IDE extensions first, because they write to the same directory and will recreate it.

On macOS quit it and move Claude from Applications to the Trash. On Windows use Settings, Apps, Installed apps. On Linux run sudo apt remove claude-desktop, which also removes the repository entry it registered.

No. Removing the software has no effect on billing. Cancel the plan in your Claude account settings if that is what you want.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code advanced setup official uninstall commands per install method
  2. Troubleshoot installation and login checking for conflicting installations
  3. Claude Code CLI reference claude project purge
Try it

Leaving because
of the bill?

Continuum shows spend by repo, model, and day across every agent, for free, before you decide to cancel anything.

free app · your subscriptions · local-first