distill

distill is a skill for Claude Code, Codex from jasonkneen/lazar. It costs 0 tokens per session (1,467 once invoked), scanned A, original, MIT.

A skill for turning rotated lazar log archives into durable memory files. Lazar is a system that records agent activity; this skill uses its recursion process to identify useful lessons instead of preserving only a mechanical event summary.

In plain words
What is it for?
Use it after log rotation or when explicitly saving lessons from completed work, using a focused portion of an archive rather than the whole file.
Why use it?
It helps retain important discoveries from past sessions without asking an agent to process an entire log archive every time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it after log rotation or when explicitly saving lessons from completed work, using a focused portion of an archive rather than the whole file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jasonkneen/lazar/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 jasonkneen/lazar --skill distill
Clone the repo
git clone --depth 1 https://github.com/jasonkneen/lazar

Made for: Claude Code, Codex.

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/jasonkneen/lazar/distill/github.svg)](https://agentmods.dev/skills/jasonkneen/lazar/distill)
Your own site
<a href="https://agentmods.dev/skills/jasonkneen/lazar/distill"><img src="https://agentmods.dev/badge/skills/jasonkneen/lazar/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/jasonkneen/lazar/distill"><img src="https://agentmods.dev/badge/skills/jasonkneen/lazar/distill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,467 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 79
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00000 $0.01467
Opus 5 $0.00000 $0.00733
Sonnet 5 $0.00000 $0.00293
Haiku 4.5 $0.00000 $0.00147

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

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.

src/seed-skills/_meta/distill/SKILL.md · 127 lines

How it starts

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

distill

Use lazar recursion to extract durable, structured learnings from rotated log archives, and write them into categorized memory files. Turns raw events (L3) into curated knowledge (a richer L2) on demand.

This is the opt-in LLM curation layer for lazar's memory. The mechanical L2 summaries written by _meta/log-rotation give you "what topics came up and what commands ran." distill goes further and asks the agent itself: "what did we learn that's worth remembering?"

When to use

  • After a busy session has rotated, when you want curated learnings (not just a transcript) preserved.
  • The user explicitly asks the agent to "remember what we figured out" or "save the lessons from this work."
  • Periodically — say once per .bak archive — to build up a knowledge base over time.

Do NOT use this on every invocation. It costs an LLM call per archive, and learnings stabilize quickly. Once per rotation is plenty.

Hard rules

  • Bound the sample. Never pass a whole archive into the recursion prompt. Pick a focused slice — last N invocations, or events around a specific topic — and cap by bytes.
  • Use lazar -p recursion, not a separate API call. This keeps the kernel as the only API consumer and makes the LLM call appear in stream.jsonl itself.
  • Write to memory/distilled/<category>.md, never to top-level memory. Distilled insights are LLM-generated; mark them clearly.
  • Tag every entry with the source archive's timestamp and the date you distilled. Future-you needs to know how stale the learning is.

Recipe

# Pick the archive to distill (default: most recent rotation)
ARCHIVE=$(ls -t $LAZAR_HOME/logs/stream.jsonl.*.bak 2>/dev/null | head -n 1)
[ -z "$ARCHIVE" ] && { echo "no archives to distill"; exit 0; }

# Bounded sample: last 30 user prompts + assistant responses, capped at 30KB
SAMPLE=$(jq -s '
  map(select(.kind == "user" or .kind == "assistant"))
  | .[-30:]
  | map({kind: .kind, content: (.content | tostring | .[0:2000])})
' "$ARCHIVE" 2>/dev/null | head -c 30000)

[ -z "$SAMPLE" ] && { echo "no usable events in $ARCHIVE"; exit 0; }

# Recurse — ask lazar to extract structured learnings
LAZAR_DEPTH=1 lazar -p "Read this conversation transcript (JSONL events) and extract durable learnings worth saving. Be selective — only include things future-you will genuinely benefit from remembering.

Output ONLY this exact format, with each section terse and one-line bullets:

## gotchas
- <thing that bit us, prefixed with the situation>

## conventions
- <a code/style/path convention adopted in this work>

## recipes
- <a multi-step bash/tool pattern that worked>

## preferences
- <a stated user preference>

Skip any section that has nothing real. Don't pad. If nothing is worth saving, output 'nothing durable' on a single line.

Transcript:
$SAMPLE" > /tmp/distill-out.md 2>/dev/null

# If the agent said nothing durable, bail
rg -qi "nothing durable" /tmp/distill-out.md && { echo "no durable learnings found"; exit 0; }

# Write to memory, tagged with source + date
mkdir -p $LAZAR_HOME/memory/distilled
TS=$(basename "$ARCHIVE" | rg -o '[0-9]+')
DATE=$(date -u +%Y-%m-%d)

# Split the output by section, append each to its category file
awk -v ts="$TS" -v date="$DATE" -v home="$LAZAR_HOME" '
  /^## / { cat = tolower(substr($0, 4)); next }
  /^- / && cat != "" {
    path = home "/memory/distilled/" cat ".md"
    print "- " substr($0, 3) " _(distilled " date ", from archive ." ts ".bak)_" >> path
    close(path)
  }
' /tmp/distill-out.md

echo "distilled into $LAZAR_HOME/memory/distilled/ (sections: $(ls $LAZAR_HOME/memory/distilled/ 2>/dev/null | tr '\n' ' '))"
rm -f /tmp/distill-out.md

Read the full file on GitHub · 127 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. 10d ago First seen · 127 lines · 0 tokens per session scan A 06da2c19e102

Subscribe to this mod's changes

distill is a skill published in the GitHub repository jasonkneen/lazar (31 stars, last pushed 28d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,467 tokens. 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

media-ingest

Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.

garrytan/gbrain · 52 tokens

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

shellm

Reference for the shellm system — recursive LLM shell, identity management, memory, skills, trajectory, and all CLI tools. Use when working on shellm itself, debugging agent behavior, or understanding how the pieces fit together.

laude-institute/headlong · 49 tokens