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/axiomantic/spellbookWrote 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/axiomantic/spellbook/finish-branch-cleanup)<a href="https://agentmods.dev/commands/axiomantic/spellbook/finish-branch-cleanup"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/finish-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/axiomantic/spellbook/finish-branch-cleanup"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/finish-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.00020 | $0.00477 |
| Opus 5.5 | $0.00008 | $0.00191 |
| Sonnet 5.5 | $0.00004 | $0.00095 |
| Haiku 4.5 | $0.00002 | $0.00048 |
Grade C, and why
finish-branch-cleanup scanned grade C with 1 finding 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 2mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- Force-removing a worktree (`git worktree remove --force`, `rm -rf`) without explicit user confirmation What it actually says
Step 5: Cleanup Worktree
Invariant Principles
- Options 2, 3, and 4 mean hands off — pushed, mid-flight, and parked work keeps its worktree; cleanup runs only for Options 1 and 5
- Detect before deleting — Verify you are in a worktree before running removal commands
- Uncommitted changes are a red flag — Warn before removing a worktree with uncommitted changes
Applicability
| Option | Cleanup Worktree? |
|---|---|
| 1. Merge locally | Yes |
| 2. Create PR | NO — Keep worktree intact |
| 3. Create PR + PR dance | NO — Keep worktree intact |
| 4. Keep as-is | NO — Keep worktree intact |
| 5. Discard | Yes |
Cleanup Procedure (Options 1, 5)
Detect if currently in a worktree:
git worktree list | grep $(git branch --show-current)
If output is empty: not in a worktree. Report: "No worktree detected. Nothing to remove."
If output is non-empty: the first field of the matching line is the worktree path. Remove it:
git worktree remove <worktree-path>
Report final state: "Worktree at <path> removed. Integration complete."
<FINAL_EMPHASIS> Clean integration means no surprises: detect before acting, warn on anomalies, never destroy work without permission. </FINAL_EMPHASIS>
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.
- 2mo ago First seen · 57 lines · 20 tokens per session scan C 2fd9b3306c11
finish-branch-cleanup is a command published in the GitHub repository axiomantic/spellbook (13 stars, last pushed 5d ago), licensed MIT. It adds 20 tokens to every session and 477 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
finish-branch-cleanup compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| finish-branch-cleanupaxiomantic/spellbook | Command | 13 | 5d ago | MIT | C | 20 | Claude Code |
| update-infos-releaseFlorianBruniaux/claude-code-ultimate-guide | Command | 7.6k | today | CC-BY-SA-4.0 | A | 18 | Claude Code |
| releaseFlorianBruniaux/claude-code-ultimate-guide | Command | 7.6k | today | CC-BY-SA-4.0 | A | 20 | Claude Code |
| worktreeFlorianBruniaux/claude-code-ultimate-guide | Command | 7.6k | today | CC-BY-SA-4.0 | A | 11 | Claude Code |
| watch-cidamusix/atomic-claude | Command | 117 | yesterday | MIT | A | 90 | Claude Code |
| session-reportdamusix/atomic-claude | Command | 117 | yesterday | MIT | A | 31 | Claude Code |
| commitdamusix/atomic-claude | Command | 117 | yesterday | MIT | A | 55 | Claude Code |