Skip to content

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:

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 PowerShellclaude : 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

  1. The install directory is not on your PATH. The native installer puts the binary at ~/.local/bin/claude on macOS and Linux, and at %USERPROFILE%\.local\bin\claude.exe on Windows. If that folder is not in your shell's search path, the shell cannot find it.
  2. You have not opened a new terminal. PATH changes made by the installer apply to new shells, not the one already open.
  3. The wrong shell startup file. On macOS, Terminal starts bash as a login shell, which reads ~/.bash_profile and ignores ~/.bashrc. A PATH line in the wrong file never runs.
  4. Only the VS Code extension is installed. The extension bundles its own private copy of the CLI and does not add claude to your PATH. You still need the standalone install for the terminal.
  5. Conflicting installations. An old npm global install, a legacy install under ~/.claude/local/ and a Homebrew cask can coexist and shadow each other.
  6. An incomplete npm install. If npm ran with --ignore-scripts or --omit=optional, the native binary never downloaded and claude is a placeholder script.
  7. The wrong Windows shell. The PowerShell command uses irm; the CMD command uses curl. Run the wrong one and the install never happens.

Step-by-step fix

  1. Open a new terminal window and try claude --version again. If it prints a version, you are done.

  2. 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'.

  3. If nothing prints, add the folder. For zsh on macOS:

    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc
    

    For bash on Linux use ~/.bashrc; for bash on macOS use ~/.bash_profile. On Windows, add %USERPROFILE%\.local\bin to the user PATH through Environment Variables, or with [Environment]::SetEnvironmentVariable in PowerShell, then restart the terminal.

  4. Look for duplicate installs with which -a claude (or where.exe claude on Windows). Keep the native install and remove the others: npm uninstall -g @anthropic-ai/claude-code, rm -rf ~/.claude/local, brew uninstall --cask claude-code or winget uninstall Anthropic.ClaudeCode as appropriate.

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

  6. If the installer itself failed with a permission error, make sure ~/.local/bin and ~/.claude are writable by your user. Do not run the installer with sudo; it creates root-owned files that break later updates.

  7. Confirm with claude --version, then run claude doctor for 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 autoUpdatesChannel and minimumVersion in 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.

Source basis

Keep reading

Related notes

26 Aug 2026 · 5 min

Claude Code Hooks: Put Checks Before the Merge

A review gate built from Claude Code hooks runs the same cheap checks on every agent action, so the human reviewer only sees diffs that have already passed the boring tests.

26 Aug 2026 · 5 min

Claude Code MCP Security Checklist

Every MCP server you attach to Claude Code adds a new set of tools, a new credential and a new source of untrusted text, so review each one the way you would review a supplier integration.