# skill: /log **Location:** `custom-claude-skills/skills/log/SKILL.md` ## Purpose End-of-session logging. Captures key decisions, gotchas, open questions, and process notes into `memory/log/YYYY-MM-DD..md` for later reflection. Run before ending a session. ## Usage ``` /log ``` No arguments. Reviews the full conversation history and any pre-compaction transcript backups automatically. ## How it works 1. Creates `memory/log/` if needed 2. Reviews the conversation and extracts: Summary, Decisions, Gotchas (tagged with `[topic]`), Open Questions, Key Context, Process Notes 3. Writes a structured in-context log — empty sections are omitted 4. **Transcript analysis (when backups exist):** Checks `~/.claude/transcript-backups/tracking.json` for unprocessed pre-compaction snapshots for the current project. If found, spawns a **Sonnet** subagent to read the JSONL backups (via `extract-transcripts.py --extract`) and write a companion log `HHMMSS-transcripts.md`. The subagent then marks backups as processed in `tracking.json`. Sonnet is used (not Haiku) because gotcha detection requires judgment about backtracking and failed attempts. 5. Prunes old logs: deletes reflected logs older than `retention_days` (default 7), warns about unreflected logs older than `warn_unreflected_days` (default 14) ## Dependencies - `~/.claude/scripts/list-transcripts-here.sh` — pre-gathers unprocessed transcript metadata (small JSON, no context overflow) - `~/.claude/scripts/extract-transcripts.py` — reads JSONL backups and manages tracking.json (used by the Sonnet subagent) - Both scripts live in `claude-foundations/scripts/`, symlinked into `~/.claude/scripts/` ## Part of the knowledge pipeline `/log` → `/reflect-logs` → `/distill-best-practices` Raw session logs (and transcript companion logs) are input for `/reflect-logs`, which routes entries into topic memory files. ## Gotchas - Trivial sessions can be skipped — the skill says so if nothing worth logging happened - `[topic]` tags on gotchas should match existing memory file topics for routing by `/reflect-logs` - The Sonnet subagent writes to the project's absolute `memory/log/` path; if it uses a relative path from the wrong cwd, the file ends up in the wrong place — verify on first real run - Pre-compaction backups from before the tracking system existed (files with `-auto` in the name) are not in `tracking.json` and won't be processed; they'll be pruned by the 30-day cleanup in the hook