Memory After The Laptop Closes
Memory is the part I got wrong first. I reached for a bigger window. The fix was a small diary, gated at every page. Judge a memory system by what it refuses to write down, and by how it tears out a wrong note.
I used to assume a bad note was harmless. It is worse than no note. The agent believes it and carries it forward with confidence. So I made every note earn its place.
Memory model
A good memory is a small diary you trust. A bad memory is a junk drawer of sticky notes that argue with each other.
A wrong note lives until you tear it out. Every session in between inherits it and works from it.
So writing a memory gets the same care as any other change. Write down only the few things you are sure of, and leave every page easy to undo.
The live window gets trimmed when it fills. Anything not written down goes with it. Above the window sit a few pages, each behind a gate that decides what is allowed onto the page. The gates are the design. They keep stray remarks out of memory.
Watch one fact climb from the live window into lasting memory.
01Three tiers, each slower and more guarded
Memory sits in three tiers, stacked. Speed falls as you climb, and so does the risk of losing what you wrote. Each tier buys a longer life for a fact, and charges more to get in.
- The live window. Everything in front of the agent this turn. Fast and complete, and it does not last. When the window fills and gets trimmed, anything unwritten is gone.
- Session notes. A small file the agent keeps while you work. It holds what must survive the next trim. It lasts the whole session, and it dies when the session does.
- Lasting memory. What survives after you close the laptop. A subagent reads the old session notes and copies the few facts worth keeping. It writes them in a form that still makes sense weeks later.
Your computer stacks its own memory the same way, fast at the bottom and slow at the top. The rules for moving between the two are the part that matters. Get the rules wrong and noise from the bottom fills the top. Promote little, and promote late.
02Promotion is gated, not automatic
A fact reaches the session notes through one gate, and that gate holds two tests. The conversation must clear a size mark. The churn since the last write, meaning how much new material arrived, must clear its own mark. Both clear, or nothing gets written.
Only then does a subagent step in and write. Each write resets the churn counter to zero, so the next write must clear the mark again. Work the two meters below and watch the verdict flip.
03The worker that writes memory is kept on a short leash
You scope a subagent before it starts, with a lighter card and permissions set in advance. The memory subagent gets one file, the session notes. It writes there and touches nothing else. Writing a note is a change, and every rule for changes still holds.
Why the leash matters
A subagent that runs unwatched with a wide scope is a standing risk. Nobody reads its output while it works. Tie it to one file and the worst case is one bad note. The write permission makes it useful. The single-file limit makes it safe to leave alone.
04The top tier is slow on purpose, and reversible
Folding session notes into lasting memory runs rarely, and it is the most careful step in the system. A lock holds it, so two passes never write over each other. A pass that breaks halfway undoes itself and leaves the old memory whole.
The agent leans on lasting memory for weeks. The lock and the undo step set the bar that high. When a note proves wrong, you roll back the promotion that put it there, and the agent stops repeating it.
05The real enemy is confident, stale memory
Save everything and you get a junk drawer. Old facts, notes that contradict each other, half-truths the agent now states as settled fact. One page says the API is v1 and the next says v2, and both carry equal weight. A missing note costs one lookup. A wrong note costs every decision that trusts it, and the agent has no reason to doubt its own handwriting.
The gates, the one-file subagent and the fold that undoes itself all serve one end. They keep memory small and cheap to correct. Prune it often and the next session starts from facts you checked. Flip the toggle below and compare the two memories.
The cost
Notes go stale as the work moves on, and one wrong note pushes later work off course. The fold can save a one-off as though it were a general rule. One odd case then hardens into something the agent treats as always true. Every gate adds wait and more parts that break. Skip the upkeep and the memory becomes a story the agent tells itself.
Decision
Ask what happens when a note in lasting memory proves wrong. An agent that can notice it, shrink the memory and roll the note back has a diary. An agent with no route to any of that has a junk drawer that grows. The next note spends the cheap move first, and thinks before it touches anything.