Agent skill

Distill

by davepoon in davepoon/buildwithclaude

Synthesize wiki pages from related memories. An agent skill from davepoon/buildwithclaude.

MITAuto-check: notes

Install Distill

skills CLI
$ npx skills add davepoon/buildwithclaude --skill distill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davepoon/buildwithclaude distill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davepoon/buildwithclaude.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/origin/skills/distill .claude/skills/distill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
distill
GitHub stars
3.6k
Token cost
~3.2k tokens
SKILL.md length
1,339 words
Files
1
Skills in repo
245
Repo updated
First seen
Licence
MIT

At a glance

Synthesize wiki pages from related memories. An agent skill from davepoon/buildwithclaude.

  • Works in 4 steps: Pick the scope → Call the MCP tool → Synthesize each pending cluster → …
  • SKILL.md covers Mental model, Single flow, Flow and Auto-commit ~/.origin/, plus 3 more sections
  • Calls git

What it does

Distill is an agent skill from davepoon/buildwithclaude. Synthesize wiki pages from related memories. One endpoint, one flow: daemon clusters and synthesizes what it can; agent finishes whatever the daemon couldn't (no LLM or cluster too big). Invoked as /distill [target].

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A single hub to find Claude Skills, Agents, Commands, Hooks, Plugins, and Marketplace collections to extend Claude Code, Claude Desktop, Agent SDK and OpenClaw. The licence is MIT.

Example prompts

  • “/distill”

Requirements

  • Pre-approved tools (allowed-tools): mcp__plugin_origin_origin__recall, mcp__plugin_origin_origin__distill, mcp__plugin_origin_origin__create_page, mcp__plugin_origin_origin__update_page, mcp__plugin_origin_origin__delete_page, mcp__plugin_origin_origin__get_page_sources, Bash

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Pick the scope
  2. Call the MCP tool
  3. Synthesize each pending cluster
  4. Report terse

What it can do on your machine

Read from SKILL.md and the folder at commit 10bfc43. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • mcp__plugin_origin_origin__recall
    • mcp__plugin_origin_origin__distill
    • mcp__plugin_origin_origin__create_page
    • mcp__plugin_origin_origin__update_page
    • mcp__plugin_origin_origin__delete_page
    • mcp__plugin_origin_origin__get_page_sources
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Distill loads about 3.2k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 1,339 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: mcp__plugin_origin_origin__recall, mcp__plugin_origin_origin__distill, mcp__plugin_origin_origin__cr

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davepoon/buildwithclaude at commit 10bfc43, republished under its MIT licence (© davepoon). 1,339 words, ~3,173 tokens.

Download SKILL.mdSave it as .claude/skills/distill/SKILL.md (or your agent's skills folder).
name
distill
description
Synthesize wiki pages from related memories. One endpoint, one flow: daemon clusters and synthesizes what it can; agent finishes whatever the daemon couldn't (no LLM or cluster too big). Invoked as `/distill [target]`.
allowed-tools
mcp__plugin_origin_origin__recall, mcp__plugin_origin_origin__distill, mcp__plugin_origin_origin__create_page, mcp__plugin_origin_origin__update_page, mcp__plugin_origin_origin__delete_page, mcp__plugin_origin_origin__get_page_sources, Bash
argument-hint
[target | rebuild <page-id> | deep]

/distill

Force a distillation pass now. The daemon's background distill cycles run on its own clock; /distill is the explicit user-triggered pass.

Mental model

Distillation is four operations bundled into one flow:

  • emerge — cluster new memories into new pages
  • absorb — assign orphan memories to existing pages, propose new pages from topics that 2+ existing pages link to but no page is named for
  • refresh — regenerate stale pages from their source memories (only when the user has not edited the page; pages you have touched stay locked)
  • merge — combine duplicate pages flagged by the daemon's global review

The default flow runs all four. The rebuild verb is a destructive opt-in that overrides the lock on a single page.

Single flow

One POST to the daemon. Response splits into:

  • pages_created / created_ids: pages the daemon synthesized itself (only when daemon has an LLM).
  • pending: clusters the daemon couldn't finish. The agent synthesizes each in this session and POSTs them back to /api/pages.

Trigger timing is the only thing that differs between background distill cycles and this skill. Code path is the same; daemon hands back clusters when it can't synthesize; whoever called fills in the rest.

Flow

1. Pick the scope

For bare /distill, infer a target from cwd:

Bash: top=$(git -C "$PWD" rev-parse --show-toplevel 2>/dev/null); \
      common=$(git -C "$PWD" rev-parse --git-common-dir 2>/dev/null); \
      if [ -n "$common" ]; then \
        case "$common" in /*) root=$(dirname "$common");; *) root=$(cd "$top" && cd "$(dirname "$common")" && pwd);; esac; \
        basename "$root"; \
      fi
  • Output → use it (e.g. origin).
  • Not a git repo → fall back to basename "$PWD".
  • Reserved keyword deep → no scope (global pass).
  • Reserved keyword sequence rebuild <page-id> → call distill(target=<page-id>, force=true). Confirms "Rebuild page <id>? Your edits will be wiped, page regenerates from sources." before proceeding. Skip the rest of this skill — single-page rebuild does not produce pending clusters; the daemon's response shape is {"status": "ok", "force": true, "page_id": ..., "updated": true}. Report verbatim.

For /distill <arg> → forward <arg> to target.

2. Call the MCP tool
distill(target="<scope>")

The tool returns the daemon's full JSON payload as text. Parse it as JSON. Possible shapes:

{
  "pages_created": 0,
  "scoped": true,
  "created_ids": [],
  "pending": [
    { "source_ids": [...], "contents": [...], "entity_id": ...,
      "entity_name": ..., "space": ..., "estimated_tokens": ... },
    ...
  ],
  "stale_pages": [
    { "page_id": ..., "title": ..., "summary": ...,
      "source_memory_ids": [...], "stale_reason": "source_updated",
      "user_edited": false, "sources_updated_count": 3 },
    ...
  ],
  "stale_truncated": false,
  "orphan_topics": [
    { "label": "Topic Z", "count": 3 },
    ...
  ]
}

The route never invokes the daemon LLM. created_ids is always empty when called from this skill; pending carries every cluster the daemon found. The agent synthesizes them in this session — that's why the LLM choice is consistent with how the user invoked the skill.

unresolved + hint: relay to user verbatim and stop.

3. Synthesize each pending cluster

The daemon route filters out clusters fully covered by an existing page (subset or Jaccard ≥ 0.8). What remains is either:

  • A brand-new cluster (no existing page) → create a new page.
  • A refresh candidate (existing_page_id is set) → the cluster has new memories beyond what's in the matched page. The agent has LLM access, so the right move is to refresh the existing page in the same pass.

Cluster shape:

pending: [
  {
    source_ids, contents, entity_id, entity_name, space,
    estimated_tokens,
    existing_page_id?, existing_page_title?, new_memory_count?
  },
  ...
]

For each cluster, first run a coherence check before synthesizing:

  • Skim every memory in cluster.contents.
  • If the cluster has ≥ ~4 memories and the topics scatter (entity shared but the memories cover unrelated sub-topics — e.g. all tagged Origin but spanning RwLock bugs, schema choices, onboarding UI, migrations, and CSS), the cluster is incoherent. Skip synthesizing it. Record it for the report under "Skipped (low coherence)" with the existing page title (if refresh) or a short topic hint (if new).
  • Coherent cluster (memories share an actual topic, not just an entity tag) → proceed to synthesis.

The coherence judgement is something only the agent can do — it needs to read the prose. Daemon clustering is heuristic; agent is the final filter against producing a grab-bag page.

For each coherent cluster:

  • Title: short noun phrase. Use existing_page_title when refreshing unless the new memories materially change the topic. For new clusters: cluster.entity_name if specific, otherwise derive from the first memory's content.
  • Summary: one sentence — the durable claim.
  • Body: 3-7 paragraphs of wiki prose. Use [[wikilinks]]. Cite source ids inline with (source: mem_XXX).

New cluster (no existing_page_id) — call the MCP tool:

create_page(title="...", summary="...", content="...",
            entity_id="<cluster.entity_id or omit>",
            space="<cluster.space>",
            source_memory_ids=[...])

Refresh candidate (existing_page_id is set) — replace the body in place via the update_page MCP tool. This is a single atomic call: replaces content + source list + optional summary, clears the daemon's stale_reason, bumps version, preserves page_id + created_at so external [[wikilinks]] keep working.

update_page(page_id=cluster.existing_page_id,
            content="...",
            source_memory_ids=cluster.source_ids,
            summary="...")
3.5 Refresh stale pages

The stale_pages block in the response lists pages whose sources changed since last compile. Shape:

stale_pages: [
  { page_id, title, summary, source_memory_ids,
    sources_updated_count, stale_reason, user_edited },
  ...
]
stale_truncated: <bool>   # true when 10+ stale pages exist

For each stale page:

  • user_edited == true → never auto-rewrite. The user touched the page; the upstream memories also changed. Surface in the "Conflict" report block and stop. The user resolves by hand, OR runs /distill rebuild <page-id> to wipe their edits and regenerate from sources.
  • user_edited == false → fetch source memories via get_page_sources(page_id="<id>"), run the same coherence check used for clusters, then call update_page with the existing source_memory_ids and freshly synthesized prose.
update_page(page_id=stale.page_id,
            content="<refreshed prose>",
            source_memory_ids=stale.source_memory_ids,
            summary="<optional refreshed claim>")

When stale_truncated == true, tell the user "more stale pages remain — re-run /distill after this pass to continue."

3.6 Surface orphan-topic suggestions

orphan_topics lists wikilink labels that 2+ existing pages reach for but no page is named for. Each entry is a topic-discovery signal — other pages are asking for this page.

Do not auto-create pages from this list — the agent doesn't have the source memories at hand, and an empty-stub page is worse than no page. Surface them in the report so the user can choose to run /distill <label> intentionally:

Topic suggestions (other pages link here, no page yet):
  - "Topic Z"  (3 pages reference it)
  - "Other"    (2 pages reference it)

Skip the section when orphan_topics is empty.

Show full SKILL.md (497 more words)Show less
4. Report terse

Three output shapes. Pick the one that matches what happened.

If pending is empty (every cluster already fully covered):

Scope `<scope>` is up to date — no new memories to distill.

If at least one cluster was synthesized:

Distilled N page(s) from <total> memories in scope `<scope>`:
  - <Title>  v1, synthesized from <K> sources
  - <Title>  v3 → v4: +mem_xyz, +250 chars
  ...

For each page, create_page and update_page return a WriteResult whose warnings array carries a pre-formatted delta line from the daemon (e.g. "v3 → v4: +mem_xyz, +250 chars"). Render it verbatim after the title. When warnings is empty or the call returned no WriteResult, fall back to:

  • New page: v1, synthesized from <K> sources (K = source_ids length)
  • Refreshed page: refreshed (bare, as before)

This lets the user see exactly what changed per page without opening each file.

If at least one cluster was skipped on the coherence check:

Skipped M cluster(s) — low coherence (memories share entity but
topics scatter; would produce a grab-bag page):
  - "<existing_page_title or topic hint>"  (<N> memories)
  ...

If at least one stale page was refreshed:

Refreshed K stale page(s):
  - <Title>  v2 → v3: +mem_abc, +180 chars
  - <Title>  refreshed
  ...

Same delta-line rule as new/refresh clusters: render warnings[0] from the update_page WriteResult verbatim; fall back to refreshed when absent.

If at least one stale page was skipped because user_edited:

Conflict on L stale page(s) — page has user edits, sources also
changed. Open and reconcile manually:
  - <Title>  (~/.origin/pages/<slug>.md)

Distinct wording from the coherence-skip block so the user can tell the two reasons apart at a glance.

Emit the blocks back-to-back when more than one outcome happened in the same pass.

When the only outcome is skipped clusters (and pending was non-empty), still emit the Skipped block. Do not report "up to date" in that case — the scope isn't up to date, the candidates were just too low quality.

Rules:

  • Titles, not page ids. Ids visually truncate; titles read clean.
  • One line per synthesized page. No body in chat — /read "<title>" for that.
  • <total> = sum of source_ids.len() across the clusters that were actually synthesized.
  • If the pass produced fewer pages than expected, it's the clustering thresholds. Most memories sit alone without enough peers to form a cluster of 3+. Capture more on the same topic to grow them.

Auto-commit ~/.origin/

After writing the pages above, snapshot the change so the user can git log their memory's life timeline. Defensive — silent skip if git is missing or ~/.origin/ is not a repo yet.

Bash: git -C ~/.origin add -A && \
      git -C ~/.origin -c user.name=Origin -c user.email=daemon@origin.local \
          commit --quiet -m "distill: <N> pages" 2>/dev/null || \
      (sleep 1 && git -C ~/.origin add -A && \
       git -C ~/.origin -c user.name=Origin -c user.email=daemon@origin.local \
           commit --quiet -m "distill: <N> pages" 2>/dev/null) || true

The retry handles index.lock races — the daemon may be writing to ~/.origin/ at the same moment (auto-commit from captures). One-second wait is enough for the daemon to release the lock.

When to use

  • User says "distill", "synthesize", "rebuild the page on X".
  • After a bulk import — daemon distill cycles handle this in the background; user can force a pass for immediate visibility.
  • /distill rebuild <page-id> when you want to wipe a page you previously edited and have the daemon regenerate from current sources. Destructive: your prose goes away. Use after you are done curating a page and want it back on the auto-refresh path.

When NOT to use

  • Trivial / one-off interactions. The background scheduler covers periodic refresh.
  • Single memory write → daemon's post-ingest enrichment already covers it.

Cost

Each cluster the agent synthesizes counts against this session's tokens. Daemon-side clusters (when an LLM is present) cost daemon LLM tokens instead (cents on API, seconds on-device). Either way, keep cluster sizes reasonable — the daemon already enforces a per-cluster token budget via its tuning config.

© davepoon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/origin/skills/distill of davepoon/buildwithclaude.

Open the folder on GitHubat commit 10bfc43

Compare with similar skills

Distill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Distill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Distill this skilldavepoon/buildwithclaude3.6k—~3.2kAutomated safety check: NotesMIT
Wiki Maintaineropenclaw/openclaw392k1 repos~462Automated safety check: PassMIT
Wiki SynthesizeAr9av/obsidian-wiki3.5k—~2.3kAutomated safety check: NotesMIT
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
LLM WikiYeachan-Heo/oh-my-claudecode40k—~721Automated safety check: PassMIT
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: PassApache-2.0

Similar skills

  • Wiki Maintainer

    openclaw/openclaw

    Maintain the OpenClaw memory wiki vault with deterministic pages, managed blocks, and source-backed updates.

    392k GitHub starsUsed in 1 repo~462 tokens
    Knowledge ManagementAuto-check passed
  • Wiki Synthesize

    Ar9av/obsidian-wiki

    Find recurring concept combinations across the wiki that lack an explicit synthesis page, then create cross-cutting synthesis pages.

    3.5k GitHub stars~2.3k tokensUpdated yesterday
    Knowledge ManagementAuto-check: notes
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check: notes
  • LLM Wiki

    Yeachan-Heo/oh-my-claudecode

    Keeps a persistent markdown wiki of project and session knowledge that the agent can ingest into, query, lint and read across sessions.

    40k GitHub stars~721 tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Adds structured long-term memory to OpenClaw agents, built automatically from sessions, with tools the agent calls to recall facts, summaries and decisions.

    17k GitHub stars~2k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed
  • Memory

    yc-software/qm

    Deliberately search, add to, or curate your long-term memory with the memory tool — beyond the automatic recall/capture every turn already does.

    15k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from davepoon/buildwithclaude

All 245 skills in this repo
  • Qwen Vision

    davepoon/buildwithclaude

    A skill your agent uses when the user asks to "analyze video", "watch this video", "what happens in this video", "describe this clip", "review this footage", "classify these videos", "compare…

    3.6k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Hard Predict Future

    davepoon/buildwithclaude

    Activate this agent for any future-oriented question that requires deep quantitative analysis, historical precedents, and structured scenario planning.

    3.6k GitHub starsUsed in 1 repo~4.2k tokens
    Auto-check passed
  • iOS Hig Design Guide

    davepoon/buildwithclaude

    Build, update, and apply iOS design specifications using Apple Human Interface Guidelines (HIG) source data.

    3.6k GitHub stars~735 tokensUpdated 2 days ago
    Auto-check passed
  • Video Downloader

    davepoon/buildwithclaude

    Download YouTube videos with customizable quality and format options.

    3.6k GitHub starsUsed in 1 repo~871 tokens
    Auto-check passed
  • Atlas Cloud Media

    davepoon/buildwithclaude

    Discover Atlas Cloud image and video models, inspect their live schemas, and submit one confirmed media generation request with bounded GET polling.

    3.6k GitHub stars~852 tokensUpdated 2 days ago
    Auto-check passed
  • Slack Gif Creator

    davepoon/buildwithclaude

    Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives.

    3.6k GitHub starsUsed in 12 repos~4.3k tokens
    Auto-check passed

Questions about Distill

What does Distill do?

Synthesize wiki pages from related memories. An agent skill from davepoon/buildwithclaude. Distill is an agent skill from davepoon/buildwithclaude. Synthesize wiki pages from related memories.

How do I install Distill in Claude Code?

Run `npx skills add davepoon/buildwithclaude --skill distill -a claude-code`. Or copy the skill folder (plugins/origin/skills/distill in davepoon/buildwithclaude) into .claude/skills/distill in your project. Claude Code loads it when a task matches its description.

How do I install Distill in Codex?

Run `npx skills add davepoon/buildwithclaude --skill distill -a codex`. Or copy the skill folder (plugins/origin/skills/distill in davepoon/buildwithclaude) into .agents/skills/distill in your project. Codex loads it when a task matches its description.

Can I use Distill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davepoon/buildwithclaude --skill distill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/distill, .gemini/skills/distill, .github/skills/distill and .opencode/skills/distill in your project.

What does Distill need to run?

Going by SKILL.md and its folder, Distill needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: mcp__plugin_origin_origin__recall, mcp__plugin_origin_origin__distill, mcp__plugin_origin_origin__create_page, mcp__plugin_origin_origin__update_page, mcp__plugin_origin_origin__delete_page, mcp__plugin_origin_origin__get_page_sources, Bash.

Does Distill access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Distill safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Distill use?

Distill is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Distill use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Distill?

Skills that share tags, products or a category with Distill: Wiki Maintainer (openclaw/openclaw, 392k stars), Wiki Synthesize (Ar9av/obsidian-wiki, 3.5k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars) and LLM Wiki (Yeachan-Heo/oh-my-claudecode, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Distill?

davepoon (a GitHub user) maintains it in davepoon/buildwithclaude, which has 3,604 GitHub stars. The repository holds 245 skills in this directory. The repository was last updated on October 6, 2026.

Source: davepoon/buildwithclaude on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.