01 / Identify the installation
Check which Claude Code your terminal runs
Save project files, stop active Claude Code sessions in terminals and editors, and wait for updates to finish. Open macOS Terminal and run this read-only check. In the usual zsh or bash shell, it lists matching commands and can reveal aliases or functions as well as executable paths.
type -a claudeIf the CLI still works, claude doctor provides installation diagnostics. A native installation normally uses ~/.local/bin/claude, linked into ~/.local/share/claude/versions. Confirm the launcher rather than judging only by its filename.
ls -ld "$HOME/.local/bin/claude" "$HOME/.local/share/claude"if command -v brew >/dev/null 2>&1; then
brew list --cask
fi
if command -v npm >/dev/null 2>&1; then
npm list -g @anthropic-ai/claude-code --depth=0
fiLook for claude-code or claude-code@latest in Homebrew's list. The npm check covers only the active Node environment; nvm or fnm environments may each contain a global installation. A missing file or empty package result means that particular check found nothing, not that every copy is absent.
02 / Native installer
Remove the native launcher and version files
Use this step only after confirming the default native installation. These are the two locations listed in Anthropic's native uninstall instructions. If the launcher is a custom script or points elsewhere, inspect that setup before removing it.
Close Claude Code and allow updates to finish first. The command removes the launcher and the native installation directory, including its stored versions. It does not move them to the Trash. Keep the paths exactly scoped to Claude Code.
rm -f "$HOME/.local/bin/claude"
rm -rf "$HOME/.local/share/claude"This leaves ~/.claude, ~/.claude.json, and your projects in place. Do not remove all of ~/.local/bin or ~/.local/share: other applications may use those directories.
03 / Homebrew or npm
Uninstall the package you actually installed
Homebrew cask
For the claude-code cask, use the following command. Let Homebrew manage its installation files.
brew uninstall --cask claude-codeIf the installed cask is claude-code@latest, use this command instead. Run both only if you have confirmed both are installed and want to remove both.
brew uninstall --cask claude-code@latestGlobal npm installation
If you installed Claude Code globally with npm, including an older installation, run this in the same Node environment that owns the package.
npm uninstall -g @anthropic-ai/claude-codeRepeat the check in any other Node environments you used. Older Claude Code versions could also create a local installation under ~/.claude/local; inspect that directory and any alias pointing to it separately. Neither the global npm command nor the Homebrew command is a reason to clear the entire shared npm or Homebrew cache.
04 / Settings and residual data
Decide what to do with ~/.claude and project files
Removing the program does not remove user configuration or history. Keep these files if you plan to reinstall or still use another Claude Code interface. The locations below have different purposes.
| Location | What it contains | What to do |
|---|---|---|
~/.claude | User settings, sessions, auto memory, file snapshots, plugins, skills, caches, and logs. | Back up the data you need. The whole directory is not disposable cache. |
~/.claude.json | Account-related preferences, project trust decisions, personal MCP server configuration, and other state. | This is a separate file beside the directory. Keep it for continued use, or back it up before optional removal. |
Project .claude | Project settings, rules, skills, and other configuration; some files may be shared with your team. | Review each repository separately. Do not delete it across all projects as part of a CLI uninstall. |
CLAUDE.md and .mcp.json | Project instructions and project-scoped MCP configuration. A global instruction file may also exist at ~/.claude/CLAUDE.md. | Keep useful instructions and shared configuration. These files are not the installed CLI. |
If you set CLAUDE_CONFIG_DIR, inspect that actual location too; the default paths are not a complete inventory. Project worktrees and source files may also live outside the user configuration directory.
- Before optional removal, copy the settings, sessions, memory, and files you want to keep to a separate backup and check that the copy is readable.
- In Finder, press ⇧⌘G to open Go to Folder and inspect
~/.claude. Use Get Info to check its size. To find the separate~/.claude.jsonfile, open your home folder and press ⇧⌘. to show hidden files. - Only after reviewing the contents and closing every interface that uses them, move the unwanted items to the Trash. Leave it unemptied until you have checked what you retained; emptying it permanently removes those files.
The VS Code extension, JetBrains plugin, and Desktop app can also write to ~/.claude. If you still use them, preserve their shared data. If you want to remove those integrations too, uninstall them separately; otherwise they may recreate the directory.
05 / Verify the result
Open a new terminal and check for remaining copies
type -a claudeIf a path still appears, identify its owner and use that installation method's uninstall step. If the result is an alias or function, review the matching definition in your shell configuration, such as ~/.zshrc. Remove only the obsolete Claude Code definition. Keep shared PATH entries such as ~/.local/bin when other tools use them.
A command-not-found result means the new shell cannot resolve claude; it does not check inactive Node environments, custom locations, or editor-bundled copies. Recheck the package lists and locations you identified earlier, and review any old ~/.claude/local installation.
Confirm that the project code and backups you kept are intact. Measure the same directories again if freeing space was your goal. Files moved to the Trash still occupy disk space until the Trash is emptied.
06 / Review cleanup coverage
Use AgentClean for supported data cleanup
If your goal is to reclaim space while keeping Claude Code, you may not need to uninstall it. AgentClean can scan supported default paths for caches, logs, and old native versions. Review sessions, auto memory, file history, and other caution items individually before selecting them.
AgentClean's cleanup rules do not replace the native, Homebrew, or npm uninstall steps above. Its old native-version rule retains selected versions; it is not a complete removal of the CLI. Custom configuration directories are not guaranteed to be covered. Review the selected data and back up important files before cleanup.
Official references
Review supported local data
Use AgentClean to review Claude Code cleanup items
Scan supported local Claude Code paths, review their sizes and purposes, and select only the data you no longer need.
AgentClean does not perform the CLI uninstall described above. Its old-version rule covers native version files, not npm packages or Homebrew installations. Review the selected data and back up important files before cleanup.
Stay tuned
AgentClean is currently available only for Mac. Other platforms aren’t available yet. Visit this site on a Mac to download.
See supported tools · Coverage depends on the tool, path, and actual scan.
Frequently asked questions
A few more things to check
How do I uninstall Claude Code on Mac?
First identify the installation. Remove the native launcher and its version directory, run brew uninstall --cask claude-code for that Homebrew cask, or run npm uninstall -g @anthropic-ai/claude-code for a global npm installation. Use claude-code@latest if that is your installed cask. Then open a new terminal and check for another copy.
Does uninstalling Claude Code delete ~/.claude or my history?
The program-removal steps in this guide leave user data in place. ~/.claude may contain settings, sessions, memory, and file snapshots as well as caches. ~/.claude.json is a separate file. Back up what you need and review optional data removal separately.
Why does the claude command still work after uninstalling?
Another native, Homebrew, or npm installation may be on PATH, or a shell alias may point to an older local installation. Run type -a claude in a new terminal and check the listed locations. Node version managers can keep separate global npm packages.
Can AgentClean completely uninstall Claude Code?
This guide uses the original installation method to remove the CLI. AgentClean reviews and cleans supported local data; its old native-version rule is not a full uninstaller and does not cover npm or Homebrew program directories. Select only data you no longer need, and back it up before cleanup.