Claude desktop app's PR/CI panel can't find `gh` because PATH is `/usr/bin:/bin:/usr/sbin:/sbin` (LSEnvironment override)

Resolved 💬 4 comments Opened May 10, 2026 by jasonvassallo Closed Jul 4, 2026

Issue draft for anthropics/claude-code

Title: Claude desktop app's PR/CI panel can't find gh because PATH is /usr/bin:/bin:/usr/sbin:/sbin (LSEnvironment override)

Type: Bug

---

Summary

When gh is installed via Homebrew on Apple Silicon (/opt/homebrew/bin/gh) — the standard install path — Claude desktop's PR/CI monitoring panel reports:

CI checks unavailable. Check that gh is installed and authenticated.

…even though gh is installed and gh auth status shows a healthy authenticated session.

Root cause

/Applications/Claude.app/Contents/Info.plist declares an LSEnvironment dict:

<key>LSEnvironment</key>
<dict>
    <key>MallocNanoZone</key>
    <string>0</string>
</dict>

Per Apple's LaunchServices behavior: when an app bundle declares LSEnvironment, the app at launch receives only that dict + the system default _PATH_DEFPATH (/usr/bin:/bin:/usr/sbin:/sbin). Inherited PATH from launchd (set via launchctl setenv or login profiles) is not passed through.

This was verified on a macOS 26.x host (Apple Silicon) by inspecting the running Claude.app process:

$ ps eww <claude-pid> | tr ' ' '\n' | grep '^PATH='
PATH=/usr/bin:/bin:/usr/sbin:/sbin

Even with launchctl setenv PATH "/opt/homebrew/bin:..." set globally and confirmed via launchctl getenv PATH, the new Claude.app process shows the bare-minimum _PATH_DEFPATH. The LSEnvironment declaration is what's gating it.

Affected feature

The PR/CI panel inside Claude desktop (the "View PR" / "CI" button surfaced when working in a Git repo) calls gh to query checks. With gh outside of /usr/bin:/bin:/usr/sbin:/sbin, the panel can't reach it. Same root cause would affect any other Homebrew//usr/local/bin-installed CLI the panel depends on.

Suggested fix

Add PATH to the existing LSEnvironment dict in Info.plist, covering the standard Homebrew install paths:

<key>LSEnvironment</key>
<dict>
    <key>MallocNanoZone</key>
    <string>0</string>
    <key>PATH</key>
    <string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>

This is the official Apple-documented mechanism for setting per-app PATH. It would let Homebrew users' gh (and other CLIs the desktop app shells out to) be findable without breaking anything for users who don't have Homebrew.

Alternative if maintaining a static PATH feels brittle: invoke gh via a login shell (/bin/zsh -l -c 'gh ...') so the user's shell init sources their actual PATH. The popular fix-path npm package does this for Electron apps.

Workaround (currently in use)

Editing /Applications/Claude.app/Contents/Info.plist to add PATH to LSEnvironment works, but:

  • Breaks Apple Developer-ID code signing (warning on next launch, may cause Gatekeeper to block on stricter macOS versions)
  • Gets clobbered on every Claude.app update

Hence this issue rather than a sustainable local fix.

Repro

  1. Install gh via Homebrew on Apple Silicon: brew install gh, confirm at /opt/homebrew/bin/gh
  2. gh auth login → confirm gh auth status is healthy
  3. Open Claude desktop, navigate to a Git repo with an open PR
  4. Click the CI status indicator → expect to see check status; observe the "CI checks unavailable" message instead

Versions

  • Claude.app: 1.6608.2
  • macOS: 26.x (Apple Silicon)
  • gh: 2.92.0 (Homebrew, /opt/homebrew/bin/gh)

View original on GitHub ↗

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