| description | Clean up a git worktree after its PR has been merged - verifies merge status and safely removes the worktree directory |
|---|---|
| model | haiku |
If the branch is unmerged, stop and explain the situation. Merged work is safe to clean up; unmerged work requires user decision.
Remove only the worktree directory itself. Preserve all branches (local and remote) for git history and potential future reference.Use git worktree list to find the primary repo location. The current working directory
may be inside the worktree being cleaned up, so navigate to the primary repo first.
Celebrate the successful merge with congratulatory language acknowledging the completed work.