From git-sweep
Clean stale git branches and worktrees interactively. Audits local/remote branches, detects squash-merged and orphaned branches, presents categorized cleanup with user confirmation. Use when: "git sweep", "sweep branches", "branch cleanup", "prune stale branches".
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-sweep:git-sweepThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Route to the correct cleanup phase based on repo state.
Route to the correct cleanup phase based on repo state.
git branch --show-currentgit rev-parse --show-toplevel | sed 's|.*/||'git worktree listtest -x "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-audit" && test -x "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-apply" && echo "ok" || echo "missing"if tools == "missing":
STOP — tell user: git-clean-audit and/or git-clean-apply not executable.
Run: chmod +x "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-audit" "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-apply"
else:
invoke /git-sweep-audit
The audit command handles all "nothing to clean" detection itself (local branches, remote branches, worktrees). Do not short-circuit here.
npx claudepluginhub bengous/claude-code-plugins --plugin git-sweepAnalyzes and safely cleans up local git branches and worktrees, categorizing them as merged, squash-merged, superseded, or active work before deletion.
Safely analyzes and cleans up local git branches/worktrees: categorizes merged/squash-merged/superseded/active, groups related ones, deletes only after user approval.
Safely identifies and deletes merged and stale Git branches after fetching latest state, filtering by pattern, and user confirmation via interactive prompts. Protects main branches.