claude doctor false positive: "~/.local/bin is not in your PATH" when it IS in PATH (own install dir stripped from spawned-shell PATH)
Summary
claude doctor (and the startup health check) reports:
⚠ Native installation exists but ~/.local/bin is not in your PATH
└ Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc ...
…even though ~/.local/bin is in PATH. The warning reappears on every launch, including freshly launched sessions, and the suggested .zshrc edit does not silence it (because the line is already present and is not what the check reads).
Environment
- Claude Code: 2.1.163 (also reproduced on 2.1.162) — native install (
~/.local/bin/claude→~/.local/share/claude/versions/<ver>) - OS: macOS (Darwin 25.3.0), shell: zsh, Apple Terminal
~/.local/binis present in both~/.zshenvand~/.zshrcasexport PATH="$HOME/.local/bin:...:$PATH"
Evidence the warning is a false positive
~/.local/bin is in PATH in every layer that matters:
- Interactive shell:
echo $PATH | tr ':' '\n' | grep '.local/bin'→ present - The live
claudeprocess env (ps eww -p <pid>): present - Every running
claudeprocess (old 2.1.162 and fresh 2.1.163): present - Fresh login shells (
zsh -lic 'echo $PATH'): present which -a claude→ only~/.local/bin/claude(no competing install)
Root cause
Claude Code builds a sanitized PATH for the shells it spawns to run commands, and that sanitized PATH omits ~/.local/bin — i.e. Claude Code's own install directory — while keeping other user entries (~/go/bin, /opt/homebrew/bin, the ~/.claude/plugins/.../bin dirs, etc.).
The doctor's "is ~/.local/bin in PATH?" check runs inside that spawned-shell context, so it inspects a PATH Claude Code itself stripped, finds its own install dir absent, and emits the warning. The user's real PATH (interactive shell and the claude process env) is correct the whole time.
Observed sanitized spawned-shell PATH (note ~/.local/bin missing, ~/go/bin and homebrew present):
~/go/bin
/opt/homebrew/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
~/.claude/plugins/cache/claude-plugins-official/.../bin
Expected behavior
The PATH check should either:
- Inspect the actual user/interactive
PATH(or theclaudeprocessPATH) rather than the sanitized spawned-shellPATH, or - Not strip its own install dir (
~/.local/bin) from thePATHit then checks for that very directory.
As-is, the doctor flags its own install directory as "not in PATH" and recommends a .zshrc edit that has no effect (the entry is already present and is not the value being read).
Impact
Cosmetic but persistent and misleading — users are nudged to repeatedly edit shell config that is already correct, creating duplicate PATH entries with no effect on the warning.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗