All insights

Coding agents

How to Remove Claude Code Safely

Find the Claude Code installation you use, remove it with a matching command, and decide separately whether to delete settings or project data.

Illustration for Remove claude code

To remove the Claude Code CLI, first identify how it was installed, then use the matching uninstall method. Removing the CLI is separate from deleting settings, project files, or editor integrations. Back up any data you want to keep before removing it.

1. Identify the installation

Open a new terminal. On macOS or Linux, run:

type -a claude

In Windows PowerShell, run:

Get-Command claude -All

These commands show what the current shell resolves as claude; they may reveal more than one result. On macOS or Linux, a path under ~/.local/bin may indicate a native installation. If the result is ambiguous, check the package manager you used or compare the path with its installation records. Don’t delete a guessed path.

2. Uninstall the matching CLI

Use only the instructions that match your installation. The native-installer commands below come from third-party uninstall guides; they are not confirmed here as current official instructions for every platform. For other installation methods, consult the Claude Code setup guide.

Native installer on macOS

If the native installation uses these paths, remove the executable and its version files:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Native installer on Linux or WSL

A third-party guide gives the same commands for native installations on Linux and WSL. Use them only if those are the paths for your installation:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Native installer on Windows

For a native Windows installation using the default user-profile paths, a Claude Code collaborator suggested deleting the executable. A third-party guide also lists removing the native installer’s shared data directory. These instructions are not a complete, currently confirmed official procedure; check that the paths match your installation before running them:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

The collaborator’s suggestion concerned an installation launched from bootstrap.ps1. Removing the executable does not remove settings stored separately.

Homebrew stable cask

If you installed the stable cask, run:

brew uninstall --cask claude-code

Global npm package

If you installed Claude Code globally through npm, run:

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

For a different cask, package, or installation method, use its matching uninstall instructions rather than substituting one of these commands.

3. Choose whether to remove settings or project data

You can stop after uninstalling the CLI if you want to retain settings. The following locations are reported by third-party guidance or a collaborator comment; treat them as places to inspect, not as a required cleanup list. Back up anything you may need before deleting it.

  • Mac user settings or state: A third-party guide lists ~/.claude and ~/.claude.json.
  • Project configuration: The same guide lists .claude and .mcp.json inside relevant project directories. Delete these only from projects where you intend to remove that configuration; they are not the CLI itself.
  • Windows settings: A collaborator comment names %UserProfile%\.claude.json, %UserProfile%\claude.json.backup, and %UserProfile%\.claude\ as locations where settings may persist. The comment is not a complete cleanup checklist or a recommendation to delete them.
  • IDE or desktop integrations: These are separate components. A third-party guide warns that some integrations may recreate shared settings when run. Consult the instructions for the specific integration you installed.

Do not delete a folder just because its name contains “Claude.” The sources cited here do not establish that deleting these settings removes every credential or authentication record. Claude Desktop is a separate app; its application-file cleanup is not part of uninstalling the CLI.

4. Check whether the CLI still resolves

Close the terminal, open a new one, and run type -a claude on macOS or Linux, or Get-Command claude -All in PowerShell. If no command is found, Claude Code is no longer resolving in that shell. This check does not confirm that separate editor or desktop integrations have been removed.

If a path still appears, match it to the installer or package manager that owns it and use that method’s uninstall instructions. If PowerShell reports an alias or function, inspect its definition and remove it only if you recognize it as one you configured. On macOS or Linux, check for multiple paths before taking action. Don’t delete unrelated PATH entries or configuration files to make the command disappear. For installation conflicts or PATH issues, consult Anthropic’s installation troubleshooting guide.

Does removing Claude Code mean you need a production API?

No. Uninstalling a local CLI does not by itself mean you need an API replacement. Consider an API only if you are replacing a particular application or backend workflow; an API is not automatically equivalent to an interactive coding CLI. This guide makes no claims about TokenForge API capabilities or pricing.

Sources

Claude Code setup and uninstall guide

Claude Code installation troubleshooting

Claude Code uninstall guide for Mac

Claude Code GitHub issue: Windows uninstall question

How to Remove Claude Code: third-party uninstall guide

Contact us