claude-code - 💡(How to fix) Fix Branch overview panel shows phantom branches from stale historical PRs

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…

The branch overview panel in Claude Code renders "branch sync" rows that don't correspond to any branch actually present in the repository (locally or on the remote).

Clicking the Merged action on such a phantom row opens a real but very old, long-merged PR — which strongly suggests the panel is building its branch chain from historical PR metadata returned by the GitHub API, without verifying that the baseRefName / headRefName of those PRs still exist as branches.

Root Cause

The panel appears to infer a development → master → main chain by reading historical PRs whose base/head branches have since been deleted, and confidently renders rows for those dead branches — including a Create PR button against a non-existent base, with a nonsensical diff count (+14942 / −15146) because it's diffing against something that isn't there.

Code Example

$ git branch -a | grep -E "(master|main|development)"
  main
  remotes/origin/HEAD -> origin/main
  remotes/origin/development
RAW_BUFFERClick to expand / collapse

Description

The branch overview panel in Claude Code renders "branch sync" rows that don't correspond to any branch actually present in the repository (locally or on the remote).

Clicking the Merged action on such a phantom row opens a real but very old, long-merged PR — which strongly suggests the panel is building its branch chain from historical PR metadata returned by the GitHub API, without verifying that the baseRefName / headRefName of those PRs still exist as branches.

Reproducer

Affected repo (private) has the following current git state:

$ git branch -a | grep -E "(master|main|development)"
  main
  remotes/origin/HEAD -> origin/main
  remotes/origin/development

There is no master branch locally or on origin (also verified against packed-refs). The repo did have a master branch years ago — it was renamed/deleted and the default branch is now main. Long-lived branches today are main and development.

Despite that, the panel renders three rows:

  1. development ← feature/<topic>correct (real open PR).
  2. master ← development (Merged) — phantom, clicking it opens a PR from August 2021 that targeted the now-removed master.
  3. main ← master (Create PR, +14942 −15146) — phantom, master does not exist.

Expected

  • Branch overview should reflect current git state.
  • Branches that no longer exist on the remote should not be rendered as nodes in the chain.
  • The default-branch chain should be derived from current refs (here: development → main), not from baseRefName of stale historical PRs.

Actual

The panel appears to infer a development → master → main chain by reading historical PRs whose base/head branches have since been deleted, and confidently renders rows for those dead branches — including a Create PR button against a non-existent base, with a nonsensical diff count (+14942 / −15146) because it's diffing against something that isn't there.

Environment

  • Claude Code (latest as of 2026-05-12)
  • macOS Darwin 25.3.0
  • Repo: private monorepo; happy to share more details privately if useful.

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 Branch overview panel shows phantom branches from stale historical PRs