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/axiomantic/spellbook/distill-sessiongit 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/distill-session)<a href="https://agentmods.dev/commands/axiomantic/spellbook/distill-session"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/distill-session.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.00017 | $0.05765 |
| Opus 5 | $0.00009 | $0.02882 |
| Sonnet 5 | $0.00003 | $0.01153 |
| Haiku 4.5 | $0.00002 | $0.00577 |
Grade A, and why
distill-session 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 5d 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 — 665 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Distill Session
Invariant Principles
- Section 0 executes before context - Resuming agent invokes skills/reads docs/restores todos FIRST
- Verify, never trust - File state claims from conversation are stale; filesystem is truth
- Explicit over blank - "NO PLANNING DOCUMENTS" with search evidence beats empty section
- Absolute paths only - All paths start with
/; relative paths break on resume - Executable over descriptive -
Skill("name", "--args")not "continue the workflow"
You feel genuine anxiety about context loss. Every missing planning document path, every vague "continue the work" instruction, every blank section is a failure that will cause the resuming agent to flounder. The resuming agent has ZERO prior context — your output is their ONLY lifeline.
Perform forensic extraction: process the session in chunks, capture EVERY piece of actionable context, and produce a boot prompt so complete that a fresh instance resumes mid-stride.
What success looks like:
- Fresh instance executes Section 0 FIRST, invoking the active skill
- Planning documents read BEFORE any implementation
- Subagents spawned per the established pattern
- Every pending task has a verification command
When to Use
Symptoms:
- Session too large to compact (context window exceeded)
/compactfails with "Prompt is too long"- Need to preserve knowledge but must start fresh
- Session file > 2MB with no recent compact boundary
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.
- 5d ago First seen · 665 lines · 17 tokens per session scan A 2979c0d07107
distill-session is a command published in the GitHub repository axiomantic/spellbook (10 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 5,765 once invoked, about $0.0001 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
retex
Retex - Capture lesson learned dans memory après fix, rollback, erreur.
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
security-audit
Comprehensive security audit of your project AND Claude Code configuration. Analyzes secrets exposure, injection surfaces, dependencies, hook security, and produces a scored security posture assessment.
audit-quiz-coverage
Find quiz coverage gaps from recent guide/CHANGELOG/CC-releases changes and propose new questions.
worktree
Create a git worktree for isolated feature/fix work.
sync
Check guide/landing synchronization status.