Skip to content

Desktop app ignores settings.json env block and shell profile PATH on macOS #43210

@kylebolstad-xplore

Description

@kylebolstad-xplore

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

  1. env block in ~/.claude/settings.json — documented at https://code.claude.com/docs/en/settings but has no effect:

    {
      "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"
      }
    }
  2. SessionStart hook writing to CLAUDE_ENV_FILE — hook never executes in Desktop app sessions.

  3. ~/.zshenv with explicit export PATH=... — the subprocess IS zsh, and HOMEBREW_PREFIX from brew shellenv IS set, but PATH additions from .zshenv are not present. Likely overridden by path_helper in /etc/zprofile or by the Desktop app itself.

  4. ~/.zprofile with explicit export PATH=... — no effect, suggesting the Desktop app does not run a login shell.

Evidence that shell config partially works

  • HOMEBREW_PREFIX=/opt/homebrew IS set (from brew shellenv in .zshenv)
  • HOMEBREW_CELLAR=/opt/homebrew/Cellar IS 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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