Desktop app ignores settings.json env block and shell profile PATH on macOS
Description
When running Claude Code via the Claude Desktop app on macOS (Apple Silicon), the env block in ~/.claude/settings.json is not applied to Bash tool commands. Shell profile files (.zshenv, .zprofile, .zshrc) are also not effective at setting PATH for the Bash tool, despite the subprocess being zsh.
Environment
- macOS (Darwin 25.4.0, Apple Silicon)
- Claude Desktop app (
CLAUDE_CODE_ENTRYPOINT=claude-desktop) - Shell:
/bin/zsh
Current PATH in Bash tool
/Users/<user>/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/usr/bin:/bin:/usr/sbin:/sbin
Missing: /opt/homebrew/bin, /opt/homebrew/sbin, ~/.cargo/bin
What I tried
envblock in~/.claude/settings.json— documented at https://code.claude.com/docs/en/settings but has no effect:
``json``
{
"env": {
"PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:/Users/<user>/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
}
}
- SessionStart hook writing to
CLAUDE_ENV_FILE— hook never executes in Desktop app sessions.
~/.zshenvwith explicitexport PATH=...— the subprocess IS zsh, andHOMEBREW_PREFIXfrombrew shellenvIS set, but PATH additions from.zshenvare not present. Likely overridden bypath_helperin/etc/zprofileor by the Desktop app itself.
~/.zprofilewith explicitexport PATH=...— no effect, suggesting the Desktop app does not run a login shell.
Evidence that shell config partially works
HOMEBREW_PREFIX=/opt/homebrewIS set (frombrew shellenvin.zshenv)HOMEBREW_CELLAR=/opt/homebrew/CellarIS set- But PATH does NOT include
/opt/homebrew/bin - A fresh
zsh -c 'echo $PATH'subprocess launched from the Bash tool DOES show the correct PATH
Expected behavior
The env block in settings.json should set/override environment variables for Bash tool commands, as documented. Alternatively, .zshenv PATH exports should be respected.
Impact
Any Homebrew-installed CLI tools (gh, pnpm, node via Homebrew, etc.) are not available in the Bash tool without using full paths like /opt/homebrew/bin/gh.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗