Branch shows 'Merged' badge when no PR exists for the branch

Resolved 💬 3 comments Opened Apr 27, 2026 by tungfam Closed May 1, 2026

Description

The Claude Code UI branch indicator (the bar at the top of the prompt area, e.g. master ← my-branch +1072 -15 Merged) incorrectly displays the Merged label for a branch that has never been merged and has no associated pull request.

Repro

  1. Create a new local branch off master and make changes.
  2. Commit the changes (so the branch is ahead of master by ≥1 commit).
  3. Push the branch to origin and set tracking. Do not open a pull request.
  4. Observe the branch indicator in the Claude Code UI.

Expected

The label should reflect actual state — e.g. "Open" / "No PR" / nothing — since the branch has no pull request and nothing has been merged.

Actual

Label reads Merged. The +/- line count also appears stale: it stays at the value it had before the commit was created (working-tree diff count), even after committing and pushing. Restarting the Claude Code app does not refresh it.

Verified state at the time of the bug

  • git log --oneline origin/master..HEAD → 1 commit ahead (d9612e04cb)
  • git ls-remote origin <branch> → branch present on remote
  • gh pr list --head <branch> --state all[] (no PR exists, open or closed)
  • UI still labels the branch Merged.

Hypothesis

When no PR is associated with the branch, the UI seems to fall back to a default/cached "Merged" badge instead of an empty/neutral state. The displayed +/- numbers also appear cached from before the commit was created rather than recomputed against the new HEAD.

Environment

  • Claude Code (latest, restarted)
  • macOS
  • Repo: SpeechifyInc/Speechify-iOS (private)

View original on GitHub ↗

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