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
- Start a Claude Code session in Claude Desktop
- Use
EnterWorktreeto create a git worktree (e.g.,.claude/worktrees/charming-morse) - Make changes, commit, and push to a new branch
- Create a PR using
gh pr create - 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,urlworks correctly inside the worktree and returns the correct PR information- The worktree path is
.claude/worktrees/<name>inside the repo, andgit rev-parse --git-common-dircorrectly resolves to the main.gitdirectory - The issue is likely that Claude Desktop's PR detection does not account for worktree paths when determining the git context
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗