Auto-distill is pi-napkin’s core feature. It runs silently in the background, periodically forking your pi session and asking a model to extract structured knowledge into your vault — no prompting, no interruption to your work. Over time, your vault accumulates a curated record of decisions, patterns, and discoveries from every conversation, captured automatically as you work.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cad0p/pi-napkin/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Session start: timer armed
distill.enabled: true, the extension arms a timer set to intervalMinutes (default: 60 minutes). It also sweeps any stale distill worktrees left behind by crashed pi instances.Timer tick: worktree created and subprocess forked
$XDG_CACHE_HOME/napkin-distill/<vault-hash>/<branch-suffix>/ (typically ~/.cache/napkin-distill/…). The current session is forked into the worktree’s .napkin/distill/ directory.Detached subprocess spawned
pi -p subprocess is launched with the distill prompt as its task. It runs entirely in the background — the wrapper uses bash with detached: true and unref() so it survives parent exit. NAPKIN_DISTILL_NO_RECURSE=1 is exported into the subprocess environment to prevent recursive distill spawning.Agent distills, merges, squashes, and pushes
JS-side polling and overlap notices
Enable auto-distill
Config reference
| Key | Default | Description |
|---|---|---|
distill.enabled | false | Master switch. Nothing auto-distill related runs when false. |
distill.intervalMinutes | 60 | How often to fire a distill (in minutes). |
distill.maxDurationMinutes | 10 | Hard wall-clock cap for each distill subprocess. Values ≤ 0 or non-finite fall back to 10 minutes. |
distill.onShutdown | true | Run a final distill at session shutdown. |
distill.model.provider | "anthropic" | Model provider for the distill subprocess. |
distill.model.id | "claude-sonnet-4-6" | Model ID. Prefer a cheap, fast model — distill is automated, not interactive. |
Status bar
While auto-distill is configured, the status bar shows live feedback:| State | Status bar |
|---|---|
| Idle, counting down | distill: XmYYs (e.g. distill: 4m32s); seconds are zero-padded to two digits when minutes > 0, or just Xs when under a minute |
| Distill running | ● distill (with elapsed seconds updating every 2s) |
| Completed successfully | ✓ distill Xs |
| Completed with warning (local-only, no content) | ⚠ distill: local-only / ⚠ distill: no content |
| Error or timeout | ✗ distill: <reason> |
| Auto-distill paused for this session | distill: off (session) |
What the distill agent does
The agent follows the 9-step prompt inextensions/distill/distill-prompt.md, covering knowledge capture (steps 1–6) and git integration (steps 7–9). The wrapper post-validates the result and cleans up the worktree after the agent exits.
Learn vault structure
napkin overview and reads _about.md files to understand what each folder is for and what kinds of notes belong there.Read templates
napkin template list and napkin template read to learn the note formats used in this vault.Identify what's worth capturing
Search, create, or append notes
napkin search for the topic. If an existing note already covers it, appends to that note instead of creating a duplicate. Creates new notes with napkin create (following the vault’s templates and folder structure). Adds [[wikilinks]] to related notes.Update today's daily note
{namespace}/daily/YYYY-MM-DD.md), following existing patterns. Creates it if it doesn’t exist.Add supersedes frontmatter
supersedes: ["path/to/old.md"] frontmatter. A future janitor will archive the superseded note.Merge default branch into distill branch
git -C <worktree> merge --no-edit <default>. If conflicts arise, the agent resolves them in place using the conversation history as context, then commits.Squash to default branch
git -C <vault> merge --squash <branch>) — one clean commit per distill, keeping history linear and easy to revert.Push to origin
origin/<default> is configured, pushes. On non-fast-forward failures, recovers via git pull --no-rebase origin <default> then re-pushes. Never uses --force or --force-with-lease. After the agent exits, the wrapper post-validates (no conflict markers, HEAD on default branch) and writes an outcome sidecar to <vault>/.napkin/distill/errors/ before removing the worktree.Auto-init on first use
Whendistill.enabled: true is set on a vault that has no .git/ directory, pi-napkin automatically initializes git on the next session start:
- Runs
git init - Installs a managed
.gitignoreblock (excludes.napkin/distill/and Obsidian workspace files) - Commits everything as
napkin: initial vault commit (auto-distill setup) - Notifies you once with the file count, an undo command (
rm -rf <vault>/.git), and an opt-out hint (distill.enabled: false)
.gitignore block.
Pausing for a session
To pause auto-distill for the current session only (for example, if you’re drafting sensitive content you don’t want captured):NAPKIN_DISTILL_NO_RECURSE=1 is exported into every distill subprocess by the wrapper. This prevents a distill agent from accidentally triggering another auto-distill recursively. If you find this variable set in your shell environment by accident, unset it and re-run — the wrapper falls back to normal behavior automatically.