[BUG] CCD-worktree sessions never surface PR status (chip + sidebar icon stay grey); cloud sessions work
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
In the local desktop app, sessions launched via the "new worktree" button (CCD-worktree-bound sessions, where the session's cwd is a worktree under .claude/worktrees/) never get their PR status surfaced in the UI, even when the session's branch has open or merged PRs on GitHub:
- The in-chat "Create PR" chip stays grey forever, regardless of commit state, push state, or whether a PR already exists.
- The sidebar status icon stays grey for the session, even after the user opens the PR via
gh pr createor the GitHub web UI.
The same project opened via the cloud surface (claude.ai/code → "sanso-be · Sanso-AI" in the sidebar) works correctly: chip activates, sidebar icon colors after PR creation.
What Should Happen?
Local CCD-worktree sessions should track PR status the same way cloud (Cowork) sessions do. When the session's branch has a PR on GitHub:
- The sidebar icon should color (and reflect open/merged state)
- The chip "Create PR" should grey out (because a PR already exists) or activate "View PR"
Diagnostic findings
I instrumented my local CCD state to find the source of truth:
- Session JSON files under
~/Library/Application Support/Claude/claude-code-sessions/<account>/<org>/local_*.jsoncontainprNumber,prUrl,prRepository,prsfields. - Of 31 worktree-bound sessions in my history, only the 6 created on or before 2026-04-09 ever got
prNumberpopulated. All sessions created 2026-04-13 onward (first session usingclaude-opus-4-7[1m]) haveprNumber: null, even when the branch has merged PRs on GitHub. - I tested manually injecting
prNumber/prUrl/prRepositoryinto one session's JSON for a known-merged PR. CCD overwrote my edit on next launch from the cloud (mtime sweep showedNetwork Persistent State,bridge-state.json, and the session JSON all rewritten on relaunch). Confirms the JSON is downstream of a server-side store. bridge-state.jsonshows only one Cowork bridge entry (a "ditto" mirror of one main-repo session). None of my CCD-worktree sessions are bridged. The Cowork code path appears to be the one that updates the server's session→PR mapping.- Comment in #46625 by toshi-kuji independently identified the architecture: "session_id → pr_number mapping is set at the first
create_pull_requesttool use." Local CCD-worktree sessions never make that tool call (they usegh pr createvia Bash), so the mapping is never set.
Steps to Reproduce
- In CCD, click the "New worktree" home-screen button on any GitHub-backed repo. CCD creates
.claude/worktrees/<haiku-name>/and a session bound to it. - Have Claude make a tracked-file change. Commit. Push. Open a PR with
gh pr create --base main --fill(or via GitHub web). - Observe:
- The chip at the bottom of the conversation stays grey on "Create PR".
- The session in the left sidebar stays grey (no PR indicator).
- Confirm via
gh pr view <number>that the PR exists and is open or merged. - Inspect the session JSON at
~/Library/Application Support/Claude/claude-code-sessions/<...>/local_<sessionId>.json—prNumberisnull. - Repeat the same task in claude.ai/code (cloud surface, "sanso-be · Sanso-AI" in the local sidebar) — chip and icon work as expected.
Is this a regression?
Partial. Pre-2026-04-09 CCD-worktree sessions in my history did get prNumber populated, suggesting the chip used to call mcp__github__create_pull_request directly, which fed the server mapping. Post-2026-04-13 sessions never populate it. Whether that change was intentional or a regression I can't say — but the result for users on gh-based workflows is that the local surface lost its PR-tracking UI.
Related issues
- #58649 — feature request for "Agents View: show branch name, merge status per session row" (closest existing report; functionally what's missing)
- #46625 — comment chain reveals the
session_id → pr_numberserver caching architecture - #20108 — earlier "Create PR" regression (closed)
- #57209 — Desktop's worktree creation doesn't fire WorktreeCreate hook (related local-vs-cloud divergence)
Suggested fixes (any of these would resolve)
- Server-side polling: backend periodically queries
gh pr list --head <session.branch>for sessions whose branch has no recorded PR; populate the mapping when it finds one. Doesn't require client cooperation. - Client-side reporting: local Claude Code CLI emits a PR-created event to the backend whenever it runs
gh pr createor detects a PR for the session's branch. Requires CLI changes. - Manual link: add a "Link PR..." menu item on grey session rows so users can paste a PR URL and bind it to the session. Cheapest UX fix.
Claude Model
claude-opus-4-7[1m] (also claude-sonnet-4-6 reproduced)
Last Working Version
Sessions created 2026-04-09 and earlier (using model claude-opus-4-6) populated prNumber correctly.
Claude Code Version
CLI: 2.1.141
CCD app: 1.7196.0 (CFBundleShortVersionString)
Platform
Anthropic API (Max plan)
Operating System
macOS (Darwin)
Additional Information
I have full diagnostic JSONs (with secrets redacted) and screenshots of the chip and sidebar in both broken and working states. Happy to share via private channel.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗