git-sweep

git-sweep is a skill for Claude Code from bengous/claude-code-plugins. It costs 76 tokens per session (854 once invoked), scanned A, original, MIT.

An interactive cleanup tool for Git branches and worktrees, which are separate working directories linked to one repository.

In plain words
What is it for?
Use it to review and remove obsolete local or remote branches and free worktrees after confirming the cleanup.
Why use it?
It identifies finished or stale work and checks whether the base branch already contains it, including after a squash or rebase, before deletion.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the git-sweep plugin — 1 skill shipped together

Good fit Use it to review and remove obsolete local or remote branches and free worktrees after confirming the cleanup.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add bengous/claude-code-plugins
Claude Code
/plugin install git-sweep

Made for: Claude Code.

Or install git-sweep, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-sweep

README.md
[![agentmods](https://agentmods.dev/badge/skills/bengous/claude-code-plugins/git-sweep/github.svg)](https://agentmods.dev/skills/bengous/claude-code-plugins/git-sweep)
Your own site
<a href="https://agentmods.dev/skills/bengous/claude-code-plugins/git-sweep"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/git-sweep/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-sweep

Your own site · 80×15
<a href="https://agentmods.dev/skills/bengous/claude-code-plugins/git-sweep"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/git-sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 854 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.00854
Opus 5.5 $0.00030 $0.00342
Sonnet 5.5 $0.00015 $0.00171
Haiku 4.5 $0.00008 $0.00085

Measured 1mo ago against content hash f234a0f85f32, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-sweep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

git-sweep/skills/git-sweep/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Sweep

Route to the correct cleanup phase based on repo state. The phase files audit.md and apply.md live in this skill's base directory.

Inputs

  • base: $ARGUMENTS (optional: the base branch to audit against, e.g. /git-sweep dev; empty lets the backend resolve the trunk: git config sweep.base, then origin/HEAD, then main/master/trunk)
  • branch: !git branch --show-current
  • repo: !git rev-parse --show-toplevel
  • worktrees: !git worktree list
  • pending: !test -f "$(git rev-parse --absolute-git-dir)/git-sweep-manifest.json" && echo "yes" || echo "no"
  • tools: !test -x "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-audit.ts" && test -x "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-apply.ts" && echo "ok" || echo "missing"

Routing

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.ts" "${CLAUDE_PLUGIN_ROOT}/scripts/git-clean-apply.ts"

if pending == "yes":
  # A previous run left operations unexecuted (partial failure, or an
  # interrupted hand-off). The file holds an already-confirmed selection.
  AskUserQuestion:
    header:   "Manifest"
    question: "A pending cleanup manifest exists. Apply it, or re-audit?"
    options:  "Apply pending manifest (Recommended)"
              | "Re-audit (overwrites it)"
  if "Apply pending manifest":
    Read apply.md and follow it
    (do not continue below)

Read audit.md and follow it

The audit phase handles all "nothing to clean" detection itself (local branches, remote branches, worktrees). Do not short-circuit here.

Configuration (git config, all optional)

  • sweep.base — trunk to audit against when no argument is given
  • sweep.protect (multi-valued) — extra branches never proposed for deletion
  • sweep.unprotect (multi-valued) — lift names from the default protected set (main, master, trunk, dev, develop); the audited base stays protected
  • sweep.agentPrefix / sweep.backupPrefix — classification prefixes (defaults worktree-agent-, backup/; they must not overlap)
  • sweep.maxAgeDays — age bound for the containment test (default 180)

Read the full file on GitHub · 85 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 85 lines · 76 tokens per session scan A f234a0f85f32

Subscribe to this mod's changes

git-sweep is a skill published in the GitHub repository bengous/claude-code-plugins (5 stars, last pushed yesterday), licensed MIT. It adds 76 tokens to every session and 854 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.