<!--
Flag #62/#63: allowed-tools removed. Inherits Bash(*) from
.claude/settings.json. Restricting to specific subcommand patterns at the
skill level silently blocks agents on permission prompts the agent cannot
see — see dispatch #171 for the devex incident that surfaced this trap.
-->
Delete Worktree
Remove a git worktree from .claude/worktrees/ and optionally clean up its branch.
Arguments
- $ARGUMENTS: The worktree name to delete (e.g.,
fix-auth-bug).
Instructions
Step 0: Parse arguments
If $ARGUMENTS is empty, list worktrees and ask which to delete.
Step 1: Validate
- Verify
.claude/worktrees/<name>/exists as a git worktree. - Check for uncommitted changes. If dirty, warn and ask to confirm.
Step 2: Determine the branch
Get branch name from the worktree.
Step 3: Remove the worktree
git worktree remove .claude/worktrees/<name>(add--forceonly if user confirmed dirty deletion)git worktree prune
Step 4: Offer branch cleanup
Ask:
Delete branch
<branch>as well?
1. Yes — safe delete (
git branch -d)
2. Yes — force delete (
git branch -D)
3. No — keep the branch
Step 5: Report
Worktree deleted:
Path: .claude/worktrees/<name>/ (removed)
Branch: <branch> (deleted/kept)