Fix 'command not found: claude' After Install

Written by Michael Lip · Solo founder of Zovo · $400K+ on Upwork · 100% JSS Join 50+ builders · More at zovo.one

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.

Get Claude Code Mastery — included in Zovo Lifetime →

16 CLAUDE.md templates · 80+ prompts · orchestration configs · workflow playbooks. $99 once, free forever.