Skip to content

Black Friday: 40% off. Purgy for $12 $20 with code Code , until Dec 12.

Get the deal
← Blog

How to Uninstall Claude Code on Mac Completely

Uninstalling Claude Code from a Mac
On this page
  1. First, find out how you installed it
  2. The uninstall command for each install method
  3. Remove Claude Code's settings and history
  4. How much space does Claude Code use?
  5. Questions about uninstalling Claude Code
  6. Where Purgy fits

Quick answer: Remove Claude Code the way you installed it. Homebrew: brew uninstall --cask claude-code. npm: npm uninstall -g @anthropic-ai/claude-code. Native installer: rm -f ~/.local/bin/claude, then rm -rf ~/.local/share/claude. Your settings and history are separate, in ~/.claude and ~/.claude.json.

Tested on: MacBook Air M1, 16 GB, macOS 27.0.1, on 19 November 2026. I checked where Claude Code and its files live on my Mac and what npm reports. I did not run the uninstall commands, because I use Claude Code every day. The commands come from Anthropic's setup documentation, which I read on the same day.

First, find out how you installed it

Claude Code can be installed three ways on a Mac: Anthropic's native installer, Homebrew or npm. Each has its own uninstall command, and the wrong one does nothing. To see which copy runs when you type claude, use:

type -a claude
ls -l "$(which claude)"

This is what mine showed, and it was not what I expected:

  • claude resolves to ~/.local/bin/claude.
  • That file is a link into ~/.local/lib/node_modules/@anthropic-ai/claude-code, a copy that reports version 2.1.303.
  • npm ls -g --depth=0 lists only npm itself. On this Mac npm's global folder is /opt/homebrew/lib, so npm uninstall -g would not have found this copy.
  • An older copy, version 2.1.263, sits in ~/.local/share/claude/versions. That is the folder the native uninstall command removes.

I do not know exactly how my Mac ended up with both. The lesson is practical: look at where claude really points before you run any uninstall command.

The uninstall command for each install method

These commands come from Anthropic's setup documentation. Run the one that matches your install.

How you installed itUninstall command
Native installerrm -f ~/.local/bin/claude, then rm -rf ~/.local/share/claude
Homebrewbrew uninstall --cask claude-code, or claude-code@latest if you chose that channel
npmnpm uninstall -g @anthropic-ai/claude-code

Afterwards, run which claude. It should print nothing. If claude still runs, Anthropic's documentation says to look for a second installation or a leftover shell alias.

Remove Claude Code's settings and history

Uninstalling the program does not remove your configuration. For that, Anthropic documents two more commands:

rm -rf ~/.claude
rm ~/.claude.json

Anthropic warns that this deletes your settings, allowed tools, MCP configurations and session history. If you might come back, move the folder somewhere instead of deleting it, for example mv ~/.claude ~/claude-backup.

Each project can also hold a .claude folder and a .mcp.json file. They are removed per project, from inside the project folder, with rm -rf .claude and rm -f .mcp.json.

The documentation adds one catch. The VS Code extension, the JetBrains plugin and the Claude desktop app also write to ~/.claude. If any of them is still installed, the folder comes back, so remove them first.

How much space does Claude Code use?

More than you might expect. On my Mac, ~/.claude is 1.0 GB, and ~/.claude.json is about 168 KB. The folder holds subfolders such as projects, plugins, backups and file-history. Anthropic says the commands above delete your settings and session history, and these names suggest where they live.

I also found a folder named claude-cli-nodejs in ~/Library/Caches. Anthropic's documentation does not mention it, and I did not test whether it needs removing.

To measure your own, run du -sh ~/.claude. Hidden folders like this one also count toward System Data in Storage settings, which this guide explains.

Questions about uninstalling Claude Code

These are the questions that come up most.

Will uninstalling delete my code?

No. The locations above belong to Claude Code. Your project files are not in them. The only Claude Code files inside a project are .claude and .mcp.json, if you created them.

Why does claude still run after I uninstalled it?

Either a second installation exists or a shell alias points at it, according to Anthropic. My Mac shows how that can happen: two copies, installed in two different places. Check type -a claude again after each removal.

How do I install it again?

Follow the install section of the same setup documentation. If you kept ~/.claude, Claude Code should find your settings and history there again.

Where Purgy fits

Claude Code is a command-line tool, so Purgy's Uninstall apps screen, which is for apps, is not the right tool for it. Use the commands above.

Purgy can show you how large the hidden folders are. Its Space map includes hidden folders, so ~/.claude appears with its size, next to your other developer folders and AI models. Anything you choose to remove goes to the Trash. See it with the free trial.