Skip to content
InnovateTechie
Claude Code

How to Uninstall Claude Code (macOS, Windows, Linux)

EdithBy Edith12 min read
Share
Terminal showing commands to uninstall Claude Code cleanly

Quick answer

Learn how to uninstall Claude Code fully on macOS, Windows, and Linux — remove the npm package or native install, then clean up ~/.claude leftovers.

Key takeaways

  • Check the install method first with which claude (macOS/Linux) or where.exe claude (Windows) — npm and native installs are removed differently.
  • An npm install is removed with npm uninstall -g @anthropic-ai/claude-code; a native install by deleting ~/.local/bin/claude and ~/.local/share/claude.
  • Removing the program alone keeps your login and settings — a full removal also deletes ~/.claude and ~/.claude.json, which logs you out and wipes local state.
  • On Windows the config lives at %USERPROFILE%\.claude, but an install inside WSL is really Linux and uses the ~/.claude paths instead.
  • Keep your project CLAUDE.md files — they're instructions you wrote, stored in your repositories, not part of the tool's own state.

To uninstall Claude Code, first find how you installed it, then remove it: for an npm global install run npm uninstall -g @anthropic-ai/claude-code, or use the native uninstaller. For a full removal, also delete the ~/.claude config folder. This guide shows how to uninstall Claude Code cleanly on macOS, Windows, and Linux.

Install paths and removal commands verified 31 July 2026 against Anthropic's Claude Code setup documentation.

Claude Code is Anthropic's terminal-based coding agent, and most of the time you want it running, not gone. But sometimes you do need to remove Claude Code — you're switching machines, troubleshooting a broken install, freeing up a global npm slot, or doing a clean reinstall to fix a stubborn bug. Whatever the reason, uninstalling it properly is a two-part job: remove the program itself, then decide how much of the leftover state you want to clean up.

Claude currently spans models like Opus 5, Sonnet 5, and Haiku 4.5, but none of that changes how you remove the tool — the steps below take under 30 seconds each and apply no matter which model you were running, and this guide is reviewed regularly so the commands and paths stay accurate.

The tricky part is that Claude Code can be installed in more than one way, and each way is removed differently. Delete the wrong thing and you'll either leave orphaned files behind or accidentally wipe your login and local project data. This article walks through how to uninstall Claude Code on every platform, what each leftover file does, and how to reinstall later if you change your mind. If you're not even sure what the tool is, our explainer on what Claude Code is is a good primer before you remove it.

Key takeaway

To uninstall Claude Code, first check how it was installed (which claude or where.exe claude): remove an npm global install with npm uninstall -g @anthropic-ai/claude-code or delete the native launcher, then delete the ~/.claude config folder for a full removal — each step takes under 30 seconds.

Step 1: How did you install Claude Code?

Run which claude on macOS or Linux, or where.exe claude on Windows. A path inside your Node global folder means an npm install; one under ~/.local/bin means the native installer. Each is removed differently.

Before you uninstall Claude Code, confirm how it got onto your system. There are two common paths: an npm global package or the native installer (a standalone binary). The removal command is different for each, so guessing wastes time.

The fastest check is to ask your shell where the claude command actually lives:

# macOS / Linux
which claude
 
# Windows (PowerShell)
where.exe claude

If the path points somewhere inside your Node.js global folder (often ending in node_modules/.bin/claude or a global npm prefix), you have an npm install. If it points to something like ~/.local/bin/claude, you used the native installer.

You can confirm the npm route directly by listing your global packages:

npm ls -g

If @anthropic-ai/claude-code shows up in that list, Claude Code was installed through npm. That package name is the one Anthropic currently ships, but package names can change over time — so treat it as illustrative and confirm the exact name in your own npm ls -g output or the official docs before you run the removal command. Getting this step right is what makes the rest of the uninstall clean instead of half-finished.

Step 2: Remove the Claude Code program

One command either way: npm uninstall -g @anthropic-ai/claude-code for the npm route, or delete the launcher at ~/.local/bin/claude plus ~/.local/share/claude for a native install. A command not found afterwards means success.

Once you know your install method, removal is a single command.

If you installed via npm, uninstall the global package:

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

Replace the package name with whatever npm ls -g actually showed if it differs. When it finishes, verify the command is gone:

claude --version   # should now report "command not found"
npm ls -g          # @anthropic-ai/claude-code should no longer appear

A "command not found" message here is success, not an error — it means the binary is gone. Because this install path depends on Node.js, it's worth understanding how the two relate; our guide to Node.js for Claude Code explains why the npm global folder matters.

If you used the native installer, there's usually a built-in uninstall path. Anthropic's native install drops a small binary into your local bin directory and its support files into a local data directory. To remove Claude Code that way on macOS, Linux, or WSL:

# remove the launcher on your PATH
rm -f ~/.local/bin/claude
 
# remove the native install's data directory
rm -rf ~/.local/share/claude

If Claude Code shipped a dedicated uninstall command in your version, prefer that — check the official documentation, since the exact paths and helper commands for the native installer can shift between releases. The point is the same either way: delete the launcher that sits on your PATH and the folder it runs from.

At this stage the program itself is gone, but your personal Claude Code state is not. That's the next decision.

Diagram comparing how to uninstall Claude Code by npm versus native install method

Step 3: Uninstall Claude Code fully by cleaning up leftover files

Removing the package leaves your state behind. Delete ~/.claude and ~/.claude.json to clear settings, cached credentials, and local project data, and strip any PATH line your shell profile added. That logs you out.

Removing the package does not remove everything. Claude Code keeps a per-user config and state directory, plus a few loose files, that survive an uninstall. If you want a truly clean removal — or a fresh start before reinstalling — you'll want to clear these too.

Here's what to remove and what each item actually holds:

What to removeCommand / pathNotes
npm global packagenpm uninstall -g @anthropic-ai/claude-codeRemoves the program if you installed via npm. Confirm the name with npm ls -g.
Native launcherrm -f ~/.local/bin/claudeOnly if you used the native installer, not npm.
Native data dirrm -rf ~/.local/share/claudeSupport files for the native install.
Config & state folderrm -rf ~/.claudeSettings, auth/session, local project data. Deleting this logs you out.
Loose config filerm -f ~/.claude.jsonTop-level config some versions write next to the folder.
Shell PATH / rc entriesedit ~/.zshrc, ~/.bashrc, ~/.profileRemove any line that added Claude Code to your PATH.
Project CLAUDE.mdyour reposYour own instructions — usually keep these.

The big one is ~/.claude. That directory is where Claude Code stores your settings, your cached credentials and login session, and local project data such as memory and history. To remove Claude Code's state completely:

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

Be honest with yourself before running that: deleting ~/.claude logs you out and wipes local Claude Code state on that machine. If you only wanted to uninstall the binary and plan to reinstall soon with the same setup, you can leave the folder in place and your login and preferences will still be there when you come back.

Two more cleanups finish the job. First, check your shell startup files (~/.zshrc, ~/.bashrc, ~/.profile, or the PowerShell profile) for any line that added Claude Code to your PATH, and delete it so your shell isn't pointing at a binary that no longer exists. Second, if you installed the VS Code extension, a JetBrains plugin, or the desktop app, remove those too — they also write to ~/.claude, so leaving one installed will silently recreate the folder the next time it runs.

Platform specifics: macOS, Windows, and Linux

macOS and Linux share ~/.claude with native files under ~/.local. Windows keeps the same data in your user profile. If you installed inside WSL you are really on Linux, so use the home-directory commands there instead.

The commands above cover macOS and Linux directly, since both use the same ~/.claude home-directory convention and the same npm tooling. A few platform notes are worth calling out.

macOS and Linux. Your config lives at ~/.claude, and some tooling also touches ~/.config. The native install uses ~/.local/bin and ~/.local/share. Everything is under your home directory, so no sudo is needed unless you originally installed npm packages as root (in which case removal needs the same elevated permission). On Linux specifically, the paths and shell-rc cleanup are identical; our Claude Code on Linux guide covers the install side if you want to reverse a fresh setup.

Windows. The config folder lives in your user profile at %USERPROFILE%\.claude, with a matching %USERPROFILE%\.claude.json. To uninstall Claude Code on Windows, run the same npm uninstall -g @anthropic-ai/claude-code, then remove the folder:

Remove-Item -Recurse -Force "$env:USERPROFILE\.claude"
Remove-Item -Force "$env:USERPROFILE\.claude.json"

Windows users often run Claude Code inside WSL, in which case you're really on Linux and should use the macOS/Linux commands instead. Our Claude Code on Windows walkthrough explains the native-versus-WSL split, which is exactly the distinction that decides which uninstall path applies.

Screenshot of platform-specific paths to remove Claude Code on macOS, Windows, and Linux

How do I reinstall Claude Code (or do a clean reinstall)?

Uninstall the program, delete ~/.claude and ~/.claude.json so no stale state carries over, then reinstall with the current official method. That three-step reset fixes most corrupted-config and credential problems.

A lot of people who search for how to uninstall Claude Code don't actually want it gone forever — they want a clean slate to fix a broken or misbehaving install. If that's you, the sequence is straightforward:

  1. Uninstall the program (npm or native, from Step 2).
  2. Clear ~/.claude (and ~/.claude.json) so no stale state carries over.
  3. Reinstall from scratch using the current official method.

That three-step reset resolves most "it worked yesterday" problems, because it throws away corrupted config and cached credentials along with the binary. We develop this site in Claude Code on native Windows, and the one time a stubborn config issue would not clear, this exact sequence is what fixed it — with one hard-won caveat specific to our setup. Because we run on native Windows rather than WSL, the folder that actually mattered was %USERPROFILE%\.claude, and our first attempt "failed" only because we had reflexively reached for the ~/.claude Linux path out of habit. Confirming with where.exe claude before we deleted anything is what told us which environment we were really in, and it is the step we would tell anyone to run first before they try to uninstall Claude Code on Windows. When you reinstall, follow the current Claude Code installation steps rather than an old cached command, since install methods evolve. If you were only chasing a version bug, note that you may not need to uninstall Claude Code at all — often updating Claude Code fixes it without a full teardown. And if your original problem was the native binary failing to appear, our note on the native binary not installed error is a faster fix than starting over.

A quick word of caution

Two traps: your project CLAUDE.md files are your own instructions and belong in your repos, not the cleanup list; and package names and paths shift between releases, so check the official docs before any recursive delete.

Two things are easy to get wrong. First, don't reflexively delete every CLAUDE.md file you find. Those are project-level instruction files you (or your team) wrote to guide the agent — they live in your repositories, not in the global config, and they're usually worth keeping even after you remove Claude Code. Deleting ~/.claude is about the tool's own state; your CLAUDE.md files are your content.

Second, remember that exact package names and paths can change between releases. This guide reflects the current, widely used layout, but the single most reliable source is Anthropic's own documentation. Before running any destructive rm -rf, it's worth a ten-second check against the official setup docs to confirm the paths still match your version. That habit is the difference between a clean uninstall and an afternoon of debugging.

Frequently Asked Questions

Run npm uninstall -g @anthropic-ai/claude-code, then verify with npm ls -g that the package is gone and claude --version reports "command not found". If you want a full removal, also delete the ~/.claude folder. Confirm the exact package name in your own npm ls -g output first, since it can change.

Not by itself. The npm uninstall (or native removal) only deletes the program — your login, settings, and local project state stay in ~/.claude. You're only logged out and reset once you delete that folder. So a plain uninstall lets you reinstall later with everything intact; a full cleanup wipes the slate.

~/.claude is Claude Code's per-user directory holding settings, cached credentials, your session, and local project data like memory and history. It's safe to delete when you want to fully remove Claude Code or force a clean reinstall — nothing outside the tool depends on it. Just know that deleting it logs you out and erases that local state.

Run npm uninstall -g @anthropic-ai/claude-code in PowerShell, then remove %USERPROFILE%\.claude and %USERPROFILE%\.claude.json. If you installed Claude Code inside WSL, treat it as Linux and use the ~/.claude home-directory commands instead. Check where.exe claude first to confirm which environment holds the binary.

Usually no. CLAUDE.md files are project instructions you wrote, stored in your repositories rather than in the global config. Removing Claude Code doesn't require deleting them, and they're valuable if you ever reinstall. Only delete a CLAUDE.md if you specifically no longer want those instructions in that project.

Uninstall the program, delete ~/.claude (and ~/.claude.json) to clear stale state, then reinstall using the current official method. This full reset fixes most corrupted-config or credential problems that a simple reinstall wouldn't. Verify the paths against the official Claude Code docs before deleting anything, since layouts can change between versions. For the mechanics of removing an npm global package, the npm uninstall reference is the authoritative source.
Edith

Written by

Edith

Writing about Claude and the Anthropic toolkit — models, Claude Code, pricing, features, and fixes, in clear, practical, hands-on guides tested by daily use.

View all posts →