Claude Code Desktop (Mac) does not inherit user shell PATH when launched from Dock/icon
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When Claude Code Desktop is launched by clicking the Mac app icon (Dock/Launchpad/Spotlight), the shell environment does not include user-configured PATH from ~/.zshrc, ~/.zprofile, or even ~/.zshenv. Only the system default PATH (/usr/bin:/bin:/usr/sbin:/sbin) is available.
This means tools installed via Homebrew (e.g., Python, Node.js) are not found by Claude's Bash tool.
Steps to reproduce:
- Install Python via Homebrew (
brew install python@3.12) - Add
eval "$(/opt/homebrew/bin/brew shellenv)"to~/.zshrc,~/.zprofile, and~/.zshenv - Launch Claude Code Desktop by clicking the app icon
- Ask Claude to run
which python3andecho $PATH
Result:
which python3→/usr/bin/python3(system Python 3.9.6)echo $PATH→/usr/bin:/bin:/usr/sbin:/sbin
When launched from terminal (e.g., running claude in Terminal.app), the shell correctly inherits the user's PATH and python3 resolves to /opt/homebrew/bin/python3.
Environment:
- macOS (Apple Silicon, arm64, Darwin 25.3.0)
- Shell: zsh
- Claude Code Desktop (claude-desktop entrypoint)
What Should Happen?
Claude Code Desktop should resolve the user's shell environment at startup (similar to how VS Code does it — by spawning a login shell and capturing its environment variables), so that the Bash tool has the same PATH regardless of whether the app is launched from the Dock or from the terminal.
Expected: which python3 → /opt/homebrew/bin/python3 (Homebrew Python 3.12.x)
Error Messages/Logs
Steps to Reproduce
- Install Python via Homebrew:
brew install python@3.12 - Add
eval "$(/opt/homebrew/bin/brew shellenv)"to~/.zshrc,~/.zprofile, and~/.zshenv - Open a terminal and verify:
which python3→/opt/homebrew/bin/python3 - Launch Claude Code Desktop by clicking the app icon (Dock/Launchpad/Spotlight)
- Ask Claude to run
which python3andecho $PATH - Observe that
python3resolves to/usr/bin/python3(system 3.9.6) and PATH only contains/usr/bin:/bin:/usr/sbin:/sbin - Now launch Claude Code from terminal (
claudecommand) and repeat step 5 - Observe that
python3correctly resolves to/opt/homebrew/bin/python3
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.92
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
NONE
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗