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/qinye6/pi-ccgWrote 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/qinye6/pi-ccg/clean-branches)<a href="https://agentmods.dev/commands/qinye6/pi-ccg/clean-branches"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/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.1 | $0.00023 | $0.00751 |
| Opus 5 | $0.00012 | $0.00376 |
| Sonnet 5 | $0.00005 | $0.00150 |
| Haiku 4.5 | $0.00002 | $0.00075 |
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 7d 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
100% identical to clean-branches — 0 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.
What it actually says
Clean-Branches - 清理 Git 分支
安全识别并清理已合并或长期未更新的分支。
使用方法
/clean-branches [options]
选项
| 选项 | 说明 |
|---|---|
--base <branch> |
基准分支(默认 main/master) |
--stale <days> |
清理超过 N 天未更新的分支 |
--remote |
同时清理远程分支 |
--dry-run |
只预览,不执行(默认) |
--yes |
跳过确认直接删除 |
--force |
强制删除未合并分支 |
执行工作流
🔍 阶段 1:预检
[模式:准备]
- 同步远端:
git fetch --all --prune - 读取保护分支配置
- 确定基准分支
📋 阶段 2:分析识别
[模式:分析]
已合并分支:
- 已完全合并到
--base的分支
过期分支(如指定 --stale):
- 最后提交在 N 天前的分支
排除:
- 从待清理列表中移除保护分支
📊 阶段 3:报告预览
[模式:报告]
## 将要删除的分支
### 已合并分支
- feature/old-feature (合并于 3 天前)
- bugfix/fixed-issue (合并于 7 天前)
### 过期分支
- experiment/old-test (最后更新 90 天前)
✅ 阶段 4:执行清理
[模式:执行]
仅在不带 --dry-run 且确认后执行:
# 本地分支
git branch -d <branch>
# 远程分支(如果 --remote)
git push origin --delete <branch>
# 强制删除(如果 --force)
git branch -D <branch>
保护分支配置
# 添加保护分支
git config --add branch.cleanup.protected develop
git config --add branch.cleanup.protected 'release/*'
# 查看保护分支
git config --get-all branch.cleanup.protected
示例
# 预览将清理的分支
/clean-branches --dry-run
# 清理已合并且超过 90 天未动的分支
/clean-branches --stale 90
# 清理已合并到 release/v2.1 的分支
/clean-branches --base release/v2.1 --remote --yes
最佳实践
- 优先 dry-run – 先预览再执行
- 活用 --base – 适配 release 工作流
- 谨慎 --force – 除非确定无用
- 团队协作 – 清理远程分支前先通知
- 定期运行 – 每月/季度一次保持清爽
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.
- 7d ago First seen · 118 lines · 23 tokens per session scan A 76fcb096a184
clean-branches is a command published in the GitHub repository qinye6/pi-ccg (10 stars, last pushed 12d ago), licensed MIT. It adds 23 tokens to every session and 751 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to clean-branches, differing in 0 lines, and is treated as a copy.
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.