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/kumaran-is/claude-code-onboardingWrote 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/kumaran-is/claude-code-onboarding/branch-cleanup)<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/branch-cleanup"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/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.00054 | $0.00784 |
| Opus 5 | $0.00027 | $0.00392 |
| Sonnet 5 | $0.00011 | $0.00157 |
| Haiku 4.5 | $0.00005 | $0.00078 |
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 4d 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 — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Branch Cleanup
Audit and clean up local and remote branches safely. Always categorises before deleting.
Step 1 — Gather Repository State
echo "=== Current branch ==="
git branch --show-current
echo "=== All local branches (by last commit) ==="
git for-each-ref --sort=-committerdate refs/heads/ \
--format='%(refname:short) %(committerdate:relative) %(authorname)'
echo "=== Merged into develop/main ==="
git branch --merged develop 2>/dev/null || git branch --merged main 2>/dev/null
echo "=== Remote tracking branches ==="
git branch -r
Step 2 — Determine Mode
Check $ARGUMENTS for a mode flag:
| Flag | Behaviour |
|---|---|
| (none) | Interactive — confirm before each deletion |
--dry-run |
Show what would be deleted; make no changes |
--force |
Delete all merged branches without per-branch confirmation |
--remote-only |
Prune stale remote-tracking refs only; skip local branches |
--local-only |
Delete merged local branches only; skip remote prune |
Step 3 — Protected Branches (NEVER delete)
Skip these regardless of mode or flags:
main,master,develop,staging,production- Any branch matching
release/*orhotfix/* - The currently checked-out branch
- Any branch with unpushed commits (
git log origin/<branch>..<branch>returns commits)
Step 4 — Categorise Branches
Classify every non-protected branch into one of:
- Safe to delete — merged into develop/main, no unpushed commits
- Stale — last commit > 30 days ago, not merged → list for human review, do NOT auto-delete
- Orphaned remote — remote-tracking ref with no active PR → prune with
git remote prune origin
Step 5 — Execute Cleanup
# Always prune stale remote-tracking refs first (safe, no branch deleted)
git remote prune origin
# Get merged branches excluding protected patterns
git branch --merged develop 2>/dev/null | \
grep -vE '^\*|\bmain\b|\bmaster\b|\bdevelop\b|\bstaging\b|\bproduction\b|release/|hotfix/'
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.
- 4d ago First seen · 93 lines · 54 tokens per session scan A 2d56be989be8
branch-cleanup is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 54 tokens to every session and 784 once invoked, about $0.0003 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.
handoff
Export a Waybill Bundle by default, or import one when requested.
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.