post-mortem
Post-Mortem
Retrospective of a working session — reasoning, decisions, dead-ends, spend — honest, root-caused, quantified, priced, ending in a reusable playbook.
Introspection for the narrative, aggregation for the cost. The payload — "I trusted the fork's summary, it had dropped 2 lines, I lost 15 min, lesson: grep the source first" — lives only in context. A log parser sees Bash ran 110×; it cannot see that 4 of those were the same decoder rewritten. Never mine logs for the why.
Carve-out — cost only. Summing
message.usagecounters from session JSONL and sub-agent.outputfiles is authorized. It is the only route to a[measured]cost: nototal_cost_usdfield exists, cost must be computed. Numbers may be summed, reasoning may not be mined. Recipe, sources and boundary →reference.md§Cost.
Output: post-mortem-YYYYMMDDHHmm.md + a 5-line summary in chat. Always full — every core section, every qualifying session.
Distinct from /save-context (forward-looking resume state) and /instruct-compact (compaction steering). This is a backward-looking debrief for learning.
When to Use
- End of a long (30min+) or multi-phase session, a hard problem solved, or sub-agents/forks were spawned.
- User says: "post-mortem", "retrospective", "session retro", "debrief", "what did we learn", "write up this session".
- Skip the ritual for trivial sessions: if it was a greeting or a one-file fix, say "Session is light — a post-mortem adds little" and write a 3-line note instead of the full ceremony.