[BUG] CCD-worktree sessions never surface PR status (chip + sidebar icon stay grey); cloud sessions work

Resolved 💬 1 comment Opened May 14, 2026 by sansojonas Closed Jun 13, 2026

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:

  1. The in-chat "Create PR" chip stays grey forever, regardless of commit state, push state, or whether a PR already exists.
  2. The sidebar status icon stays grey for the session, even after the user opens the PR via gh pr create or 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:

  1. Session JSON files under ~/Library/Application Support/Claude/claude-code-sessions/<account>/<org>/local_*.json contain prNumber, prUrl, prRepository, prs fields.
  2. Of 31 worktree-bound sessions in my history, only the 6 created on or before 2026-04-09 ever got prNumber populated. All sessions created 2026-04-13 onward (first session using claude-opus-4-7[1m]) have prNumber: null, even when the branch has merged PRs on GitHub.
  3. I tested manually injecting prNumber/prUrl/prRepository into one session's JSON for a known-merged PR. CCD overwrote my edit on next launch from the cloud (mtime sweep showed Network Persistent State, bridge-state.json, and the session JSON all rewritten on relaunch). Confirms the JSON is downstream of a server-side store.
  4. bridge-state.json shows 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.
  5. Comment in #46625 by toshi-kuji independently identified the architecture: "session_id → pr_number mapping is set at the first create_pull_request tool use." Local CCD-worktree sessions never make that tool call (they use gh pr create via Bash), so the mapping is never set.

Steps to Reproduce

  1. 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.
  2. Have Claude make a tracked-file change. Commit. Push. Open a PR with gh pr create --base main --fill (or via GitHub web).
  3. 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).
  1. Confirm via gh pr view <number> that the PR exists and is open or merged.
  2. Inspect the session JSON at ~/Library/Application Support/Claude/claude-code-sessions/<...>/local_<sessionId>.jsonprNumber is null.
  3. 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_number server 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)

  1. 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.
  2. Client-side reporting: local Claude Code CLI emits a PR-created event to the backend whenever it runs gh pr create or detects a PR for the session's branch. Requires CLI changes.
  3. 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗