distill

distill is a command for coding agents from richfrem/agent-plugins-skills. It costs 25 tokens per session (337 once invoked), scanned A, original, MIT.

A command for turning repository files into short summaries stored in the RLM Summary Ledger, a cache of notes about project files. It can use an AI agent for small batches or worker agents for larger offline batches.

In plain words
What is it for?
Use it to summarize one to ten files with an agent, process larger file sets with workers, and store results in the project or tools summary cache.
Why use it?
It makes repository context easier to reuse without repeatedly reading every file. Choosing between the two paths helps handle either a few files quickly or many files in a batch.

Command

Part of the agent-memory plugin — 13 skills, 2 commands, 9 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 commands/richfrem/agent-plugins-skills/distill
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Or install agent-memory, the plugin that ships this one along with the rest of its 13 skills, 2 commands, 9 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/commands/richfrem/agent-plugins-skills/distill.svg)](https://agentmods.dev/commands/richfrem/agent-plugins-skills/distill)
Your own site
<a href="https://agentmods.dev/commands/richfrem/agent-plugins-skills/distill"><img src="https://agentmods.dev/badge/commands/richfrem/agent-plugins-skills/distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 337 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.00025 $0.00337
Opus 5 $0.00013 $0.00169
Sonnet 5 $0.00005 $0.00067
Haiku 4.5 $0.00003 $0.00034

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

plugins/agent-memory/commands/distill.md · 39 lines

What it actually says

/rlm-factory:distill

Summarize files into the RLM Summary Ledger. Two paths depending on context:

For detailed execution protocol, see agent: rlm-distill-agent

Path 1 -- Agent Distillation (default, fast, single file)

The agent reads each file and writes a high-quality summary via inject_summary.py. Use for 1-10 files. The agent is faster for small batches.

python ./scripts/inject_summary.py \
  --profile project \
  --file path/to/file.md \
  --summary "Your agent-generated summary here."

Path 2 -- Automated Swarm Batch (offline, bulk, 10+ files)

Delegates to swarm_run.py to fan-out processing across Copilot/Gemini.

Note: Limit --workers 2 when using gpt-5-mini on the free tier to avoid API throttling.

# All files in profile scope
python ./scripts/swarm_run.py --engine copilot --files-from rlm_distill_tasks_project.md

Profile Flag Cache Location
Docs / protocols --profile project rlm_summary_cache/*.md
Plugins / scripts --profile tools rlm_tool_cache/*.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. 4d ago First seen · 39 lines · 25 tokens per session scan A 0f50e07eeb27

Subscribe to this mod's changes

distill is a command published in the GitHub repository richfrem/agent-plugins-skills (6 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 337 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.