1.2 KiB
1.2 KiB
description, allowed-tools
| description | allowed-tools |
|---|---|
| Clean up a completed worktree task | Bash |
Cleanup Worktree Task
Clean up a completed or abandoned worktree task by killing the tmux session and optionally removing the git worktree.
Usage
Provide:
- Session name - The tmux session to clean up
- --remove-worktree (optional) - Also remove the git worktree directory
Example
User: "Cleanup the my-feature worktree task" User: "Cleanup my-feature and remove the worktree"
Execution
# Kill session only (keep worktree for review)
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup.py <session-name>
# Kill session AND remove worktree
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup.py <session-name> --remove-worktree
What It Does
- Kills the tmux session
- Lists remaining git worktrees
- If
--remove-worktree: removes the worktree directory - Shows next steps (merge branch, create PR)
After Cleanup
The branch still exists. To complete:
- Merge:
git merge <branch-name> - Create PR:
gh pr create --head <branch-name> - Delete branch:
git branch -d <branch-name>
Note
Always review changes before removing the worktree. Use /worktree:status to check commits first.