[BUG] The CLI reports that the Claude command is not found but still works
Resolved 💬 17 comments Opened Aug 5, 2025 by kud Closed Nov 10, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.68 (Claude Code)
- Operating System: macOS 15.5
- Terminal: iTerm2
Bug Description
The CLI reports that the Claude command is not found at /Users/xxx/.local/bin/claude, and indicates that ~/.local/bin is not in the PATH, despite the command working from /opt/homebrew/bin/claude.
Steps to Reproduce
- Try running the
claudecommand from the terminal. - Observe the error message stating the command is not found in the specified directory.
- However, using
which claudeshows it working from/opt/homebrew/bin/claude.
Expected Behavior
The claude command should execute without error, given that it works from /opt/homebrew/bin and is symlinked correctly.
Actual Behavior
An error message appears stating that the command is not found at /Users/xxx/.local/bin/claude and suggests adding ~/.local/bin to the PATH, though it isn't the correct directory for this command.
Additional Context
- Error message details:
Claude command not found at /Users/mest001/.local/bin/claude~/.local/bin is not in your PATH- Suggests adding it to the PATH using
export PATH="~/.local/bin:$PATH" - The
which claudecommand confirms it works from/opt/homebrew/bin/claude. - The symlink details:
``shell``
/opt/homebrew/bin/claude ⇒ ../lib/node_modules/@anthropic-ai/claude-code/cli.js
- Additional terminal output suggests network issues with connection errors and retries.
- It was installed via npm.
17 Comments
Found 3 possible duplicate issues:
If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
Hey there.
Is there any reason why we need Claude in
.local/bin?I've set my npm prefix that way, Claude works well but I still have the message.
Also reporting the same; using claude with NPM installed globally, i.e.
however Claude still works fine.
Possible solution: show npm error in claude? I had the same issue that was caused by a wrong .npmrc config
Same problem. Running in WSL2. Nothing in my PATH referencing any claude folders. Seems to be working fine otherwise.
@jim5359
If you are seeing
● Claude command not found at /Users/[your_user]/.local/bin/claude, then:claude config get --global installMethodoutside claude code/doctorinside claude.If your installMethod shows as "native" and claude doctor command shows
Config install method: npm, then:claude config set --global installMethod npmMy guess is that this happens when you tried switching from npm installation to native without noticing some claude session was still running which messes up the configuration.
@mrns This did the trick!
@mrns Thanks for the tip. For me, ironically, it turns out turning off WSL support solved the problem, even though I'm using WSL. The WSL support allows specifying the exact location of the binaries, but apparently it didn't work in my setup and turning it off did.
@jim5359 's suggestion did not resolve this for me. I'm using Homebrew to install claude and I have installMethod set to homebrew. I still get:
● Native installation exists but ~/.local/bin is not in your PATH.Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >>
~/.config/zsh/.zshrc && source ~/.config/zsh/.zshrc
When I launch Claude and running
/doctorwithin claude shows:Running
claude installof course installs claude in~/.local/binbut that is not what I want. Any other suggestions on how to get rid of the false error?I had initially used the native installer and switched to npm, I resolved this by updating
"installMethod": "native",to"installMethod": "npm",in~/.claude.jsonCan you please provide a working brew installation? This is getting ridiculous. Why would I use npm to install it? npm sucks big time
Yeah, I am getting the same issue, there is no
configoption anymore, install viabrewon Mac:What does "native" even mean in this context? Claude code stopped working for me randomly, I suspect because of some auto-update mechnism, and I'm trying to diagnose it. I don't see anything other than an npm installation instruction in the readme. My install says my "installMethod is native" but can't find the binary, and
/doctorsays I have multiple installations but doesn't tell me what to do about that.Edit for anyone else that might be running into this. The readme doesn't link to this advanced instructions page, which has other setup methods. I have no clue how mine got screwed up though. Just suddenly stopped working.
Upgrading the claude-code formula in brew fixed this for me.
Yeah I don't have the issue anymore too.
This work for me too, thanks
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.