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/wangke19/gemini-ai-helpersWrote 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/wangke19/gemini-ai-helpers/branch-cleanup)<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/branch-cleanup"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/branch-cleanup/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/wangke19/gemini-ai-helpers/branch-cleanup"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/branch-cleanup.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.00012 | $0.02540 |
| Opus 5 | $0.00006 | $0.01270 |
| Sonnet 5 | $0.00002 | $0.00508 |
| Haiku 4.5 | $0.00001 | $0.00254 |
Grade A, and why
branch-cleanup 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 8d 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.
This is a copy
97% identical to branch-cleanup — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 279 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Name
git:branch-cleanup
Synopsis
/git:branch-cleanup [--dry-run] [--merged-only] [--remote]
Description
The git:branch-cleanup command identifies and removes old, defunct, or merged branches from your local repository (and optionally from remote). It helps maintain a clean repository by removing branches that are no longer needed, such as:
- Branches that have been merged into the main branch
- Branches that no longer exist on the remote
- Stale feature branches from completed work
The command performs safety checks to prevent deletion of:
- The current branch
- Protected branches (main, master, develop, etc.)
- Branches with unmerged commits (unless explicitly overridden)
The spec sections is inspired by https://man7.org/linux/man-pages/man7/man-pages.7.html#top_of_page
Implementation
The command should follow these steps:
-
Identify Main Branch
- Detect the primary branch (main, master, etc.)
- Use
git symbolic-ref refs/remotes/origin/HEADorgit branch -rto determine
-
Gather Branch Information
- List all local branches:
git branch - Get current branch:
git branch --show-current - Identify merged branches using multi-layered detection:
- Standard merge:
git branch --merged <main-branch> - Merge commit messages:
git log <main-branch> --merges --oneline - Content comparison:
git diff <main-branch>...<branch> --quiet - Cherry-pick detection:
git cherry <main-branch> <branch>
- Standard merge:
- Check remote tracking:
git branch -vv - Find remote-deleted branches:
git remote prune origin --dry-run
- List all local branches:
-
Categorize Branches
- Merged branches: Detected via one of these methods:
- Standard: Commits directly in main branch history
- Merge commit: Found in main's merge commit messages
- Content-identical: All changes present in main (rebased/cherry-picked)
- Cherry-picked: All commits have equivalents in main
- Gone branches: Remote tracking branch no longer exists
- Stale branches: Last commit older than threshold (e.g., 3 months)
- Protected branches: main, master, develop, release/, hotfix/
- Merged branches: Detected via one of these methods:
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.
- 8d ago First seen · 279 lines · 12 tokens per session scan A 9c721a1ca8be
branch-cleanup is a command published in the GitHub repository wangke19/gemini-ai-helpers (2 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 12 tokens to every session and 2,540 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 97% identical to branch-cleanup, differing in 2 lines, and is treated as a copy.
Other commands, from other repositories
worktree
Set up parallel agent sessions on independent tasks via git worktrees. Use when asked to '/worktree', 'git worktree', 'parallel branches', 'isolated branch workspace', 'work on two things at once'.
wtfp:update
Check for a newer compatible package or plugin release and install it only after approval.
mem-archeo-git
Phase 3 of the triphasic archeo: reconstruct the Git history of an existing repo as dated archives, enriched by the topology and stack from Phases 0/1/2.
careful
Warn before destructive commands (rm -rf, DROP TABLE, git push --force, docker prune). Pairs with /freeze and /guard. Inspired by gstack.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.