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/khaledsaeed18/dotclaude/clean-branchesgit clone --depth 1 https://github.com/KhaledSaeed18/dotclaudeWrote 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/khaledsaeed18/dotclaude/clean-branches)<a href="https://agentmods.dev/commands/khaledsaeed18/dotclaude/clean-branches"><img src="https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/clean-branches.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 | $0.00092 | $0.00874 |
| Opus 5 | $0.00046 | $0.00437 |
| Sonnet 5 | $0.00018 | $0.00175 |
| Haiku 4.5 | $0.00009 | $0.00087 |
Grade A, and why
clean-branches 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 — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
Options: $ARGUMENTS
Current branch and remotes:
!git branch --show-current 2>/dev/null
!git remote -v 2>/dev/null | head -4
Task
Identify merged and stale local branches and remove them, after presenting a clear list of what will be deleted and why.
Step 1: Gather branch state
# All local branches with their last commit date and whether they are merged into main/master
git branch -v --merged main 2>/dev/null || git branch -v --merged master 2>/dev/null
# Branches with no corresponding remote-tracking ref (orphaned after remote deletion)
git branch -vv | grep ": gone]"
# All local branches with last commit date, sorted oldest first
git for-each-ref --sort=committerdate refs/heads/ \
--format="%(committerdate:short) %(refname:short) %(upstream:track)"
Step 2: Classify branches for deletion
Candidates for deletion are branches that meet one or more of these criteria:
- Fully merged: the branch tip is reachable from
mainormaster(shown bygit branch --merged). - Remote gone: the tracking remote branch was deleted (shown by
": gone]"ingit branch -vv). - Stale and inactive: last commit is more than 90 days old and the branch has no open remote counterpart.
Protected branches - never delete:
main,master,develop,dev,staging,production- The currently checked-out branch
- Any branch with uncommitted changes (this cannot happen for local branches, but note it as a constraint)
Build two lists:
- Safe to delete: merged or remote-gone branches that are not protected.
- Needs review: stale branches that are not merged and whose remote still exists (present these for manual decision, do not auto-delete).
Step 3: Confirm and act
Present the lists clearly before deleting anything:
Branches to delete (merged or remote-gone):
feature/old-login last commit: 2024-11-03 [merged into main]
fix/typo-in-readme last commit: 2025-01-14 [remote: gone]
Branches for manual review (stale, not merged):
experiment/new-nav last commit: 2024-09-12 [remote still exists]
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 · 92 lines · 92 tokens per session scan A 85e2a96aa514
clean-branches is a command published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 2d ago), licensed MIT. It adds 92 tokens to every session and 874 once invoked, about $0.0005 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-08-31.
Other commands, from other repositories
statusbar-style
Switch the status-bar style (classic / capsule / hairline).
fest-show
Show festival progression (in-progress tasks, roadmap, and dependency view).
superpowers-execute
Execute the current GSD phase plan with Superpowers instead of gsd-execute-phase.
config
Command "config" from sdebruyn/fabric-dw-mcp-cli, covering configuration & defaults, http retry budget, sql retry budget, mcp workspace allowlist {#mcp-workspace-allowlist} and mcp server log level.
deps-age
Analyze dependency freshness and maintenance activity.
setup
Diagnose-first project setup with state machine — scans, confirms, interviews, writes.