PR not linked to session when working in a git worktree

Resolved 💬 1 comment Opened Apr 8, 2026 by lifework Closed Apr 22, 2026

Description

When creating a PR from within a git worktree (created via EnterWorktree), the Claude Desktop session list does not show the PR link. The session continues to display "変更をコミット" (Commit changes) instead of switching to a "PR" button linking to the created PR.

Environment

  • Claude Desktop (macOS)
  • Claude Code CLI via worktree (EnterWorktree)

Steps to Reproduce

  1. Start a Claude Code session in Claude Desktop
  2. Use EnterWorktree to create a git worktree (e.g., .claude/worktrees/charming-morse)
  3. Make changes, commit, and push to a new branch
  4. Create a PR using gh pr create
  5. Observe the session in Claude Desktop's session list

Expected Behavior

The session should show a "PR" button linking to the created PR (e.g., #53), similar to how it works when creating a PR from the main repository directory.

Actual Behavior

The session continues to show "変更をコミット" (Commit changes) instead of the PR link.

Additional Context

  • gh pr view --json number,url works correctly inside the worktree and returns the correct PR information
  • The worktree path is .claude/worktrees/<name> inside the repo, and git rev-parse --git-common-dir correctly resolves to the main .git directory
  • The issue is likely that Claude Desktop's PR detection does not account for worktree paths when determining the git context

View original on GitHub ↗

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