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 installed | Jump to |
|---|---|
Native installer (curl ... | bash or irm ... | iex); claude doctor shows a path under ~/.local/share/claude/versions/ | Native |
brew install --cask claude-code | Homebrew |
winget install Anthropic.ClaudeCode | WinGet |
npm install -g @anthropic-ai/claude-code | npm |
| apt, dnf or apk | Linux 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
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.