Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cleans up stale git worktrees by removing merged branches, reporting disk usage, and reviewing unmerged ones interactively.
71% 90%+19 ptsof test cases passed
Passed 19 of 21 test cases with the skill, and 15 of 21 without it.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Batch cleanup of stale git worktrees. Safely removes merged branches, reports disk usage, and handles unmerged branches interactively.
Core principle: Auto-clean merged worktrees, interactive review for unmerged, always report what was reclaimed.
Part of: Worktree Lifecycle Suite: /git-worktree | /git-worktree-status | /git-worktree-remove
git worktree list| Flag | Effect |
|---|---|
--dry-run | Preview what would be cleaned, no changes |
--all | Include unmerged worktrees (interactive confirmation each) |
--remote | Also delete the remote branch of each removed worktree (off by default) |
--force | Remove all worktrees without confirmation (dangerous) |
# Get main branch name
MAIN_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
MAIN_BRANCH=${MAIN_BRANCH:-main}
# Protected branches (never auto-clean)
PROTECTED="main master develop staging production"
# List all worktrees (skip main working tree)
git worktree list --porcelain | while read line; do
# Parse worktree path and branch
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.