distill

distill is a skill for Claude Code from komluk/scaffolding. It costs 71 tokens per session (1,171 once invoked), scanned A, original, MIT.

A method for extracting useful, reusable knowledge from conversations and routing it to shared, agent-specific, or conversation-specific memory. It uses evidence such as repeated patterns, architectural decisions, recurring bugs, and outdated file references.

In plain words
What is it for?
Use it when running knowledge-learning or distillation workflows, deciding whether an insight belongs in memory, or checking stored knowledge for duplicates and stale references. It covers candidate extraction, confidence scoring, and memory-tier selection.
Why use it?
It helps distinguish information worth saving from one-off details, reducing clutter in an agent's memory. Confidence scoring helps decide how broadly an insight should be shared.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the scaffolding plugin — 35 skills, 9 commands, 13 agents 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 skills/komluk/scaffolding/distill
Any agent
npx skills add komluk/scaffolding --skill distill
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 35 skills, 9 commands, 13 agents.

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/skills/komluk/scaffolding/distill.svg)](https://agentmods.dev/skills/komluk/scaffolding/distill)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/distill"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,171 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.1 $0.00071 $0.01171
Opus 5 $0.00036 $0.00585
Sonnet 5 $0.00014 $0.00234
Haiku 4.5 $0.00007 $0.00117

Measured 6d ago against content hash 52a4674afe73, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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.

skills/distill/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Distill Methodology

Guidelines for automated knowledge extraction and consolidation across memory systems.

Knowledge Candidate Criteria

An insight qualifies as a knowledge candidate when it meets ANY of these:

Criterion Source Example
Cross-conversation pattern 3+ context.md files contain the same insight "Redis pool exhaustion under SSE load"
Architectural decision design.md contains explicit Decision/Rationale section "Use pgvector for semantic search"
Recurring gotcha/bug Keyword match in specs: gotcha, bug, pattern, lesson "POST 301 redirect strips body"
Stale reference File path in memory points to non-existent file "app/backend/old_module.py"
Cross-tier duplicate Same entry in both KNOWLEDGE.md and agent MEMORY.md Duplicated bullet point

Confidence Scoring

Occurrences Confidence Tier Recommendation
5+ conversations 0.5 - 1.0 shared (KNOWLEDGE.md)
3-4 conversations 0.3 - 0.5 shared (with review)
1-2 conversations 0.1 - 0.2 agent-specific MEMORY.md
Decision section 0.7 fixed shared
Pattern keyword 0.5 fixed shared
Stale reference 0.9 fixed cleanup action

Auto-store threshold: candidates scoring >= 0.8 are auto-stored to the vector store (silent, cold layer) via semantic_store — see the memory-ingest Stop hook. This is the single source of truth for that threshold.

Tier Routing

Target When Path
shared Cross-cutting insight useful to all agents .scaffolding/agent-memory/shared/KNOWLEDGE.md
agent:{name} Domain-specific to one agent .scaffolding/agent-memory/agents/{name}/MEMORY.md
Overflow KNOWLEDGE.md would exceed 200 lines Route to most relevant agent file

Output Format

Candidates are structured as:

- content: The knowledge text (max 500 chars)
- source: File path or "conversations:N_occurrences"
- source_type: conversation | spec | memory | semantic
- confidence: 0.0-1.0
- target_tier: shared | agent:{name}
- tags: categorization tags

Read the full file on GitHub · 104 lines

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. 6d ago First seen · 104 lines · 71 tokens per session scan A 52a4674afe73

Subscribe to this mod's changes

distill is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed 1mo ago), licensed MIT. It adds 71 tokens to every session and 1,171 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

turnstile-brain-init

Opt-in bulk bootstrap of turnstile/code/ -- one linked note per source file. The default pipeline is lazy (code notes only for ticket-touched files, written when the ticket passes review); this is the eager exception. Dispatched by /turnstile:brain-init only.

febradc-github/turnstile · 65 tokens

turnstile-brain

Vault layout, the shared note format, and the check-the-brain-first mandate. Auto-loads whenever any turnstile skill starts new work or /turnstile:review is about to commit.

febradc-github/turnstile · 47 tokens

turnstile-remember

Files a user-dictated note into the vault via brain-curator -- the user authors the content, the curator only files, tags, and links it. Dispatched by /turnstile:remember or conversate routing only; available in both capture modes.

febradc-github/turnstile · 59 tokens

ucai-patterns

Use when the user asks about Claude Code best practices, how to write agents, how to use hooks, how to manage context, or how to work effectively with Claude Code's native systems.

Joncik91/ucai · 42 tokens

memory-curator

Use at session-close when a session captured several new memories, or on-demand, to consolidate, deduplicate, prune, and structure the beads memory store. Triggers on "curate memories", "clean up memories", "memory sweep".

DollarDill/beads-superpowers · 52 tokens

orient

Use when user invokes /orient with a topic keyword, entity type, project name, time qualifier, or combination. Also triggers on "what do we know about X", "remind me about X", "where did we leave off on X". Provides targeted context loading — searches the MCP Memory Server graph, knowledge files, journal entries, and…

harnessprotocol/harness-kit · 80 tokens