# Knowledge Distillation Pipeline Three skills form a continuous learning pipeline across projects: 1. **`/log`** — Run at end of session. Captures decisions, gotchas, open questions to `memory/log/YYYY-MM-DD..md` in the current project. Also prunes old reflected logs. 2. **`/reflect-logs`** — Run periodically. Processes unprocessed session logs into topic memory files (`memory/gotchas-*.md`, `memory/process-lessons.md`, etc.). Flags stale entries. Tracks state in `.reflection-state.json`. 3. **`/distill-best-practices`** — Run from any project. Reads changed memory files across all tracked projects and proposes updates to `claude-foundations/best-practices/`. Tracks state in `best-practices/.distill-state.json`. ## State files - **`.reflection-state.json`** — per-project, tracks which logs have been reflected on (md5 hashes of log content) - **`best-practices/.distill-state.json`** — in claude-foundations, tracks git SHAs per project at time of last distillation - **`settings.yaml`** — in claude-foundations, configures log retention (default 7 days), max logs per reflection run, tracked project list ## Log format Session logs use structured markdown with parseable section headers: Summary, Decisions, Gotchas Discovered (tagged with `[topic]` for routing), Open Questions, Key Context, Process Notes. Empty sections are omitted. ## Pruning - Reflected logs older than `log.retention_days` (default: 7) are automatically deleted by `/log` - Unreflected logs older than `log.warn_unreflected_days` (default: 14) trigger a warning instead of deletion - `/reflect-logs` flags stale memory entries (version-specific bugs that have been fixed, manual processes that have been automated)