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

  1. Created a worktree on a feature branch
  2. Made changes, pushed, and created a PR
  3. The UI status bar continued showing Branch ← HEAD and Manually create PR instead of the actual branch name and the existing PR
  4. Attempted to cd into the worktree directory to fix this — cd within a Bash tool call does not persist the session's working directory
  5. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗