distill

distill is a command for coding agents from Buckeyes22/subagent-model-routing. It costs 19 tokens per session (1,039 once invoked), scanned A, original, MIT.

A command for turning recorded observations about coding-agent models into updated capability cards and rankings. It works with a model-routing project’s committed files and observation ledger.

In plain words
What is it for?
Use it to review new ledger entries and update the project’s capability cards and rankings section.
Why use it?
It keeps model-selection guidance aligned with newly recorded observations instead of relying on stale notes.

Command

Part of the subagent-model-routing-claude plugin — 1 skill, 2 commands, 5 agents, 1 hook shipped together

Install

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.

agentmods
npx agentmods add commands/buckeyes22/subagent-model-routing/distill
Clone the repo
git clone --depth 1 https://github.com/Buckeyes22/subagent-model-routing

Or install subagent-model-routing-claude, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 5 agents, 1 hook.

Wrote 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.

agentmods badge for distill

README.md
[![agentmods](https://agentmods.dev/badge/commands/buckeyes22/subagent-model-routing/distill.svg)](https://agentmods.dev/commands/buckeyes22/subagent-model-routing/distill)
Your own site
<a href="https://agentmods.dev/commands/buckeyes22/subagent-model-routing/distill"><img src="https://agentmods.dev/badge/commands/buckeyes22/subagent-model-routing/distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.01039
Opus 5 $0.00010 $0.00519
Sonnet 5 $0.00004 $0.00208
Haiku 4.5 $0.00002 $0.00104

Measured 3d ago against content hash 77784bb3419e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

distill 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 3d 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.

plugins/subagent-model-routing-claude/commands/distill.md · 23 lines

What it actually says

Distill the subagent-model-routing ledger. Work inline (no dispatch needed):

  1. Resolve the writable source checkout. First try git rev-parse --show-toplevel from the current directory and accept it only if it contains plugins/subagent-model-routing-claude/skills/subagent-model-routing/ledger. Otherwise try ${SUBAGENT_MODEL_ROUTING_HOME:-$HOME/.local/share/subagent-model-routing} and accept it only if it is a Git checkout containing that ledger directory. Set ROOT to the accepted absolute path, LEDGER_DIR="$ROOT/plugins/subagent-model-routing-claude/skills/subagent-model-routing/ledger", and SKILL="$ROOT/plugins/subagent-model-routing-claude/skills/subagent-model-routing/SKILL.md". If neither candidate qualifies, stop and tell the user to run the command from the source checkout or set SUBAGENT_MODEL_ROUTING_HOME to it. Never edit an installed plugin cache: those edits are neither durable nor necessarily in Git.
  2. Read the hot log. Use ${SUBAGENT_MODEL_ROUTING_LEDGER:-$HOME/.claude/subagent-model-routing/ledger/observations.jsonl}. Scope to entries newer than the newest "Last distilled" date across $LEDGER_DIR/*.md (or the $ARGUMENTS focus). If no card carries an ISO date yet, treat all entries as in scope. If the file is missing or empty, say so and stop.
  3. Summarize per model. Report dispatch counts, failure/clip/stall rates, wall-time distribution from source:"shim" terminal lines (event:"finished", or legacy lines with no event), and every qualitative note from source:"orchestrator" lines. Treat source:"shim", event:"started" as orphan/killed-run visibility only; report starts without matching finished lines separately, but do not count them as completed dispatch outcomes. Quote notes verbatim in the working summary.
  4. Map each record by both shim and model; do not derive a filename from the model string alone.
    • shim:"codex" with a GPT model ID -> $LEDGER_DIR/codex.md.
    • shim:"grok" with grok-* -> $LEDGER_DIR/grok.md.
    • shim:"claude": sonnet -> claude-sonnet-5.md, opus -> claude-opus-4.8.md, and fable -> claude-fable-5.md only while the installed alias resolves to that exact version. Apply the same rule to full Claude model IDs after identifying their version. If an alias has advanced, use an existing matching versioned card or ask before creating one. Never create a Mythos-specific card.
    • shim:"kimi" with a Kimi model ID or configured-default label -> kimi.md.
    • shim:"opencode": legacy Kimi provider/model strings such as kimi-* or kimi-for-coding/* -> kimi.md; Z.ai/GLM strings such as zai-*, zai-coding-plan/*, or glm-* -> glm.md; case-insensitive minimax* provider/model strings -> minimax.md; Qwen provider/model strings -> qwen.md.
    • shim:"qwen": all observations -> qwen.md.
    • For an unknown custom provider, update an existing card only when the mapping is explicit and unambiguous. Otherwise report the unmapped records and ask the user which existing card owns them; do not invent a card quietly.
  5. Propose card updates. For each mapped model with new evidence, edit its existing card: move confirmed patterns into Excels/Struggles/Caveats with an evidence pointer (date plus one-line summary), and update "Last distilled". Do not change a Tier line unless the evidence is strong and you flag it prominently.
  6. Update rankings only when warranted. Rewrite the block between <!-- LEDGER:RANKINGS START --> and <!-- LEDGER:RANKINGS END --> in $SKILL only if tiers or seats changed; otherwise update its "last distilled" date only.
  7. Show the durable diff. Run git -C "$ROOT" diff -- "$LEDGER_DIR" "$SKILL" and give a one-paragraph summary. Do not commit; the user reviews and commits.
  8. Call out material changes. If a tier moved or a confirmed failure mode was added, remind the user to promote it to the brain through an inbox page and PR per the brain's CLAUDE.md.
Changes

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.

  1. 3d ago First seen · 23 lines · 19 tokens per session scan A 77784bb3419e

Subscribe to this mod's changes

distill is a command published in the GitHub repository Buckeyes22/subagent-model-routing (5 stars, last pushed 8d ago), licensed MIT. It adds 19 tokens to every session and 1,039 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.