claude doctor false positive: "~/.local/bin is not in your PATH" when it IS in PATH (own install dir stripped from spawned-shell PATH)

Open 💬 2 comments Opened Jun 5, 2026 by parkskiit

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/bin is present in both ~/.zshenv and ~/.zshrc as export 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 claude process env (ps eww -p <pid>): present
  • Every running claude process (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:

  1. Inspect the actual user/interactive PATH (or the claude process PATH) rather than the sanitized spawned-shell PATH, or
  2. Not strip its own install dir (~/.local/bin) from the PATH it 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗