claude-code - 💡(How to fix) Fix UI shows stale PR/merge state — PR displayed as "not merged" with green CI after it was already squash-merged

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…

After a PR's CI passed and the PR was squash-merged on GitHub (branch + worktree auto-deleted), the Claude Code UI kept showing the PR as green-CI-but-not-merged. The displayed state never reconciled with GitHub's actual MERGED state — only gh pr view revealed the truth. This appears to be recurring.

Root Cause

After a PR's CI passed and the PR was squash-merged on GitHub (branch + worktree auto-deleted), the Claude Code UI kept showing the PR as green-CI-but-not-merged. The displayed state never reconciled with GitHub's actual MERGED state — only gh pr view revealed the truth. This appears to be recurring.

Code Example

gh pr view 11620 --json state,mergedAt,mergeCommit
# state=MERGED  mergedAt=...  mergeCommit=aa2635b54d...
RAW_BUFFERClick to expand / collapse

Summary

After a PR's CI passed and the PR was squash-merged on GitHub (branch + worktree auto-deleted), the Claude Code UI kept showing the PR as green-CI-but-not-merged. The displayed state never reconciled with GitHub's actual MERGED state — only gh pr view revealed the truth. This appears to be recurring.

Environment

  • Claude Code: 2.1.145
  • macOS: 26.5 (25F71)
  • node: v24.11.1
  • gh: 2.93.0
  • Repo config: GitHub squash-merge + auto-delete-branch; work done in a git worktree under .claude/worktrees/

Steps to reproduce (observed)

  1. Create a branch + PR from a worktree under .claude/worktrees/<name>.
  2. CI ("Check" workflow) goes green.
  3. PR is squash-merged on GitHub, which auto-deletes the remote branch (and the local worktree gets cleaned up).
  4. Observe the Claude Code UI's PR/CI status.

Expected

UI reflects PR = merged, and the deleted branch/worktree state is updated.

Actual

UI shows CI green but the PR as "not merged" (stale). The status never reconciles. Confirming true state required dropping to the GitHub API:

gh pr view 11620 --json state,mergedAt,mergeCommit
# state=MERGED  mergedAt=...  mergeCommit=aa2635b54d...

Impact

  • In-app PR/CI/merge status can't be trusted; user must use gh to learn the real state.
  • Compounded by squash-merge silently removing the session's worktree, leaving the UI pointing at a directory that no longer exists.

Notes

GitHub was the correct source of truth throughout (origin/main carried the squash commit). The discrepancy is purely the harness UI not polling/invalidating PR + worktree state after an external (queue/squash) merge.

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 UI shows stale PR/merge state — PR displayed as "not merged" with green CI after it was already squash-merged