macOS cleanup guides / Uninstall Claude Code

How to Uninstall Claude Code on Mac

To uninstall Claude Code on Mac, remove it using the method that installed it: delete the native launcher and version directory, uninstall the Homebrew cask, or remove the global npm package. Then review ~/.claude and ~/.claude.json separately; uninstalling the CLI does not remove your settings or session history.

Remove the installation first; decide separately what data to keep

Save your work and end Claude Code tasks before uninstalling. Keep the configuration and history you may need for a reinstall or another Claude Code interface. A missing claude command does not prove that every installation or data directory is gone.

Start with your installation method

Follow the uninstall steps below, then review the local data you want to keep or remove.

Find my installation method

AgentClean reviews supported local data; it does not perform the CLI uninstall steps in this guide.

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.

Find Claude Code commands on PATH
type -a claude

If 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.

Inspect the native launcher and installation directory
ls -ld "$HOME/.local/bin/claude" "$HOME/.local/share/claude"
Check Homebrew and the current npm environment, if available
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
fi

Look 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.

This command permanently removes program files

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.

Uninstall the confirmed default native installation
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.

Uninstall the Homebrew claude-code cask
brew uninstall --cask claude-code

If 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.

Uninstall the Homebrew latest-channel cask
brew uninstall --cask claude-code@latest

Global 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.

Uninstall the global npm package
npm uninstall -g @anthropic-ai/claude-code

Repeat 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.

Claude Code data to review separately from the installation
LocationWhat it containsWhat to do
~/.claudeUser 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.jsonAccount-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 .claudeProject 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.jsonProject 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.

  1. 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.
  2. In Finder, press ⇧⌘G to open Go to Folder and inspect ~/.claude. Use Get Info to check its size. To find the separate ~/.claude.json file, open your home folder and press ⇧⌘. to show hidden files.
  3. 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.
Desktop and editor integrations can use the same directory

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

Check command resolution again in a new terminal
type -a claude

If 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.

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.