Skip to content

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

Description

@tungfam

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions