sodcalculator

10 Tech How-To

How to Uninstall Claude Code Cleanly (Mac, Windows, Linux)

Guide 10-9090 · Updated · Step by step

This guide walks you through completely removing Claude Code from your system—including the CLI tool, cached data, configuration files, and any leftover processes—so nothing lingers in the background or breaks future installs. You’ll need terminal access on your operating system, and on Windows, PowerShell with administrator rights for some steps.

What You’ll Need

  • Terminal (macOS/Linux) or PowerShell (Windows)
  • Administrator/sudo privileges on your machine
  • Your package manager (npm, Homebrew, etc.) if you installed via one

Step-by-Step

macOS

  1. Stop any running processes. Open Terminal and run pkill -f "claude" to terminate any active Claude Code processes.
  2. Uninstall the CLI package. If you installed via npm globally: npm uninstall -g @anthropic-ai/claude-code. If you used Homebrew: brew uninstall claude-code. If you used a different method, check that tool’s uninstall command.
  3. Remove configuration and data directories. Run the following commands to delete all Claude Code-related files in your home folder:
    rm -rf ~/.claude
    rm -rf ~/.config/claude-code
    rm -rf ~/Library/Application\ Support/ClaudeCode
    rm -rf ~/Library/Caches/ClaudeCode
  4. Clean up shell aliases. If you added any aliases or PATH entries for Claude Code in your .zshrc or .bash_profile, edit those files and remove those lines.
  5. Verify removal. Run which claude—it should return nothing. Also check npm list -g --depth=0 to confirm the package is gone.

Windows

  1. Close all related processes. Open Task Manager (Ctrl+Shift+Esc), look for any process named “claude” or “node” (if running Claude Code), and end them.
  2. Uninstall via npm. In PowerShell (as administrator), run npm uninstall -g @anthropic-ai/claude-code. If you used a different installer, uninstall through that method.
  3. Remove configuration folders. In PowerShell, execute:
    Remove-Item -Recurse -Force $env:USERPROFILE\.claude
    Remove-Item -Recurse -Force $env:APPDATA\ClaudeCode
    Remove-Item -Recurse -Force $env:LOCALAPPDATA\ClaudeCode
  4. Clean up environment variables. Open System Properties → Environment Variables and remove any PATH entries that point to Claude Code’s installation directory (usually %APPDATA%\npm if installed via npm).
  5. Verify. Run where claude in PowerShell—it should return no results.

Linux

  1. Terminate running processes. In a terminal, run pkill -f "claude".
  2. Uninstall the package. For npm global installs: sudo npm uninstall -g @anthropic-ai/claude-code. For other package managers, use their corresponding uninstall command.
  3. Delete configuration and cache files. Execute the following commands:
    rm -rf ~/.claude
    rm -rf ~/.config/claude-code
    rm -rf ~/.cache/claude-code
  4. Check for leftover binaries. Use which claude to see if any binary remains in a system path. If found, remove it manually (e.g., sudo rm /usr/local/bin/claude).
  5. Verify removal. Run claude --version—it should fail with “command not found”.

Common Mistakes

  • Forgetting to remove config files. Even after uninstalling the binary, leftover config can cause issues on reinstall or consume disk space.
  • Not checking for background processes. Claude Code may spawn background daemons that keep running after the main process exits.
  • Using the wrong uninstall command. If you installed with a version manager like Volta or asdf, npm uninstall won’t work—use the manager’s own command.
  • Skipping PATH cleanup. Leftover PATH entries can cause confusion later when you try to reinstall.

Tips

  • Back up anything you need. If you have custom prompts or settings in ~/.claude, copy them elsewhere before deleting.
  • Use the official uninstaller if available. Some versions ship with an uninstall script—check the documentation first.
  • Reinstall fresh. If you plan to reinstall later, a clean removal avoids version conflicts and corrupted caches.
  • Check your shell startup files. Even if you didn’t add aliases manually, some installers modify them automatically.

Troubleshooting

  • “claude” still runs after uninstall. This usually means a leftover binary exists in a different PATH location. Run which -a claude (macOS/Linux) or where claude (Windows) to find all instances and delete them.
  • npm uninstall fails with permissions errors. On Unix systems, prefix the command with sudo. On Windows, ensure PowerShell is running as administrator.
  • Configuration files won’t delete. On Windows, you may need to close all terminal windows first. On macOS/Linux, check file permissions with ls -la and use sudo rm if necessary.
  • Errors about missing modules after uninstall. This can happen if a global npm package still references Claude Code. Run npm prune -g to clean up orphaned dependencies.
  • Claude Code still appears in app launchers. On macOS, check ~/Applications and the system Applications folder for any leftover .app bundles and delete them manually.

Frequently Asked Questions

Will uninstalling Claude Code delete my chat history or conversations?

Yes, if you delete the ~/.claude directory (or equivalent), any locally stored conversation history and settings are removed. If you want to keep them, back up that folder first.

Do I need to uninstall Node.js to remove Claude Code?

No. Claude Code is a Node.js package; uninstalling it doesn’t require removing Node.js itself. Only remove the specific package.

Can I reinstall Claude Code after uninstalling?

Absolutely. A clean uninstall removes all traces, so you can reinstall fresh via npm or your preferred method without conflicts.

How do I know if Claude Code is still running in the background?

Use ps aux | grep claude on macOS/Linux or Get-Process | Where-Object {$_.Name -like '*claude*'} on Windows. If any processes appear, terminate them.

Is there an official uninstaller provided by Anthropic?

As of now, there is no standalone uninstaller; the steps above are the standard method for removing the CLI and its data.

Will uninstalling Claude Code affect other Anthropic tools?

No, uninstalling Claude Code only removes this specific CLI. Other tools like the API SDKs remain unaffected.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →