Bash tool login shell doesn't source /etc/paths or ~/.zprofile
Description
The Bash tool reports itself as a login shell ([[ -o login ]] returns true, $- contains l), but the shell environment is missing:
- System PATH entries from
/etc/paths(e.g.,/usr/local/binis missing) - User environment from
~/.zprofile
The base PATH is only /usr/bin:/bin:/usr/sbin:/sbin, missing entries that /usr/libexec/path_helper would normally add for any login shell.
Expected behavior
A zsh login shell should run path_helper (via /etc/zprofile) and source ~/.zprofile, providing the full system and user PATH.
Actual behavior
Neither /etc/zprofile nor ~/.zprofile are sourced. Tools installed in standard locations (/usr/local/bin) and user-configured paths (nvm, custom bin directories) are unavailable without manually running source ~/.zprofile.
Repro
# In the Bash tool:
echo $PATH
# Output: /usr/bin:/bin:/usr/sbin:/sbin
[[ -o login ]] && echo "login" || echo "not login"
# Output: login
/usr/libexec/path_helper -s
# Output: PATH="/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:..." (correct, but not applied)
which git-lfs node gh
# All not found
Workaround
Manually source ~/.zprofile before commands that need the full PATH.
Environment
- macOS (Darwin 25.3.0, arm64)
- zsh
- Claude Code (CLI)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗