distill

distill is a skill for Claude Code from Borda/AI-Rig. It costs 71 tokens per session (5,707 once invoked), scanned A, original, Apache-2.0.

A one-time review of work history, saved lessons, and existing agents or skills to identify repeated patterns and possible improvements.

In plain words
What is it for?
Use it to review project memory, prune stale entries, consolidate lessons, suggest new automation, or extract efficiency improvements found by an audit.
Why use it?
It helps turn recurring work and lessons into clearer rules, updated instructions, new agents or skills, and a smaller memory file.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the foundry plugin — 10 skills, 10 agents shipped together

Good fit Use it to review project memory, prune stale entries, consolidate lessons, suggest new automation, or extract efficiency improvements found by an audit.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Borda/AI-Rig
Claude Code
/plugin install foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 10 skills, 10 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/borda/ai-rig/distill/github.svg)](https://agentmods.dev/skills/borda/ai-rig/distill)
Your own site
<a href="https://agentmods.dev/skills/borda/ai-rig/distill"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/distill/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.

agentmods 80×15 button for distill

Your own site · 80×15
<a href="https://agentmods.dev/skills/borda/ai-rig/distill"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/distill.svg" alt="Reviewed on agentmods" width="80" 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 5,707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.05707
Opus 5.5 $0.00028 $0.02283
Sonnet 5.5 $0.00014 $0.01141
Haiku 4.5 $0.00007 $0.00571

Measured 10d ago against content hash 952fced0b70a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

distill scanned grade A 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 10d 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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find "$HOME/.claude/plugins/cache" -mindepth 2 -maxdepth 2 -type d 2>/dev/null | while IFS= read -r p; do

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

plugins/cc_foundry/skills/distill/SKILL.md · 309 lines

How it starts

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

Analyze how Claude Code is used, surface concrete improvements — new agents/skills to reduce repetition, or consolidate lessons into governance files (rules, agent instructions, skill updates) — without duplicating what exists.

NOT for single-file edits or quality checks — use /foundry:audit for config quality checks. NOT for audit-only scan for extraction candidates (use /foundry:audit --efficiency instead of distill executables for detection-only).

  • $ARGUMENTS: optional. Modes:
    • Omitted: analyze existing patterns and agents; generate suggestions proactively.
    • prune [--eager] — evaluate project memory file for stale, redundant, or verbose entries. Default: advisory diff + apply prompt. --eager: score every entry (Usage likelihood × Impact → Tier P0/P1/P2), print full scored table with # column, let user select by tier or item numbers, delegate edits to foundry:curator.
    • memory [--eager] — read .notes/lessons.md, memory feedback files and recurring transcript tool failures (bin/mine_transcript_failures.py), distill recurring patterns into proposed rule files, agent instruction updates, skill workflow changes. --eager: include Pattern count, Strength, Tier columns in proposal table; let user select clusters to promote by tier or item numbers; delegate writes to foundry:curator.
    • external <source> [--eager] — analyse external plugin, skill, or agentic resource, produce structured adoption proposal. <source> is URL, file path, or local directory. --eager: lower adoption bar — recommend partial adoption even for single useful components.
    • executables [--eager] [<run-dir-or-report-path>] — perform bin/ extraction from /foundry:audit --efficiency Check 33 candidates. Auto-detects latest run dir under .reports/audit/; pass optional path to target specific run dir or report file. Runs inline Check 33 scan when no report exists. Default gates on HIGH/MEDIUM verdict. --eager: also surface LOW verdict clusters as extraction candidates. Spawns foundry:sw-engineer per cluster. Skip to Mode: Executables Extraction below.
    • [--eager] <recurring task description> — use description as context when generating suggestions. --eager: lower frequency threshold from 3+ to 2+ occurrences; single high-effort occurrence also qualifies.
    • --project — in prune and memory modes, show interactive project picker: enumerate all slugs under ~/.claude/projects/*/memory/ with MEMORY.md size in tokens, let user select which project(s) to operate on. Omit to operate on the current project's memory only (the working directory's memory dir, resolved by resolve_memory_dir.py) — other projects are never touched without the picker. No effect on other modes.

Task hygiene — task tools may be deferred; load before first use: ToolSearch(query="select:TaskList,TaskCreate,TaskUpdate,TaskGet", max_results=4). Call TaskList first and triage each task it returns: completed if work clearly done, deleted if orphaned, keep in_progress only if genuinely continuing. Never spend a turn on bookkeeping alone — every TaskCreate/TaskUpdate ships in the same response as the next substantive tool call; one exception, TaskUpdate(completed) immediately before a long output block (rules/task-lifecycle.md).

PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name foundry) || exit $?; export PLUGIN_ROOT
export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
python "$PLUGIN_ROOT/bin/parse-skill-flags.py" --flags eager,project --keep-state distill-state --out-file "${TMPDIR:-/tmp}/distill-state-${CSID}/keep-items" -- "$ARGUMENTS" >/dev/null  # timeout: 5000 — no eval; distill-state-<flag>-${CSID} sentinels, keep-items into the state dir it makes, clears stale contract
IFS= read -r EAGER < "${TMPDIR:-/tmp}/distill-state-eager-${CSID}" 2>/dev/null || EAGER=false
IFS= read -r PROJECT_FLAG < "${TMPDIR:-/tmp}/distill-state-project-${CSID}" 2>/dev/null || PROJECT_FLAG=false
IFS= read -r CLEAN_ARGS < "${TMPDIR:-/tmp}/distill-state-clean-args-${CSID}" 2>/dev/null || CLEAN_ARGS=""
echo "EAGER=$EAGER"  # shell vars don't persist across Bash calls — read from stdout
echo "PROJECT_FLAG=$PROJECT_FLAG"
echo "ARGUMENTS_FINAL=$CLEAN_ARGS"

Read the full file on GitHub · 309 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago Changed · +37 lines 952fced0b70a
  2. 12d ago Changed 44c421a6919a
  3. 18d ago Changed · +9 lines · +3 tokens per session f5890de16ac1
  4. 28d ago Changed 8bc35fab3c64
  5. 1mo ago Changed · -5 lines a9c1e9231c6d
  6. 1mo ago Changed dd5003ce12ba
  7. 1mo ago Changed · +1 lines ba25890e2b96
  8. 2mo ago Changed · -4 lines 6ba02e7c4e60
  9. 2mo ago Changed · +2 lines 929cc2df8577
  10. 2mo ago First seen · 269 lines · 68 tokens per session scan A e7907e74f809

Subscribe to this mod's changes

distill is a skill published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 71 tokens to every session and 5,707 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

distill compared with skills from other repositories

distill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
distillBorda/AI-RigSkill31yesterdayApache-2.0A71Claude Code
memory-reviewhoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA93Claude Code, Codex
context-optimizerhuangwb8/skillsSkill512d agoMITA48Claude Code, Codex
context-engineeringitsmostafa/llm-engineering-skillsSkill266mo agoMITA42Claude Code
handoverisvlasov/rageatc-ossSkill104mo agoMITA45Claude Code
learnisvlasov/rageatc-ossSkill104mo agoMITA32Claude Code
review-memorystuartshields/claude-setupSkill26mo agoMITA35Claude Code