Advanced
Open
Pro
Reviewing a Teammate's PR in an Isolated Worktree
A teammate opened PR #482. You want to pull it down, run it locally, and poke at it without disturbing the in-progress branch you're already working on in your main checkout.
- What single command creates a worktree checked out to that PR's exact head commit, and where does Claude Code place the resulting directory?
- While working in that worktree, a command's working directory accidentally resolves back to your main checkout. What happens, and why is this a stronger guarantee than "an ordinary git worktree is just a separate directory"?
- You close the terminal without a clean interactive exit, and later find the worktree still exists with a lock on it. What happened, and how do you clean it up?
Share this question