Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/bengous/claude-code-pluginsWrote 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.
[](https://agentmods.dev/commands/bengous/claude-code-plugins/cleanup-git)<a href="https://agentmods.dev/commands/bengous/claude-code-plugins/cleanup-git"><img src="https://agentmods.dev/badge/commands/bengous/claude-code-plugins/cleanup-git/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.
<a href="https://agentmods.dev/commands/bengous/claude-code-plugins/cleanup-git"><img src="https://agentmods.dev/badge/commands/bengous/claude-code-plugins/cleanup-git.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00658 |
| Opus 5.5 | $0.00000 | $0.00263 |
| Sonnet 5.5 | $0.00000 | $0.00132 |
| Haiku 4.5 | $0.00000 | $0.00066 |
Grade A, and why
cleanup-git 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Up Git Repository
Perform git repository cleanup operations based on the analysis from /git-tools:analyze-git.
IMPORTANT: This command performs DESTRUCTIVE operations. Run /git-tools:analyze-git first to review what will be deleted.
Prerequisites
You MUST run /git-tools:analyze-git before using this command to understand what will be deleted.
Step 1: Clean Gone Branches with Worktrees
Run the following command to remove worktrees and delete branches marked as [gone]:
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
After completion, report:
- Number of worktrees removed
- Number of branches deleted
- Any errors encountered
Step 2: Prune Stale Worktrees
Run the following command to prune worktrees marked as prunable:
git worktree prune -v
Report the output showing which worktrees were pruned.
Step 3: Clean Closed Dependabot Branches
IMPORTANT: Before deleting, verify these are truly closed/merged by checking the PR list.
For each dependabot branch with a CLOSED or MERGED PR:
- First, update remote references:
git fetch --prune
- The fetch with --prune will automatically remove stale remote references
Report:
- Number of dependabot branches cleaned
- Any branches that still remain (likely have OPEN PRs)
Step 4: Final Verification
After all cleanup operations:
- List remaining local branches:
git branch
- List remaining remote branches:
git branch -r
- List remaining worktrees:
git worktree list
Step 5: Provide Cleanup Summary
Create a summary report with:
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.
- 3mo ago First seen · 96 lines · 0 tokens per session scan A 7f88d6569c21
cleanup-git is a command published in the GitHub repository bengous/claude-code-plugins (6 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 658 tokens. 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.
cleanup-git compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cleanup-gitbengous/claude-code-plugins | Command | 6 | today | MIT | A | 0 | Claude Code |
| contextfengshao1227/ccg-workflow | Command | 6.0k | 12d ago | MIT | A | 23 | Claude Code |
| clean-branchesfengshao1227/ccg-workflow | Command | 6.0k | 12d ago | MIT | A | 23 | Claude Code |
| rollbackfengshao1227/ccg-workflow | Command | 6.0k | 12d ago | MIT | A | 22 | Claude Code |
| landgmickel/flow-next | Command | 735 | yesterday | MIT | A | 13 | Claude Code |
| resolve-prgmickel/flow-next | Command | 735 | yesterday | MIT | A | 26 | Claude Code |
| shipdwarvesf/dwarves-kit | Command | 15 | yesterday | MIT | A | 28 | Claude Code |