distill

distill is a command for coding agents from naimkatiman/continuous-improvement. It costs 38 tokens per session (486 once invoked), scanned A, original, MIT.

A command that finds tool-use patterns from successful past coding sessions and turns them into reusable draft procedures. You review and promote each draft before it can guide the agent.

In plain words
What is it for?
Use it to inspect repeated successful tool sequences, create editable learning drafts, and promote approved drafts as suggested instincts.
Why use it?
It reduces the need to rediscover reliable workflows in every session while keeping unreviewed lessons from changing agent behavior.

Command

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/naimkatiman/continuous-improvement/distill
Clone the repo
git clone --depth 1 https://github.com/naimkatiman/continuous-improvement

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/naimkatiman/continuous-improvement/distill.svg)](https://agentmods.dev/commands/naimkatiman/continuous-improvement/distill)
Your own site
<a href="https://agentmods.dev/commands/naimkatiman/continuous-improvement/distill"><img src="https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 486 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.00038 $0.00486
Opus 5 $0.00019 $0.00243
Sonnet 5 $0.00008 $0.00097
Haiku 4.5 $0.00004 $0.00049

Measured 4d ago against content hash 5908caf79ea5, 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 4d 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.

commands/distill.md · 40 lines

What it actually says

/distill — Trajectory Distillation

Mine this project's observation log for tool sequences that recurred across multiple successful sessions, and turn the good ones into reusable instincts.

What it does

Groups observations into trajectories, keeps the ones that ended in a passing verification, and finds tool-sequence n-grams that recurred across distinct sessions. Backed by the ci_distill_candidates / ci_distill_propose / ci_distill_promote MCP tools (expert mode) and the skill-distillation skill.

The ladder

ci_distill_candidates           # list patterns that qualify (read-only)
ci_distill_propose id=<id>       # write a DRAFT (placeholder body) to drafts/<id>.yaml
# ... edit the draft body to capture the real recipe ...
ci_distill_promote id=<id>       # promote to a live instinct at 0.5 confidence (SUGGEST)

Drafts never affect behavior until promoted. The draft starts at 0.4 confidence in a drafts/ subdirectory the instinct loader ignores; promotion writes a live instinct at 0.5 (SUGGEST tier).

Candidate criteria

  • The trajectory must have ended in success (verify-exit-0 or reflection-pass).
  • The tool sequence must have recurred at least 3 times across at least 2 distinct sessions.
  • A pattern repeated only within one session is rejected — that is repetition, not a reusable skill.

Why the human edit step

A tool sequence is evidence, not a recipe. Read → Edit → Bash → Edit → Bash is a TDD loop, but the value is in the preconditions and concrete steps. Editing the draft body before promotion is the guard against fabricating confident skills from coincidental call ordering.

Pairs with

  • skill-distillation skill — the discipline this command runs.
  • continuous-improvement (core SKILL.md, Law 7 — Learn From Every Session).
  • recall — before promoting, check whether an existing instinct already covers the pattern.
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. 4d ago First seen · 40 lines · 38 tokens per session scan A 5908caf79ea5

Subscribe to this mod's changes

distill is a command published in the GitHub repository naimkatiman/continuous-improvement (7 stars, last pushed 9d ago), licensed MIT. It adds 38 tokens to every session and 486 once invoked, about $0.0002 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.