Book 30 · Patriola’s Guide to Claude
Memory Diary
Every session boundary is a small erasure. The reasoning built, the dead ends ruled out, the judgment calls already resolved — gone when context clears. This book builds the layer that stops the loss and hands the next session a starting point instead of a blank slate.
A diary layer that survives compaction
The chapter was half-edited. Line 47 had a rewrite in progress — a sentence restructured for clarity, the old version still in a comment above it. The context around that line had taken forty minutes to rebuild: reading surrounding chapters to establish the argument’s position, checking an earlier draft to understand why a paragraph had been cut, re-deriving which of two phrasings matched the series voice. All of that was done. The model knew where it stood.
Then the session ended. A new session opened the next morning. Cold start, no context. The forty-minute rebuild happened again — except one judgment call came out slightly differently. The revised sentence at line 47 landed at a conclusion the previous session had explicitly considered and rejected. Nobody noticed until the chapter went to review.
That is the compaction problem. The file survived. What did not survive was intermediate reasoning: decisions already made, dead ends already ruled out. A cold start does not know which dead ends were dead. So it walks them again.
This book builds a diary layer that stops that. The format is pipe-separated notation designed to be dense enough to be cheap at read time and accurate enough to let a cold start resume without re-deriving what the previous session already knew. The precompact hook fires at session close, writes the entry, and requires nothing from you.
What you’ll learnEight chapters, one complete system
- The compaction problem — What gets lost at session boundary, how to measure the recovery cost, and why prose-heavy diary entries fail under repeated compaction. The specific failure mode that motivates the format discipline in this book.
- Diary vs. drawer — The promotion decision: when a session event has stabilized into a standing fact, how to recognize that moment and move the entry from diary to drawer without duplication.
- The entry format — The pipe-separated notation: field structure, separator conventions, and the tradeoffs made in its design. Why 80 tokens carrying the same meaning as 400 is a concrete win on every cold start that follows.
- The compression discipline — The cold-start test: a repeatable standard for deciding whether an entry is good enough before the session closes. A fresh session given only the entry — if it resumes accurately, the entry passes.
- The precompact hook — The specific captures that diary-focused writes require, the ordering constraints that make them reliable, and how the hook differs from generic save behavior.
- The save trigger — Mid-session checkpointing: the practice of writing diary entries during a session rather than only at close, and the specific moments that warrant an early write.
- Episodic summaries — Multi-thread sessions: how to compress a session that touched several parallel work streams into a summary a cold start can actually use without losing the thread distinctions.
- Cold-start recovery — The full pipeline from hook trigger through cold-start read, with the verification step that confirms the chain is working end to end before it matters.
A preview
A technique requires remembering to apply it. A system fires whether you remember or not. The distinction sounds minor until the third week of a project, when the session that should have written a diary entry was interrupted before close and the next morning starts with nothing. The hook does not get interrupted. It fires at precompact regardless of what the session was doing when compaction began.
Anyone who works across sessions
This book is for anyone who has opened a Claude session on a project and spent the first twenty minutes rebuilding context that the previous session already had. Book 4 of this series built the drawer store and basic diary pattern; this book builds the layer on top of it. If you have not read Book 4, the cold-start recovery concepts here still apply, but the hook and store integration assume that foundation is in place.
A longer excerpt is available to newsletter subscribers.
New books in this series
One short email per book launch.