Worktree/branch awareness: UI doesn't reflect active worktree or detect associated PRs
Resolved 💬 3 comments Opened Apr 9, 2026 by smchugh-tv Closed Apr 13, 2026
Problem
When working in a git worktree, the Claude Code UI does not properly reflect the worktree's branch or detect associated PRs.
What happened
- Created a worktree on a feature branch
- Made changes, pushed, and created a PR
- The UI status bar continued showing
Branch ← HEADandManually create PRinstead of the actual branch name and the existing PR - Attempted to
cdinto the worktree directory to fix this —cdwithin a Bash tool call does not persist the session's working directory - Started a new session from inside the worktree directory — the UI still did not properly reflect the branch/PR state
Expected behavior
- When working in a git worktree, the UI should show the worktree's branch name (not
HEAD) - If a PR exists for the current branch, the UI should detect it and link to it (not show
Manually create PR) - There should be a way to change the session's working directory mid-conversation (e.g., when creating a worktree and needing to switch into it)
Environment
- Claude Code CLI
- macOS (Darwin 24.3.0)
- Git worktrees under
.claude/worktrees/ - Main repo on detached HEAD, worktrees on named branches
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗