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/openshift-eng/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/openshift-eng/ai-helpers/branch-cleanup)<a href="https://agentmods.dev/commands/openshift-eng/ai-helpers/branch-cleanup"><img src="https://agentmods.dev/badge/commands/openshift-eng/ai-helpers/branch-cleanup.svg" alt="Measured on agentmods" 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.02539 |
| Opus 5 | $0.00006 | $0.01269 |
| 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 3d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- branch-cleanup — 97% identical, 2 lines differ
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.
- 3d ago First seen · 279 lines · 12 tokens per session scan A 7da07cf21473
branch-cleanup is a command published in the GitHub repository openshift-eng/ai-helpers (116 stars, last pushed 2d ago), licensed Apache-2.0. It adds 12 tokens to every session and 2,539 once invoked, about $0.0001 per session on Opus 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-09-03.
Other commands, from other repositories
commit
A command that examines staged Git changes and proposes a commit message using the Conventional Commits format, such as feat, fix, or docs. Git is a tool for tracking changes to code.
release-notes
Generate consistent, well-structured release notes from git history. Triggered on release tags following semver patterns (v..) to produce categorized changelog with breaking changes, features, fixes, and contributor attribution.
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…
repo-audit
Audit a codebase (local or remote GitHub/GitLab) against architecture principles and requirements, surfacing drift, risk, and missing decisions.
pr
Handle the full workflow from current branch state to an open, CI-monitored pull request.
release-plan
A release-planning command for a software change. It documents the release scope, rollback plan, gradual or full rollout, and monitoring before waiting for human approval.