Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By bengousv3.6.0MITIn 1 marketplace
Deletes local git branches and worktrees only after proving their content is already in the base. An unattended pass runs without asking, so Claude may trigger it at session end, and it needs bun.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Git branch and worktree cleanup that deletes only what it can prove is already in the base, and says why it kept the rest.
| Skill | Invocation | What it does |
|---|---|---|
git-sweep | /git-sweep [base] | Audits local and remote branches and worktrees, shows each category with its proof, and asks before deleting anything. Typed by the user only. |
auto-sweep | git-sweep:auto-sweep [--dry-run] [--base <branch>] | Deletes, with no prompt, the local branches it proves and the agent worktrees standing on them, and archives abandoned agent branches. Claude runs it on its own at the end of a session or after a landing. |
auto-sweep is model-invocable although it deletes unasked, because every deletion has an undo or loses nothing: a proven branch's content is in the base, an archived branch restores, and a removed worktree loses only the ignored paths a checkout regenerates and its ignored symbolic links, never their targets.
A branch is deleted only with one of these, from scripts/proofs.ts:
ancestry: its tip is reachable from the base; nothing is lost.no-merge-delta: merging it into the base would change no file; the content is there, the intermediate commits are not.merged-pr: a merged GitHub pull request, landed in the base, holds every commit of the branch. Needs gh.A patch-id match is not a proof: it would call contained a squash the base later reverted.
auto-sweepscripts/auto-sweep.ts runs the audit and the apply of /git-sweep in one pass, with no question. It judges against --base, else sweep.base, else dev or develop, else origin/HEAD, then main, master or trunk. --dry-run prints the same summary and changes nothing.
An agent worktree is a direct child of .claude/worktrees/ whose name starts with agent-, where Claude Code puts its subagents' worktrees; the path counts, not the branch name, since agents rename their branch. An agent branch is one named with sweep.agentPrefix (default worktree-agent-), or checked out only in an agent worktree.
What it deletes:
DISPOSABLE_IGNORED names: node_modules/ and __pycache__/ at any depth, .stryker-tmp/, vellum/test-results/, flaky-reports/, and the tsconfig.json and .claude-plugin/types/ Claude Code writes at a plugin's root. The summary names them;What it archives: an unproven agent branch, with no worktree or a clean agent worktree, whose last pull request was closed unmerged and whose last commit are both 14 days old or more (CLOSED_PR_GRACE_DAYS), or that has no pull request and no commit for 30 days (NO_PR_IDLE_DAYS). Without an origin remote no branch has a pull request; with one gh cannot read, nothing is archived. The branch tip is written to refs/archive/<branch> first, then the branch and its worktree go. Restore one with:
git branch <branch> refs/archive/<branch>
git for-each-ref refs/archive/ lists them. A failed deletion drops the archive ref it just wrote. An archive ref never expires: git update-ref -d refs/archive/<branch> drops one.
What it keeps, each with its reason in the summary:
sweep.protect) and the current branch;plans/ directory there may be the only copy of a plan;.claude/worktrees/<name> without the agent- prefix (EnterWorktree's): a live session may stand in one. Like any worktree outside .claude/worktrees/agent-*, it stays with its branch, listed as not swept; the summary ends with how many of them are clean and stand on work the base already holds, which /git-sweep removes with the user;clean, HEAD in <base>, its changes, or the HEAD the base does not hold. None is removed, an agent's included: commits made there and since left behind are held by the worktree's own HEAD reflog alone, which the removal deletes, and a rebase or a bisect in progress shows a clean status too;worktree-agent-<id>), while that agent runs;gh cannot read;/git-sweep handles those, with the user.7-day copy clicks
npx claudepluginhub bengous/claude-code-plugins --plugin git-sweepBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground