[BUG] Desktop session PR picker shows stale merged/closed PR cards that can't be dismissed or refreshed
Preflight Checklist
- Searched existing open and closed issues — closest are #48694 and #58491 (both closed, still reproduces); this re-raises with a new data-loss finding.
What's Wrong?
The desktop app's session-attached PR picker caches the session's PRs with their state frozen at session start and never re-queries — during the session or across restarts. After PRs are merged (especially with --delete-branch), the cards persist showing stale OPEN/CI state with a yellow ⚠️ (CI can't resolve for the deleted branch). There is no way to clear them:
- No hover/X dismiss on the card
- The
CI ⌄dropdown doesn't trigger a re-fetch /cleardoesn't remove them- No settings.json key, env var, or slash command disables/clears the panel
- They survive a full app restart (resuming the session re-reads the cached array)
What Should Happen?
The PR picker should refresh PR state on session resume, and/or provide a supported way to dismiss/hide stale cards. Separately, the app should tolerate a malformed/edited local_*.json rather than dropping the entire session list.
Error Messages/Logs
No error surfaced to the user — only a persistent yellow ⚠️ on each stale card (CI status unresolved for a deleted branch).
Steps to Reproduce
- In a session, create several PRs (e.g. via
gh pr create). - Merge them with
--delete-branch. - Observe the session PR picker cards remain, showing stale
OPEN+ a ⚠️, with no way to dismiss or refresh. They persist across a full app restart.
Claude Model
Not model-specific — this is a UI/state-caching bug, independent of model.
Is this a regression?
I don't know.
Claude Code Version
2.1.168 (desktop app)
Platform
Anthropic API
Operating System
macOS (Darwin 25.5.0)
Terminal/Shell
Other — Claude Code desktop app (not a terminal session)
Additional Information
Related: #48694 ("[BUG] Desktop app PR status bar shows closed/merged PRs", closed) and #58491 ("[BUG] Desktop session PR picker never refreshes after PRs merged externally — survives app restart and /clear", closed).
Important — the obvious workaround is dangerous: hand-editing the cached session file (~/Library/Application Support/Claude/claude-code-sessions/<group>/<session>/local_*.json, the prs[] array) to clear the cards can corrupt the session index and wipe the entire session list, including pinned sessions (required a restore from backup). Users should never need to touch internal state, and a single edited/malformed local file should not take down all sessions.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗