claude-code - 💡(How to fix) Fix [BUG] Desktop session PR picker never refreshes after PRs merged externally — survives app restart and /clear

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…

Error Message

Error Messages/Logs

None — this is a stale-data UI bug, not an error path.

Fix Action

Fix / Workaround

The only known workaround is to start a brand new session, which fetches fresh state from GitHub immediately. So the underlying GitHub fetch path works; the existing session just never re-triggers it.

Code Example

prRepository: <repo-name>/<repo>
prs count: 3
  [0] branch=<branch-a>  state=OPEN     ← actually MERGED on GitHub
  [1] branch=<branch-b>  state=CLOSED   ← matches GitHub
  [2] branch=<branch-c>  state=OPEN     ← actually MERGED on GitHub
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues; #56057 covers a related labelling issue on claude-code-web but this is a distinct cache-freshness bug on desktop macOS
  • This is a single bug report
  • I am using the latest version of Claude Code

What's Wrong?

On the macOS desktop app, the session-attached PR picker dropdown (the "N repos / <workspace>" widget above the chat input) caches the list of pull requests and their states in the session's local_*.json file under ~/Library/Application Support/Claude/claude-code-sessions/<workspace>/<session-group>/.

After a PR is merged or closed externally — either by the same agent via gh pr merge, or by the user in a browser tab — the cached prs[].state is never refreshed for the existing session. The following remediations all fail:

  • Opening the picker dropdown does not trigger a refresh.
  • Background polling (if any) does not catch up — observed stale for >10 minutes.
  • Quitting and reopening the Claude Code app resumes the same session with the stale cache intact.
  • Running /clear wipes the conversation transcript but leaves the cached prs[] data untouched — picker remains stale.

The only known workaround is to start a brand new session, which fetches fresh state from GitHub immediately. So the underlying GitHub fetch path works; the existing session just never re-triggers it.

What Should Happen?

The desktop app should re-fetch PR state from GitHub for cached prs[] entries on at least one of:

  • App restart / session resume
  • /clear
  • Picker dropdown open
  • Some periodic background interval

Merged or closed PRs should update or drop off without forcing the user to abandon their session.

Bonus: picker entries should be labelled by PR branch / PR number, not by repo. Multiple PRs in the same repo currently collapse visually into "repo-name, repo-name, repo-name". (This labelling concern specifically overlaps with #56057 on claude-code-web.)

Error Messages/Logs

None — this is a stale-data UI bug, not an error path.

Steps to Reproduce

  1. Open Claude Code (macOS desktop) attached to a single GitHub repo workspace, in a single session.
  2. Have the agent create three PRs on three branches.
  3. Confirm the picker dropdown shows 3 PRs.
  4. Have the agent merge two of them: gh pr merge <n> --squash --delete-branch.
  5. Confirm on GitHub that those two PRs are state: MERGED.
  6. Picker dropdown — both still show as OPEN.
  7. Run /clear in the session — picker dropdown still shows them as OPEN.
  8. Quit Claude Code (cmd+Q), reopen, resume the same session — still OPEN.
  9. Start a brand new session in the same workspace — picker now shows correct state.

Concrete evidence

From one session's local_*.json after merging PRs 1 and 3 via gh pr merge --squash --delete-branch, after running /clear, and after quitting + reopening the app:

prRepository: <repo-name>/<repo>
prs count: 3
  [0] branch=<branch-a>  state=OPEN     ← actually MERGED on GitHub
  [1] branch=<branch-b>  state=CLOSED   ← matches GitHub
  [2] branch=<branch-c>  state=OPEN     ← actually MERGED on GitHub

A new session created in the same workspace and queried immediately returns the correct merged states.

Claude Model

Claude Opus 4.7 (in the agent session that performed the merges).

Is this a regression?

Unknown.

Last Working Version

No response

Claude Code Version

2.1.128 (from ~/.claude/sessions/<pid>.json)

Platform

macOS desktop app (entrypoint: claude-desktop)

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 [BUG] Desktop session PR picker never refreshes after PRs merged externally — survives app restart and /clear