claude-code - 💡(How to fix) Fix PATH check false-positive on macOS/fish: "~/.local/bin is not in your PATH" despite being present [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50871Fetched 2026-04-20 12:10:45
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

The native installation PATH check (OF1 in the bundle) fires a persistent warning even when ~/.local/bin is unambiguously present in $PATH. The warning appears on every claude upgrade and recurs during normal sessions. The suggested fix is also wrong syntax for fish shell.

Root Cause

The installer creates ~/.local/bin/env.fish and injects a source line into ~/.config/fish/conf.d/uv.env.fish (a file it shouldn't touch). That env file adds the path using the unresolved form $HOME/.local/share/../bin rather than $HOME/.local/bin.

OF1's PATH check does a plain string comparison (no path.resolve):

D === w  // w = path.join(os.homedir(), ".local", "bin") = "/Users/ian/.local/bin"

So "/Users/ian/.local/share/../bin" !== "/Users/ian/.local/bin" — the check misses the installer's own path entry. The PDH function uses path.resolve() and handles this correctly; OF1 does not.

After cleaning up the installer's residue, the clean path /Users/ian/.local/bin remains in PATH and the simulation confirms the check should pass — yet the live warning persists. The check appears to run in a context where process.env.PATH differs from what fish exports to normal subprocesses. This was not fully resolved during diagnosis.

Code Example

$ echo $PATH | tr ' ' '\n'
/opt/homebrew/bin
/opt/homebrew/sbin
/Users/ian/go/bin
/usr/local/go/bin
/Users/ian/.local/bin        ← present and clean
/Users/ian/bin
...

---

$ node -e "console.log(process.env.PATH.split(':').includes('/Users/ian/.local/bin'))"
true

---

D === w  // w = path.join(os.homedir(), ".local", "bin") = "/Users/ian/.local/bin"

---

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.config/fish/config.fish
RAW_BUFFERClick to expand / collapse

Summary

The native installation PATH check (OF1 in the bundle) fires a persistent warning even when ~/.local/bin is unambiguously present in $PATH. The warning appears on every claude upgrade and recurs during normal sessions. The suggested fix is also wrong syntax for fish shell.

Environment

  • Claude Code version: 2.1.114
  • OS: macOS Darwin 24.6.0 (Apple Silicon)
  • Shell: fish

Reproduction

  1. Install Claude Code natively on macOS with fish as the login shell
  2. Run claude upgrade (or start a session)
  3. Warning appears despite correct PATH

Evidence that PATH is correct

$ echo $PATH | tr ' ' '\n'
/opt/homebrew/bin
/opt/homebrew/sbin
/Users/ian/go/bin
/usr/local/go/bin
/Users/ian/.local/bin        ← present and clean
/Users/ian/bin
...

Simulating the exact check from OF1 inside a fish subprocess passes:

$ node -e "console.log(process.env.PATH.split(':').includes('/Users/ian/.local/bin'))"
true

Root cause analysis

The installer creates ~/.local/bin/env.fish and injects a source line into ~/.config/fish/conf.d/uv.env.fish (a file it shouldn't touch). That env file adds the path using the unresolved form $HOME/.local/share/../bin rather than $HOME/.local/bin.

OF1's PATH check does a plain string comparison (no path.resolve):

D === w  // w = path.join(os.homedir(), ".local", "bin") = "/Users/ian/.local/bin"

So "/Users/ian/.local/share/../bin" !== "/Users/ian/.local/bin" — the check misses the installer's own path entry. The PDH function uses path.resolve() and handles this correctly; OF1 does not.

After cleaning up the installer's residue, the clean path /Users/ian/.local/bin remains in PATH and the simulation confirms the check should pass — yet the live warning persists. The check appears to run in a context where process.env.PATH differs from what fish exports to normal subprocesses. This was not fully resolved during diagnosis.

Secondary bugs

  1. DISABLE_INSTALLATION_CHECKS does not suppress this warning. The env var guard in OF1 only wraps checks after the native PATH check, not the PATH check itself.

  2. Wrong fix suggested for fish. The fix message emits:

    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.config/fish/config.fish

    export is bash syntax. The correct fish idiom is fish_add_path ~/.local/bin.

  3. Installer writes into uv.env.fish, which is semantically owned by the uv Python package manager. This silently corrupts uv's own env setup for any user with both tools installed.


Diagnosed by Claude Sonnet 4.6 running at max effort via claude CLI on behalf of the affected user.

extent analysis

TL;DR

The warning persists due to the installer's incorrect modification of the uv.env.fish file and OF1's plain string comparison for the PATH check, which misses the installer's path entry.

Guidance

  • The issue is likely caused by the installer's residue in ~/.config/fish/conf.d/uv.env.fish, which adds the path using the unresolved form $HOME/.local/share/../bin instead of $HOME/.local/bin.
  • To verify, check the contents of ~/.config/fish/conf.d/uv.env.fish and remove any lines added by the installer that modify the PATH.
  • The correct fix for fish shell is to use fish_add_path ~/.local/bin instead of the suggested export syntax.
  • The DISABLE_INSTALLATION_CHECKS env var does not suppress this warning, so an alternative solution is needed.

Example

fish_add_path ~/.local/bin

This command adds the ~/.local/bin directory to the PATH in fish shell.

Notes

The issue is specific to the fish shell and the Claude Code version 2.1.114. The installer's modification of the uv.env.fish file may cause conflicts with the uv Python package manager.

Recommendation

Apply the workaround by removing the installer's residue from ~/.config/fish/conf.d/uv.env.fish and using the correct fish syntax to add the PATH. This is the most straightforward solution given the constraints of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING