Skip to content

bug: installer places binary in ~/.local/bin but shell snapshot drops it from PATH, causing spurious startup warning #43127

@FrankLedo

Description

@FrankLedo

Summary

Claude Code's own installer places the binary in ~/.local/bin. However, the shell snapshot mechanism writes a hardcoded export PATH=... at the end of the snapshot file that is sourced for every Bash tool invocation. This snapshot PATH is derived from the launch-time process environment — not from the user's shell config — so user-level PATH additions (including ~/.local/bin) are silently dropped.

The result: Claude Code warns at every startup that ~/.local/bin is not in PATH, even though the user is successfully running the binary that lives there.

Steps to reproduce

  1. Install Claude Code via the native installer (places binary in ~/.local/bin)
  2. Add ~/.local/bin to PATH in ~/.zshrc or ~/.zshenv (as the warning suggests)
  3. Restart Claude Code
  4. Warning persists — inspect ~/.claude/shell-snapshots/*.sh and note the final export PATH=... line does not include ~/.local/bin

Root cause

~/.claude/shell-snapshots/*.sh ends with a hardcoded export PATH= line appended by Claude Code after shell capture. This line overwrites the PATH set by the user's shell config (~/.zshrc, ~/.zshenv, ~/.zprofile). Only paths present in /etc/paths or /etc/paths.d/ (macOS system-level) survive, because path_helper runs before any user shell config.

Impact

  • Users are told to fix their ~/.zshrc — but fixing it has no effect
  • The only working fix is a system-wide sudo tee /etc/paths.d/local-bin — an elevated change that should never be required for a user-space tool
  • Every restart shows the warning, eroding trust in the install

Expected behavior

Either:

  1. The snapshot PATH generation should include ~/.local/bin when the installer placed the binary there, or
  2. The startup warning should be suppressed if the binary was successfully found and launched (i.e., it IS reachable via the user's PATH, just not via the snapshot PATH)

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bashbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions