Claude Code Desktop (Mac) does not inherit user shell PATH when launched from Dock/icon

Resolved 💬 3 comments Opened Apr 7, 2026 by chenkaijiang Closed Apr 11, 2026

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:

  1. Install Python via Homebrew (brew install python@3.12)
  2. Add eval "$(/opt/homebrew/bin/brew shellenv)" to ~/.zshrc, ~/.zprofile, and ~/.zshenv
  3. Launch Claude Code Desktop by clicking the app icon
  4. Ask Claude to run which python3 and echo $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

  1. Install Python via Homebrew: brew install python@3.12
  2. Add eval "$(/opt/homebrew/bin/brew shellenv)" to ~/.zshrc, ~/.zprofile, and ~/.zshenv
  3. Open a terminal and verify: which python3/opt/homebrew/bin/python3
  4. Launch Claude Code Desktop by clicking the app icon (Dock/Launchpad/Spotlight)
  5. Ask Claude to run which python3 and echo $PATH
  6. Observe that python3 resolves to /usr/bin/python3 (system 3.9.6) and PATH only contains /usr/bin:/bin:/usr/sbin:/sbin
  7. Now launch Claude Code from terminal (claude command) and repeat step 5
  8. Observe that python3 correctly 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

View original on GitHub ↗

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