What problem does it solve?
Long-running projects accumulate leftover git worktrees and local branches from past sessions, cluttering the repository and making it hard to tell which branches still hold unique work. Manual cleanup risks deleting branches that contain commits found nowhere else.
Core Features & Use Cases
- Safe branch deletion: A branch is deleted only when every commit on it is reachable from another surviving ref (local branch, remote-tracking branch, or tag), so no commit is ever lost.
- Clean worktree removal: Worktrees are removed only when they have no uncommitted or untracked changes; the primary worktree, current branch, and main/master are always protected.
- Dry-run by default: Prints a full KEEP/REMOVE/DELETE plan with reasons before changing anything, and supports --protect flags for branches you want to keep despite having no unique commits.
- Use Case: After weeks of parallel agent sessions, your repo has a dozen worktrees and thirty local branches. Run the dry-run, review the plan, protect any branch names you want to keep, then apply to reclaim a clean repository.
Quick Start
Ask the agent to prune stale worktrees and branches in this repository, starting with a dry-run so you can review the plan before applying it.