learn-distill

learn-distill is a skill for Claude Code from lukasrepublic/agentic-foundry. It costs 77 tokens per session (709 once invoked), scanned A, original, MIT.

A scheduled learning tool that groups past coding-session records into possible memory, handbook, or skill improvements. It uses repeated words and phrases to form deterministic clusters and writes a dated report.

In plain words
What is it for?
Use it on a schedule or on demand to cluster session learnings, promote repeated patterns into candidates, create a report, and remove old buffered records.
Why use it?
It turns scattered session notes into reviewable improvement candidates instead of leaving them unused. Reproducible grouping makes the same records produce the same report.

Skill for Claude Code

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

Part of the foundry plugin — 81 skills, 8 agents, 8 hooks, 1 MCP server shipped together

Good fit Use it on a schedule or on demand to cluster session learnings, promote repeated patterns into candidates, create a report, and remove old buffered records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lukasrepublic/agentic-foundry/learn-distill
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.

Any agent
npx skills add lukasrepublic/agentic-foundry --skill learn-distill
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 81 skills, 8 agents, 8 hooks, 1 MCP server.

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 learn-distill

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/learn-distill.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/learn-distill)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/learn-distill"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/learn-distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 709 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00077 $0.00709
Opus 5 $0.00039 $0.00354
Sonnet 5 $0.00015 $0.00142
Haiku 4.5 $0.00008 $0.00071

Measured 4d ago against content hash 36159ecda5b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

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

skills/learn-distill/SKILL.md · 43 lines

How it starts

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

/foundry:learn-distill

The self-improvement consumer — a native-scheduling WRAP for the cadence. Two halves:

  • CUSTOM (no native equivalent): the deterministic clustering + report logic, implemented in scripts/foundry-distill.py — read the dated partitions under .foundry/session-learnings/<YYYY-MM-DD>/*.jsonl (the reconciliation .harvest-log.jsonl + dotfiles excluded), token-overlap cluster (≥3 shared normalized tokens drawn from every string scalar field + tags; no embeddings; fully-pinned canonicalization + ordering → byte-reproducible), threshold-promote (≥3-record components) to HBK/memory/skill/unclassified candidates over the real type/kind vocabulary, write .foundry/learnings/DISTILL_REPORT-<UTC-date>.md (an untracked runtime artifact — NOT the governed specs/ tree), then prune buffer partitions whose directory-NAME date is >90 days old (never by mtime). Run it directly: scripts/foundry-distill.py [--date YYYY-MM-DD] [--dry-run]; self-test scripts/foundry-distill.py --selftest. (The doctor drop-in check this line originally named was retired with the drop-in registry in the v0.25.0 realignment — an open loop is now visible only by running the distiller itself.)
  • WRAP over native: the CADENCE. Instead of a bespoke scheduler, the distill tick is scheduled via native ScheduleWakeup (session-local) or CronCreate (persistent) — e.g. a daily tick that runs the consumer. Producers feed the buffer via /foundry:learn-capture (the in-session path) + the worker-sidecar harvest.

Procedure

  1. Scheduled tick (native CronCreate daily, or ScheduleWakeup): invoke the consumer — scripts/foundry-distill.py.
  2. Consume the buffer (Read → Cluster → Threshold → Write → Retention, in that strict order — retention prunes only partitions whose NAME-date is >90 days old, never a within-window partition).
  3. Emit .foundry/learnings/DISTILL_REPORT-YYYY-MM-DD.md with HBK/memory/skill/unclassified candidates (operator-reviewed; no auto-dispatch).

Read the full file on GitHub · 43 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. 4d ago First seen · 43 lines · 77 tokens per session scan A 36159ecda5b6

Subscribe to this mod's changes

learn-distill is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed 2d ago), licensed MIT. It adds 77 tokens to every session and 709 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-09-03.

Related

Other skills, from other repositories

capture-milestone-principle-updates

Distill reusable answering principles from a just-finished milestone's recorded decisions into the project-wide principle store.

uHappyLogic/cairn · 31 tokens

dual-brain

Two complementary reusable sub-agents collaborate to remember, grill, verify, document, and maintain weighted project memory. A Right Brain (context / pattern / grill) interrogates assumptions against Hot/Warm memory; a Left Brain (logic / verification / code) cross-checks memory, code, and docs; the orchestrator…

sleeplesshan/dual-brain · 194 tokens

yolo-intake

Use when a feature should draw on the project's reference material for context. yolo-intake does NOT fetch, import, or copy anything — it points YOLO at a selected folder (default docs/) and READS from it to enrich a feature's context. Getting material INTO that folder (a Figma, a spec, a URL, a schema) is the docs…

CoriChui/yolo · 118 tokens

g-resume

Re-hydrate a fresh session with the right slice of the durable record. The read-side counterpart to /g-retro — selectively retrieves the relevant retro, ADRs, journal, and handoff keyed by the current branch/milestone/first-task, and assembles a focused re-entry briefing. Loads distilled context into a clean window…

onlygian/G-Forge · 128 tokens

grimoire

Use when the user says 'update context', 'update claude', 'save library', or after significant project changes.

cwinvestments/memstack · 28 tokens

continuous-learning-v2

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

sangrokjung/claude-forge · 33 tokens