Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Delete local branches whose remote has been deleted ([gone]), including their worktrees. Use for branch cleanup after merging PRs.
.claude/skills/kdlbs-clean-branches/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -27% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -37% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -44% | 0% |
| case-14 | ✓→✗ | ▼ Worse | -60% | 0% |
Remove local branches that have been deleted on the remote (marked [gone]), including any associated git worktrees.
bash git fetch --prune
bash git branch -v Branches with a + prefix have associated worktrees that must be removed before deletion.
bash git worktree list
bash git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do echo "Processing branch: $branch" worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}') if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then echo " Removing worktree: $worktree" git worktree remove --force "$worktree" fi echo " Deleting branch: $branch" git branch -D "$branch" done
[gone], say no cleanup was needed.Other measured skills in the registry, with their headline benchmark lift.