← Blog · 2026-10-23
Claude Code Command Not Found? 12 Causes and Fixes
30-second test: open a brand-new terminal window and run
claude --version. If it prints something like2.1.211 (Claude Code), you're done and the old window just had a stale PATH (cause 2). If it still says not found, runls -la ~/.local/bin/claude(Windows PowerShell:Test-Path "$env:USERPROFILE\.local\bin\claude.exe"). A file there means a PATH problem: start at cause 1. No file means Claude Code never installed: start at cause 6.
The native installer puts claude at ~/.local/bin/claude on macOS and Linux and at %USERPROFILE%\.local\bin\claude.exe on Windows. Your shell only finds programs in folders listed in PATH, so most "command not found" problems are that folder missing from PATH, a terminal that hasn't picked up the change, or an install that quietly didn't finish.
The error looks different on each platform, but it's the same problem:
- macOS:
zsh: command not found: claude - Linux:
bash: claude: command not found - Windows CMD:
'claude' is not recognized as an internal or external command - PowerShell:
claude : The term 'claude' is not recognized as the name of a cmdlet
Installed, but the shell can't find it: 5 causes
~/.local/binisn't in your PATH. The installer tells you so underSetup notes:withNative installation exists but ~/.local/bin is not in your PATH., but it doesn't change PATH for you. Check withecho $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin". No output means it's missing. Fix for Zsh (the macOS default):echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcthensource ~/.zshrc. For Bash on Linux: the same two lines with~/.bashrc. For Bash on macOS: use~/.bash_profile, because Terminal starts Bash as a login shell that ignores~/.bashrc(if you already have~/.bash_loginor~/.profileand no~/.bash_profile, put the line there instead). On Windows PowerShell:$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')then[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User'), and restart the terminal. In CMD, add%USERPROFILE%\.local\binto your User PATH in Environment Variables.- The terminal is older than the fix. A window that was already open keeps its old PATH, and a terminal inside VS Code, Cursor or JetBrains takes its PATH from the editor. Open a new window, or quit and reopen the whole editor, not just its terminal panel. This is also why
claudeisn't found right after a Homebrew, WinGet or PowerShell install: the session you installed from still has the old PATH. - The PATH line never got saved, or went to the wrong file. Run
grep -n '.local/bin' ~/.zshrc(use your shell's file). No output means the line isn't there: run the two commands again. Runecho $0to see which shell you're actually in; adding the line to~/.bashrcdoes nothing if you use Zsh. If theechoprintedzsh: permission denied: /Users/you/.zshrcorbash: /home/you/.bashrc: Permission denied, nothing was saved: check the owner withls -l ~/.zshrc, thensudo chown $(whoami) ~/.zshrcif it's owned byroot, orchmod u+w ~/.zshrcif it's yours but read-only. Fish and Nushell users need their own shell's PATH syntax. - You only installed the VS Code extension. The extension bundles a private copy of the CLI for its own chat panel and doesn't add it to PATH, so
~/.local/bin/claudewon't exist. To useclaudein a terminal, run the standalone install too:curl -fsSL https://claude.ai/install.sh | bashon macOS, Linux and WSL, orirm https://claude.ai/install.ps1 | iexin PowerShell. - Windows:
claude.exevanished right after an update. To update, Claude Code renamesclaude.exeto a backup and moves the new one in. If that move fails, the folder can be left with only a file namedclaude.exe.old.<timestamp>. Restore it in PowerShell withGet-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe, then runclaude --version. If there's no backup, rerunirm https://claude.ai/install.ps1 | iex. A related Windows case: an older Claude Desktop can register aClaude.exeinWindowsAppsthat wins on PATH, so typingclaudeopens the Desktop app. Update Claude Desktop.
It never actually installed: 4 causes
- You ran the install command for the wrong shell.
'irm' is not recognizedmeans you're in CMD: open PowerShell, or use the CMD installercurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd.The token '&&' is not a valid statement separatormeans you ran that CMD command in PowerShell.A parameter cannot be found that matches parameter name 'fsSL'or'bash' is not recognizedmeans you ran the macOS/Linux command on Windows. If the command printed the script's text and nothing installed, you ran only half of it:irmmust be piped toiex, and in CMDcurlneeds the-o install.cmdpart. - The installer downloaded a web page instead of the script. You'll see
syntax error near unexpected token '<'in Bash,< was unexpected at this timein CMD,System.Xml.XmlDocumentor HTML-filled parse errors in PowerShell, or a barecurl: (22) The requested URL returned error: 403. If the output mentions "App unavailable in region", Claude Code isn't available in your country. Otherwise test the download host withcurl -sI https://downloads.claude.ai/claude-code-releases/latest(Windows:curl.exe -sI ...): a200means it's reachable and the failure was probably temporary, so retry;403usually means a proxy or filter; no output orCould not resolve hostmeans your network blocks it. Behind a corporate proxy, setHTTPS_PROXYandHTTP_PROXYbefore installing. On macOS,brew install --cask claude-codeis an alternative, and on Windowswinget install Anthropic.ClaudeCode; note that neither updates itself by default. - The install was killed or ran out of permissions.
KilledorInstallation was killed before it could finish (exit code 137)on Linux almost always means the server ran out of memory: installing needs about 512 MB free, and Claude Code needs at least 4 GB of RAM to run. Add a 2 GB swap file (sudo fallocate -l 2G /swapfile,sudo chmod 600 /swapfile,sudo mkswap /swapfile,sudo swapon /swapfile) and rerun the installer.EACCES: permission deniedmeans a target folder isn't writable: check withtest -w ~/.local/bin && echo writable, and fix withsudo mkdir -p ~/.local/binandsudo chown -R $(whoami) ~/.local. In Docker, setWORKDIR /tmpbefore the install line, because running it from/makes it scan the whole filesystem and hang. - TLS errors stopped the download.
curl: (35) TLS connect error,Could not create SSL/TLS secure channelorunable to get local issuer certificatemean the secure connection failed. Update your CA certificates (sudo apt-get install ca-certificateson Ubuntu/Debian). In Windows PowerShell 5.1, enable TLS 1.2 with[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12and rerun the installer in that window. Behind a TLS-inspecting proxy, pass its CA withcurl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash, then setNODE_EXTRA_CA_CERTSto the same file for Claude Code itself.
npm, duplicate and platform problems: 3 causes
- Two installs are fighting. An npm global install, a legacy
~/.claude/local/install from older versions, Homebrew and the native install can all coexist and give you the wrong version or a broken one. List them withwhich -a claude(Windows:where.exe claude), plusls -la ~/.claude/local/andnpm -g ls @anthropic-ai/claude-code. Keep one, ideally the native install, and remove the rest:npm uninstall -g @anthropic-ai/claude-code,rm -rf ~/.claude/local,brew uninstall --cask claude-codeorwinget uninstall Anthropic.ClaudeCode. - The npm install left a placeholder.
Error: claude native binary not installedmeans npm skipped the per-platform optional package or its postinstall script. Remove--omit=optional(pnpm--no-optional, yarn--ignore-optional), check.npmrcdoesn't setoptional=false, and reinstall. If you used--ignore-scripts, runnode node_modules/@anthropic-ai/claude-code/install.cjs. In PowerShell,running scripts is disabled on this systemblocks npm's.ps1launchers: runSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or callclaude.cmd.npm error code ENOTEMPTYduring a reinstall means a leftover folder: delete the directory named on thenpm error pathline and any.claude-code-*folders next to it, then reinstall. In WSL,exec: node: not foundmeans you're using Windows Node from/mnt/c/; install Node inside Linux with your package manager or nvm. - The binary doesn't fit your system. These show up as errors when you run
claude, not as "not found", but they're often mistaken for a failed install.cannot execute binary file: Exec format errorin WSL means WSL1: convert withwsl --set-version <DistroName> 2.Error loading shared library libstdc++.so.6means the musl/glibc variant is wrong; on Alpine runapk add libgcc libstdc++ ripgrep.Illegal instructionmeans the wrong architecture or a CPU without AVX (checkuname -mandgrep -m1 -ow avx /proc/cpuinfo).dyld: Symbol not foundorAbort trap: 6on a Mac means macOS is older than 13.0.Claude Code does not support 32-bit Windowson a 64-bit PC means you openedWindows PowerShell (x86); use the entry without x86.
Still stuck?
Once claude --version works, claude doctor gives an automated report for anything else, and Auto-update failed · Run claude doctor in the footer is best fixed by running claude update in your shell. If the command runs but sign-in fails, see Claude Code login not working. If it starts but ignores your config, settings not applying shows which file each key belongs in, and if your editor can't see it, try IDE not connecting.
Facts on this page come from Anthropic's Claude Code docs on troubleshooting installation and login and setup. This guide isn't affiliated with Anthropic.
Once claude runs, set it up properly in one go: our Claude Code Power Config Pack has 6 CLAUDE.md templates, permission presets and 8 tested safety hooks, $6 with the launch code while it lasts.