Field note
Claude Code Command Not Found: Install Fix
If the terminal says claude is not found straight after installing, the binary is almost always there and the shell simply cannot see it yet.
If the terminal says claude is not found straight after installing, the binary is almost always there and the shell simply cannot see it yet.
The symptoms
The installer finishes without complaint. You type claude and get one of these:
| Platform | Message |
|---|---|
| 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 |
| Windows PowerShell | claude : The term 'claude' is not recognized as the name of a cmdlet |
A related symptom is claude running but printing Error: claude native binary not installed. That is an npm-specific problem covered below.
Likely causes, most common first
- The install directory is not on your PATH. The native installer puts the binary at
~/.local/bin/claudeon macOS and Linux, and at%USERPROFILE%\.local\bin\claude.exeon Windows. If that folder is not in your shell's search path, the shell cannot find it. - You have not opened a new terminal. PATH changes made by the installer apply to new shells, not the one already open.
- The wrong shell startup file. On macOS, Terminal starts bash as a login shell, which reads
~/.bash_profileand ignores~/.bashrc. A PATH line in the wrong file never runs. - Only the VS Code extension is installed. The extension bundles its own private copy of the CLI and does not add
claudeto your PATH. You still need the standalone install for the terminal. - Conflicting installations. An old npm global install, a legacy install under
~/.claude/local/and a Homebrew cask can coexist and shadow each other. - An incomplete npm install. If npm ran with
--ignore-scriptsor--omit=optional, the native binary never downloaded andclaudeis a placeholder script. - The wrong Windows shell. The PowerShell command uses
irm; the CMD command usescurl. Run the wrong one and the install never happens.
Step-by-step fix
-
Open a new terminal window and try
claude --versionagain. If it prints a version, you are done. -
Check whether the install folder is on your PATH:
echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"On PowerShell use
$env:PATH -split ';' | Select-String '\.local\\bin'. -
If nothing prints, add the folder. For zsh on macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrcFor bash on Linux use
~/.bashrc; for bash on macOS use~/.bash_profile. On Windows, add%USERPROFILE%\.local\binto the user PATH through Environment Variables, or with[Environment]::SetEnvironmentVariablein PowerShell, then restart the terminal. -
Look for duplicate installs with
which -a claude(orwhere.exe claudeon Windows). Keep the native install and remove the others:npm uninstall -g @anthropic-ai/claude-code,rm -rf ~/.claude/local,brew uninstall --cask claude-codeorwinget uninstall Anthropic.ClaudeCodeas appropriate. -
If you see the native binary error after an npm install, reinstall without the flags that skipped optional dependencies or scripts, or run
node node_modules/@anthropic-ai/claude-code/install.cjs. Simpler still, switch to the native installer. -
If the installer itself failed with a permission error, make sure
~/.local/binand~/.claudeare writable by your user. Do not run the installer withsudo; it creates root-owned files that break later updates. -
Confirm with
claude --version, then runclaude doctorfor a full check of the installation and PATH.
What IT should check on managed devices
- Proxy and TLS. An install script that returns HTML instead of a shell script means the proxy intercepted the download. Allow the Claude download domains through the proxy or install from the package manager that already works on your estate.
- Package source. Homebrew and WinGet installs do not auto-update; the native install does. Decide which you want on managed laptops and write it down, because a mix produces version drift and hard-to-reproduce bugs.
- Corporate npm mirrors. If developers install through npm behind a private registry, the mirror must carry all the per-platform
@anthropic-ai/claude-code-*packages, not just the main package. - Write access. Locked-down profiles that prevent writes to the user's home directory will block the installer. The fix is a writable per-user location, not an admin account.
- Version floor. Teams that want consistency can set
autoUpdatesChannelandminimumVersionin settings, and enforce them through managed settings.
Getting the install right is the boring first hour of a rollout. Our Claude Code workshop starts from a repository where every developer has a working, consistent install, because nothing else in the workflow holds up otherwise.
When to escalate to the vendor
If claude --version works but sessions misbehave, the problem is not the install; check authentication errors next. If the binary genuinely will not run on a supported platform after the steps above, open an issue on the Claude Code GitHub repository with your operating system, the exact install command and the full error output. Account and subscription problems go to Anthropic support through the Get help menu at claude.ai instead.