Fix 'command not found (2026)

The Error

After running the Claude Code installer, you get one of these errors when trying to run claude:

zsh: command not found: claude
bash: claude: command not found
'claude' is not recognized as an internal or external command
claude : The term 'claude' is not recognized as the name of a cmdlet

Quick Fix

The installer places the claude binary at ~/.local/bin/claude. Add that directory to your PATH:

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

On Windows PowerShell:

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Restart your terminal, then verify:

claude --version

What’s Happening

The Claude Code installer downloads the binary to ~/.local/bin/claude on macOS and Linux, or %USERPROFILE%\.local\bin\claude.exe on Windows. Your shell searches for programs in directories listed in the PATH environment variable. If ~/.local/bin is not in your PATH, the shell cannot find the claude command even though the binary exists on disk.

This is the most common installation issue and affects all platforms equally. The installer adds a note about updating PATH, but if you close the terminal or miss the message, the next session will not find the binary.

Step-by-Step Fix

Step 1: Confirm the binary exists

Check that the installer actually placed the binary:

ls -la ~/.local/bin/claude

On Windows:

Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

If the file does not exist, the installation did not complete. Re-run the installer.

Step 2: Check your current PATH

See if ~/.local/bin is already in your PATH:

echo $PATH | tr ':' '\n' | grep local/bin

On Windows:

$env:PATH -split ';' | Select-String 'local\\bin'

If there is no output, the directory is missing from PATH.

Step 3: Add to PATH permanently

On macOS (default shell is zsh):

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

On Linux (default shell is bash):

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

On Windows PowerShell:

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Restart your terminal after the Windows change.

Step 4: Check for conflicting installations

If you previously installed Claude Code via npm, you may have multiple binaries:

which -a claude

Check for an npm global installation:

npm -g ls @anthropic-ai/claude-code 2>/dev/null

If you find duplicates, remove the extra installations. The native install at ~/.local/bin/claude is recommended:

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

On macOS, remove a Homebrew install if present:

brew uninstall --cask claude-code

Step 5: Verify the fix

claude --version

You should see the Claude Code version number.

Prevention

After any fresh install, verify immediately:

claude --version

If you use a shell configuration manager like oh-my-zsh or starship, ensure your PATH modifications load before other plugins that might reset PATH. Place the export PATH line near the top of your shell configuration file.

For teams, add the PATH requirement to your onboarding documentation. Alternatively, use Homebrew on macOS or WinGet on Windows, which handle PATH automatically:

# macOS/Linux
brew install --cask claude-code
# Windows
winget install Anthropic.ClaudeCode

Level Up Your Claude Code Workflow

The developers who get the most out of Claude Code aren’t just fixing errors — they’re running multi-agent pipelines, using battle-tested CLAUDE.md templates, and shipping with production-grade operating principles.


**Written by Michael** — solo dev, Da Nang, Vietnam. 50K+ Chrome extension users. $500K+ on Upwork (100% Job Success). Runs 5 Claude Max subs in parallel. Built this site with autonomous agent fleets. [See what I'm building →](https://zovo.one)

This took me 3 hours to figure out. I put it in a CLAUDE.md so I'd never figure it out again. Now Claude gets it right on the first try, every project. 16 framework templates. Next.js, FastAPI, Laravel, Rails, Go, Rust, Terraform, and 9 more. Each one 300+ lines of "here's exactly how this stack works." Copy into your project. Done. **[See the templates →](https://zovo.one/lifetime?utm_source=ccg&utm_medium=cta-config&utm_campaign=claude-code-command-not-found-after-install-fix)** $99 once. Yours forever. I keep adding templates monthly.

Find the right skill → Browse 155+ skills in our Skill Finder.

Find commands → Search all commands in our Command Reference.

Try it: Paste your error into our Error Diagnostic for an instant fix.

See Also

Common Questions

What causes fix ‘command not found issues?

Common causes include misconfigured settings, outdated dependencies, and environment conflicts. Check your project configuration and ensure all dependencies are up to date.

How do I prevent this error from recurring?

Set up automated checks in your development workflow. Use Claude Code’s built-in validation tools to catch configuration issues before they reach production.

Does this fix work on all operating systems?

The core fix applies to macOS, Linux, and Windows. Some path-related adjustments may be needed depending on your OS. Check the platform-specific notes in the guide above.