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 | $0.00010 | $0.00238 |
| Sonnet 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 8d 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.
- 8d 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 (10 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 477 once invoked, about $0.0001 per session on Opus 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.
Other commands, from other repositories
watch-ci
Spawn a background Haiku-backed subagent to watch CI for the current branch (or specified target). Provider-agnostic — the subagent inspects project signals to identify the CI system (GitHub Actions, GitLab CI, CircleCI, etc.) and picks the right CLI. Returns immediately; reports back when CI reaches a terminal state.
undo-commit
Soft-undo the last commit. Restores its changes as staged, leaves working tree intact. Refuses if HEAD is already pushed to a tracked remote.
session-report
Capture what changed this session and why, scoped to the current branch. Read by ship verbs when synthesizing the commit message; deleted after a successful commit.
commit
Stage, commit, and optionally ship further. Pass an escalation token (push, pr, merge, squash, squash merge) to skip the prompt. With no token, commits then asks how far to ship. Delegates message format to the atomic-git-discipline skill.
sync
Sync memories with git remote (deprecated - SQLite is now authoritative).
autocommit
Toggle auto git commits on/off for this project. Run without args to see status, or with "on"/"off" to set.