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.
npx agentmods add commands/bengous/claude-code-plugins/cleanup-gitgit clone --depth 1 https://github.com/bengous/claude-code-pluginsWhat 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 | $0.00000 | $0.00658 |
| Opus 5 | $0.00000 | $0.00329 |
| Sonnet 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 yesterday.
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.
- yesterday 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 (4 stars, last pushed 2d ago), 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.
Other commands, from other repositories
pr-address
Address PR review comments on current branch.
plan-save
Save the current session's plan to GitHub as an issue.
enforce_standards
CRITICAL: Before running the code standards enforcer, we must prepare the stack properly and abort if there are merge conflicts.
OPSX: Sync
Sync delta specs from a change to main specs.
context
项目上下文管理:初始化 .context 目录、记录决策日志、压缩归档、查看历史.
OPSX: Verify
Verify implementation matches change artifacts before archiving.