[Bug] Statusline displays stale PR number when worktree reused across branches

Status Open
Reported on v2.1.268
Maintainer reply None cached
Activity 0 comments · opened Sep 11, 2026

Bug Description
Statusline shows a stale PR number when one worktree is reused across branches.

What happened: the statusline kept showing "PR #451" after that PR merged and
I created a new branch (with a new PR) in the same worktree. It misled me twice
— I asked "why is 451 still open?" when it wasn't, and later didn't realize the
session had moved on to #452.

Ground truth at that moment:
cwd .claude/worktrees/<name>
git branch --show-current chore/lanes-probe-is-a-name-list
gh pr view --json number 452 (OPEN)
PR 451 MERGED

Expected: the indicator follows the current branch's PR, or shows nothing.

Repro:

  1. In a git worktree, create branch A, open PR A, merge it.
  2. Without leaving the worktree: git checkout -b B, push, open PR B.
  3. Statusline still shows PR A.

Notes: no statusLine key in my global, local, or project settings, so this is
the built-in indicator rather than a custom script. There's a
~/.claude/gh-pr-status-cache.json but it contained neither PR, so that doesn't
look like the source.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.268
  • Feedback ID: 304b99dd-93c4-4ebd-9a3e-b0444a760883

Errors

[]

View original on GitHub ↗