[BUG] Desktop session PR picker never refreshes after PRs merged externally — survives app restart and /clear
Preflight Checklist
- [x] I have searched existing issues; #56057 covers a related labelling issue on
claude-code-webbut this is a distinct cache-freshness bug on desktop macOS - [x] This is a single bug report
- [x] 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
/clearwipes the conversation transcript but leaves the cachedprs[]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
- Open Claude Code (macOS desktop) attached to a single GitHub repo workspace, in a single session.
- Have the agent create three PRs on three branches.
- Confirm the picker dropdown shows 3 PRs.
- Have the agent merge two of them:
gh pr merge <n> --squash --delete-branch. - Confirm on GitHub that those two PRs are
state: MERGED. - Picker dropdown — both still show as OPEN.
- Run
/clearin the session — picker dropdown still shows them as OPEN. - Quit Claude Code (cmd+Q), reopen, resume the same session — still OPEN.
- 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)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗