Skip to main content
Claudebeginner

Uninstall Claude Code: Commands for Every Install Method

Remove Claude Code on macOS, Linux and Windows with the right command for your install method, then clear settings and fix 'claude still runs'.

6 min readUpdated October 2026

Claude Code is removed with the command that matches the way you installed it, and the first step is finding out which that was. Run:

claude doctor

On my machine it printed Running: native (2.1.303), Config install method: native and a path under ~/.local/share/claude/versions/. That path tells you which section below to use.

Sign Out First

Run this before you remove anything. After the binary is gone the command no longer exists, and stored credentials can stay on disk.

claude auth logout

Pick Your Install Method

How you installedJump to
Native installer (curl ... | bash or irm ... | iex); claude doctor shows a path under ~/.local/share/claude/versions/Native
brew install --cask claude-codeHomebrew
winget install Anthropic.ClaudeCodeWinGet
npm install -g @anthropic-ai/claude-codenpm
apt, dnf or apkLinux packages

If you are unsure, claude doctor reports the install method and path; I only verified its output for a native install.

Uninstall a Native Install

The native installer puts a launcher at ~/.local/bin/claude, which is a symlink into ~/.local/share/claude/versions/ (I confirmed this on macOS: ~/.local/bin/claude points at ~/.local/share/claude/versions/2.1.303). Remove both.

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

Uninstall with Homebrew

Homebrew has two casks, so remove the one you installed:

brew uninstall --cask claude-code
# or, if you installed the latest-channel cask:
brew uninstall --cask claude-code@latest

Uninstall with WinGet

winget uninstall Anthropic.ClaudeCode

Uninstall with npm

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

Do not use sudo for this. If an earlier sudo npm install -g caused ownership problems, see Claude Code permission errors.

Uninstall with apt, dnf or apk

Remove the package and the repository configuration so it is not pulled back in by a system upgrade.

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

# dnf
sudo dnf remove claude-code
sudo rm /etc/yum.repos.d/claude-code.repo
# apk
apk del claude-code
sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories
rm /etc/apk/keys/claude-code.rsa.pub
Advertisement

Remove Settings and Session History (Optional)

Removing the program does not remove your configuration. Deleting these files erases your settings, allowed tools, MCP server configurations and session history, so back them up if you might reinstall. They can also hold MCP server credentials and, on Linux, your OAuth login, so run claude auth logout first.

macOS, Linux, WSL

# User settings and state
rm -rf ~/.claude
rm ~/.claude.json

# Project-specific settings (run from the project directory).
# Skip these two if the files are committed to git: they usually hold
# shared team config (skills, commands, agents, MCP servers).
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

The VS Code extension, the JetBrains plugin and the Desktop app also write to ~/.claude/. If any of them is still installed the directory comes back the next time it runs, so uninstall those first. For where each file lives and what it controls, see where Claude Code stores configuration files.

"claude" Still Runs After Uninstalling

If the command still works, a second copy is earlier on your PATH, or an old shell alias points to a previous installation. List every match:

which -a claude      # macOS, Linux, WSL
where.exe claude     # Windows

Remove whichever path still appears, using the method that created it. Anthropic's docs describe this as a second installation or a leftover alias from an older installer. Then open a new terminal; your current shell may cache the old location.

Reinstalling Cleanly

After removing everything, install again with the native installer. If a fresh install fails, see Claude Code installation errors.

Next Steps

Frequently Asked Questions

Find answers to common questions

It depends on how you installed it. For the native installer on macOS, Linux or WSL run rm -f ~/.local/bin/claude and rm -rf ~/.local/share/claude. For Homebrew run brew uninstall --cask claude-code, for WinGet winget uninstall Anthropic.ClaudeCode, and for npm npm uninstall -g @anthropic-ai/claude-code.

If you used WinGet, run winget uninstall Anthropic.ClaudeCode. If you used the native PowerShell installer, delete $env:USERPROFILE\.local\bin\claude.exe and the $env:USERPROFILE\.local\share\claude folder with Remove-Item.

Run claude doctor. On the native installer it prints a line such as Config install method: native and the path of the running binary. A path under ~/.local/share/claude/versions/ means the native installer. If you remember running brew, winget, npm or a system package manager, use that method's uninstall command.

No. Removing the program leaves ~/.claude and ~/.claude.json in place, which hold your settings, allowed tools, MCP server configuration and session history. Delete them separately only if you want a clean slate.

You most likely have a second installation, or a leftover shell alias from an older installer. Run which -a claude (macOS, Linux, WSL) or where.exe claude (Windows) to list every copy on your PATH and remove the one that still resolves.

The VS Code extension, the JetBrains plugin and the Desktop app also write to ~/.claude/. While any of them is installed the directory is recreated the next time it runs, so uninstall those first.

Yes, but it is irreversible. It removes your user settings, allowed tools, MCP server configurations and session history, and Anthropic's docs warn about this. These files can also hold MCP server credentials and, on Linux, your OAuth login, so run claude auth logout first and back up anything you might want again.

Remove it from the Extensions view in VS Code like any other extension. Do this before deleting ~/.claude, because a running extension recreates that directory.

Yes, do it first. claude auth logout signs you out of your Anthropic account, and once the binary is removed the command no longer exists. Stored credentials can stay on disk until you delete them yourself, which matters most if you are handing the machine to someone else.