Misleading 'CI checks unavailable' when CC session cwd is not a git repo

Open 💬 3 comments Opened May 14, 2026 by jswhite21

What happened

The CI monitoring panel (right-side widget) showed:

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

despite gh being installed and authenticated:

$ gh auth status
github.com
  ✓ Logged in to github.com account <redacted> (keyring)
  - Active account: true
  - Git operations protocol: ssh
  ...

Actual cause

The Claude Code session was launched in C:\src3\ — a parent directory containing many individual repo checkouts but not itself a git repo.

The monitor polls CI by running (from the session's cwd):

gh pr view <PR#> --json number,title,state,isDraft,statusCheckRollup,reviewDecision,additions,deletions

Running that command manually from C:\src3:

$ gh pr view 3882 --json ...
failed to run git: fatal: not a git repository (or any of the parent directories): .git

Running the same command from C:\src3\pro-api (the repo that actually owns PR #3882) returns the full JSON as expected.

So gh pr view is failing because gh has no repo context to query against — not because gh is missing or unauthenticated. The panel rolls that failure into a generic gh-auth message that points the user at the wrong root cause and sends them chasing a non-issue.

Repro

  1. Launch Claude Code with cwd set to a non-git directory that contains git repos as subdirectories (e.g. C:\src3 containing pro-api, pro-web, …).
  2. Arm CI monitoring for a PR — likely from a sibling session whose cwd was inside the actual repo, so the PR# is captured.
  3. In the non-git-cwd session the CI panel renders "CI checks unavailable. Check that gh is installed and authenticated." even though gh is healthy.

Suggested fix

Either:

  • Differentiate the failure mode. When gh pr view exits with fatal: not a git repository, render "Session cwd isn't a git repo — start Claude Code inside the repo for PR #N" instead of the gh-auth message.
  • Or store the resolved owner/repo at monitor-arm time and pass --repo owner/repo to gh pr view, so polling doesn't depend on the cwd of the session that happens to be observing the panel.

The second option also fixes the related case where the user has multiple repos open in different sessions but only one of them happens to be inside the PR's repo.

Environment

  • Claude Code 2.1.138 (Windows native install, ~/.local/bin/claude.exe)
  • Windows 11 Pro
  • gh CLI 2.87.2
  • Two gh accounts authenticated, active account configured correctly

View original on GitHub ↗

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