Distill

Process distill events from the current conversation into durable vault notes, or extract portable concepts from a specified file…

jctots updated 1mo ago
Claude CodeGeneric
View source ↗
Process distill events from the current conversation into durable vault notes, or extract portable concepts from a specified file. Two modes depending on invocation:

---

## Mode 1 — Conversation markers (no argument)

Invoked as `/distill`

1. **Scan for distill events** — look back through this conversation for 🗂️ `[distill event]` markers. If none found, tell the user and stop.

2. **Process each event, one at a time:**
   a. **Check for existing notes** — run `python _scripts/rag-search.py "<proposed note title and topic summary>" --top 5`. Filter results to paths under `resources/`. If any score ≥ 0.55, read those notes and decide: propose updating the existing note (or adding a cross-link) instead of creating a new one.
   b. Draft the note content — structured, concise, suitable for `resources/`. Default path: `personal/resources/`; use `public/resources/` only if the user explicitly requests it.
   c. Show: proposed path (existing or new), draft content, and a one-line reason for placing it there.
   d. Engage interactively — the user may add context, redirect scope, change the path, or ask for revisions. Iterate until the user explicitly confirms or skips the item.
   e. On confirm: write the note (Edit if exists, Write if new).
   f. On skip: move to the next item.

3. **Emit processed marker** — output `📦 [distill processed]` on its own line.

4. Briefly confirm what was written and what was skipped. The dashboard is auto-generated by CI — no manual update needed.

---

## Mode 2 — File extraction (with file path argument)

Invoked as `/distill path/to/file.md`

Use when you want to mine an existing document for portable concepts worth keeping as standalone atomic notes in `resources/`.

1. **Read the specified file** in full.

2. **Skip already-distilled sections** — scan for lines matching `*→ Distilled: [[...]]` directly under a heading. Do not re-propose those sections.

3. **Make a judgment pass** — identify remaining sections that contain portable concepts: general patterns, mental models, design frameworks, technology assessments, architectural principles. Skip system-specific implementation details (config values, script names, instance-specific decisions) — those belong in the source file.

4. **For each candidate, one at a time:**
   a. **Check for existing notes** — run `python _scripts/rag-search.py "<proposed note title and topic summary>" --top 5`. Filter results to paths under `resources/`. If any score ≥ 0.55, read those notes and decide: propose updating the existing note (or adding a cross-link) instead of creating a new one.
   b. Propose a path in `personal/resources/` by default; use `public/resources/` only if the user explicitly requests it. Existing path if updating.
   c. Draft a self-contained atomic note — structured, readable without the source file.
   d. Show: proposed path, draft content, one-line reason. If updating an existing note, show a diff-style summary of what would change.
   e. Engage interactively — user may revise, redirect, or skip. Iterate until confirmed or skipped.
   f. On confirm: write the note (Edit if exists, Write if new), appending a visible source line at the end:
      ```
      ---
      *Source: [[wikilink-to-source-file]]*
      ```
      Edit the source file: insert `*→ Distilled: [[path/to/note]]*` on the line immediately after the section heading.
   g. On skip: move to the next candidate.

5. **Emit processed marker** — output `📦 [distill processed]` on its own line.

6. Briefly confirm what was written and what was skipped. The dashboard is auto-generated by CI — no manual update needed. The source file body is never modified beyond inserting the traceability line.

Maintain Distill?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Distill on getagentictools](https://getagentictools.com/loops/jctots-distill?ref=badge)