zsh: command not found: claude - the actual fix

The binary is almost always still on your disk. This is a PATH problem, and there are six causes in a clear order of likelihood.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Claude Code is installed and your shell cannot find it. The native installer writes the binary to ~/.local/bin/claude on macOS and Linux and to %USERPROFILE%\.local\bin\claude.exe on Windows, and that directory is not on your PATH. Open a new terminal first, because the installer edited your shell profile and an already-open shell never re-read it. If that does not work, add the install directory to your profile by hand. The remaining causes are an npm install whose Node prefix moved, a duplicate install, an npm package whose native binary never downloaded, and the VS Code extension, which never puts claude on PATH at all.

What you need to know
  • The binary is almost certainly still installed. This is a PATH problem.
  • The native installer path is ~/.local/bin/claude, or %USERPROFILE%\.local\bin\claude.exe on Windows.
  • Cause one: the terminal predates the install. Open a new one.
  • The VS Code extension bundles a private copy and never adds claude to PATH.
  • An npm global install disappears when Node changes prefix. Move to the native install.
  • which -a claude finds duplicates, which is the other half of this problem.

The thirty-second answer

Your shell searches only the directories in PATH. The installer put claude somewhere that is not in yours, or put it there after your terminal had already read its profile. Nothing is corrupted and nothing needs reinstalling until you have checked both.

The same failure, worded differently by each shell.

PlatformWhat you see
macOS (zsh)zsh: command not found: claude
Linux (bash)bash: claude: command not found
Windows CMD'claude' is not recognized as an internal or external command
PowerShellclaude : The term 'claude' is not recognized as the name of a cmdlet
Run all of these. The first that prints a path tells you where it is.
which -a claude
command -v claude

# the four places a claude binary can live
ls -la ~/.local/bin/claude            2>/dev/null   # native installer
ls -la ~/.claude/local/               2>/dev/null   # legacy local npm install
npm -g ls @anthropic-ai/claude-code   2>/dev/null   # npm global
ls -la /opt/homebrew/bin/claude       2>/dev/null   # Homebrew cask

# still nothing? search for it
find ~ -name claude -type f -maxdepth 6 2>/dev/null | head
ResultCauseGo to
find located itNot on PATHFix 1, then Fix 2
which -a prints two or moreConflicting installsFix 3
It is under an old Node versionNode prefix movedFix 4
claude exists but errors on launchnpm postinstall never ranFix 5
Nothing anywhereNot installed, or the install failedFix 6
The shell only searches PATH, and the binary is usually installed somewhere elseTHE SHELL ONLY LOOKS IN PATH/usr/local/bin/usr/bin/bin/opt/homebrew/binadd this directory, then reopen the shellfirst match wins~/.local/bin/claudenative installer. this is the one to put on PATH$(npm root -g)/@anthropic-ai/claude-codemoves when your Node prefix moves~/.claude/local/legacy npm install. safe to removethe VS Code extension directorya private copy, never added to PATHwhich -a claude prints every copy. Two on PATH is the other half of this problem.

Where Claude Code actually installs

Knowing the four locations turns this from guesswork into a lookup. Anthropic recommends the native install, and as of August 2026 it is the only one auto-update maintains cleanly.

Install methods and the paths they use, as of August 2026.

Install methodBinary lands atNotes
Native installer (install.sh, install.ps1)~/.local/bin/claude, or %USERPROFILE%\.local\bin\claude.exeA symlink into ~/.local/share/claude/versions/. Recommended.
Homebrew caskThe Homebrew prefix on your PATHbrew install --cask claude-code
WinGet%USERPROFILE%\.local\binwinget install Anthropic.ClaudeCode
npm globalUnder npm root -gMoves whenever your Node prefix moves
Legacy local npm~/.claude/local/Created by older versions. Safe to remove.
VS Code extensionInside the extension directoryNever added to PATH. See below.

Fix 1: open a new terminal

The installer appends an export to your shell profile, and a terminal that was already open never re-reads it. This is the single most common cause and the reason so many people hit this immediately after a successful install.

exec $SHELL -l      # or just close the window and open a new one
claude --version    # prints something like 2.1.211 (Claude Code)

Fix 2: put the install directory on PATH

macOS and Linux. Check first, then add.
# is it already there?
echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"

# zsh (the macOS default)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# bash (most Linux distributions)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# fish
fish_add_path ~/.local/bin

claude --version
Windows PowerShell. Restart the terminal afterwards.
# is it already there?
$env:PATH -split ';' | Select-String '\.local\\bin'

# add it to the User PATH permanently
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

claude --version

Fix 3: you have more than one install

Two installs produce the stranger version of this bug: claude resolves, but to the wrong copy, so it reports an old version, ignores your settings, or works in one shell and not another. Keep exactly one.

Remove everything except the native install.
which -a claude                              # every claude on your PATH

npm uninstall -g @anthropic-ai/claude-code   # npm global
rm -rf ~/.claude/local                       # legacy local npm install
brew uninstall --cask claude-code            # Homebrew, macOS

curl -fsSL https://claude.ai/install.sh | bash
exec $SHELL -l
claude doctor

Fix 4: it vanished after a Node upgrade

This is the characteristic failure of the global npm install. Claude Code worked for weeks, you upgraded Node with nvm, Homebrew, or an installer, and the command disappeared. Nothing is corrupted. The package sits under the previous Node version prefix, which is no longer on your PATH.

# where do global packages live now?
npm root -g
ls "$(npm root -g)"          # is @anthropic-ai/claude-code there?

# using nvm? check the other versions
nvm ls
ls ~/.nvm/versions/node/*/lib/node_modules/@anthropic-ai 2>/dev/null

Fix 5: npm installed it but the binary never landed

The npm package is a thin wrapper. It downloads the real binary as a per-platform optional dependency, then a postinstall script copies it into place. If either step is skipped, claude exists as a placeholder script and running it prints this:

Error: claude native binary not installed.

Either postinstall did not run (--ignore-scripts, some pnpm configs)
or the platform-native optional dependency was not downloaded
(--omit=optional).
CauseFix
--omit=optional, --no-optional, optional=false in .npmrcRemove it and reinstall. There is no JavaScript fallback.
--ignore-scripts, or a pnpm config that skips postinstallRun node node_modules/@anthropic-ai/claude-code/install.cjs
Corporate npm mirrorMirror all eight @anthropic-ai/claude-code-* platform packages, not just the meta package
Unsupported platformPrebuilt binaries cover darwin, linux (glibc and musl), and win32 on x64 and arm64 only

Fix 6: it genuinely is not installed

macOS and Linux.
curl -fsSL https://claude.ai/install.sh | bash
exec $SHELL -l
claude doctor
Windows. Then open a NEW terminal.
irm https://claude.ai/install.ps1 | iex

Neighbouring errors and what they actually are.

You seeIt is
syntax error near unexpected token '<'The install URL returned an HTML page. Use Homebrew or WinGet.
A parameter cannot be found that matches parameter name 'fsSL'The macOS command run in PowerShell. Use irm ... | iex.
&& is not validThe CMD command run in PowerShell. Same fix.
running scripts is disabled on this systemPowerShell execution policy blocking npm shims. Use the native installer.
cannot execute binary file: Exec format errorWSL1. Convert to WSL2 with wsl --set-version <Distro> 2.
claude opens the Claude desktop app on WindowsAn old Claude Desktop registered Claude.exe in WindowsApps. Update it.
codex: command not foundSame class of problem, different CLI. See the Codex guide.

Questions people ask

Open a new terminal first, since the installer edited your shell profile and an already-open shell never re-read it. If that fails, check whether ~/.local/bin is on your PATH with echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin", and add export PATH="$HOME/.local/bin:$PATH" to ~/.zshrc if it is missing.

The native installer puts it at ~/.local/bin/claude on macOS and Linux, as a symlink into ~/.local/share/claude/versions/, and at %USERPROFILE%\.local\bin\claude.exe on Windows. An npm global install lives under npm root -g, an older local npm install under ~/.claude/local/, and a Homebrew install in the Homebrew prefix.

A global npm install lives under the Node version prefix that was active when you installed it. Upgrading Node changes that prefix, so the command falls off your PATH. Rather than reinstalling under the new version, remove the npm install and use the native binary, which does not depend on Node.

The extension bundles a private copy of the CLI for its own chat panel and does not add it to your PATH by design, so ~/.local/bin/claude will not exist. Run the standalone install to get claude in a terminal.

Your PATH export sits in an interactive-only file such as .zshrc or .bashrc. Move it to ~/.zprofile or ~/.profile, which login shells read, and the integrated terminal will pick it up.

The npm package downloaded but its platform-specific binary did not, or the postinstall script that copies it into place was skipped. Reinstall without --omit=optional or --ignore-scripts, or run node node_modules/@anthropic-ai/claude-code/install.cjs.

An older Claude Desktop registered a Claude.exe in the WindowsApps directory, which takes PATH priority over the CLI. Updating Claude Desktop to the current version resolves it.

No. It creates root-owned files in your npm tree that break every later install for your user, with errors that point nowhere near the cause. Make ~/.local writable instead: sudo mkdir -p ~/.local/bin && sudo chown -R $(whoami) ~/.local.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code: troubleshoot installation and login
  2. Claude Code setup and install
  3. Claude Code CLI reference
Try it

No PATH,
no problem.

Continuum launches the CLIs through resolved absolute binary paths with an explicit environment, not your shell PATH, removing this class of failure.

free app · your subscriptions · local-first