claude-code - 💡(How to fix) Fix Claude desktop app's PR/CI panel can't find `gh` because PATH is `/usr/bin:/bin:/usr/sbin:/sbin` (LSEnvironment override) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#57859Fetched 2026-05-11 03:23:30
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

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.

Fix Action

Fix / Workaround

Workaround (currently in use)

Code Example

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

---

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

---

<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>
RAW_BUFFERClick to expand / collapse

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)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude desktop app's PR/CI panel can't find `gh` because PATH is `/usr/bin:/bin:/usr/sbin:/sbin` (LSEnvironment override) [1 participants]