One of my agents reviews Swift architecture. It has a memory folder, and it writes to that folder on its own when it thinks something is worth keeping. I had never opened it.
This week I did. It holds ten files and about 20 KB, written between June and September across three projects. I read all of it and then checked what it claims against the code as it is today. This post is what I found, and what I think an agent’s memory is for.
The short version
- 63% of the memory was about one project, and all of it was written in one afternoon.
- I checked ten findings the memory lists as open. Eight were fixed. The fixes landed the same day the notes were written.
- The reviewer writes the memory and someone else fixes the code. Nothing tells the memory.
- The index is loaded on every run. Mine still advertises six problems that no longer exist.
- The entries worth keeping are the ones the code cannot tell you: decisions, deferrals, standing checks and traps.
- The entries that rot are the ones the code can tell you: line numbers, counts, and lists of open issues.
- Four of the five links between memory files were broken.
What was in there
The six SDK files were written within three hours, one per review phase. Each one records what the reviewer checked in that phase, what passed, and what was still wrong.
That is a review log. It is useful on the day and it reads well, which is why the agent wrote it. But a log of what was true at 2 pm is not memory, and I already had the reviews themselves.
I checked it against the code
The SDK files list findings as open, some with the words “all confirmed live”. I picked the ten I could check with a search and looked at the repository.
| Finding in memory | Today |
|---|---|
| A public setter that bypasses the one config path | fixed |
| The async configure path skips a UI step the sync path runs | fixed |
| Two code paths map the same log level differently | fixed |
| Strict concurrency checking is not enabled | fixed |
| No documentation catalog | fixed |
| Dependencies have no upper bound | fixed |
| One dependency declared in a different style from the others | fixed |
| Presentation logic leaked into a domain type | gone, the function no longer exists |
| Format presets are not public, so the documented example cannot compile | still true |
| Tests use only the older test framework | still true |
Eight of ten are stale. The memory is not old in the usual sense: the last commit in that repository is from the same day as the notes. The reviewer wrote down the problems, the fixes were made in the main session the same day, and the reviewer was never run again on that code. Its memory froze at the moment before the fixes.
That is the structural problem. The agent that writes the memory is not the agent that changes the code. A reviewer’s list of open issues goes stale exactly when the review works.
I did not check everything. One file lists five ways a value can skip redaction, and that needs a real read of the code, not a search. I am treating it as unverified, which is also the honest status of any memory entry.
The index costs the most
Each memory file has a one-line entry in an index, and the index is loaded into the agent’s context every time it runs. The files themselves are only read when the agent decides they are relevant.
So the index is the part I pay for on every review, in every project. Mine has nine lines. Two of them summarise the SDK as having no strict concurrency, no documentation catalog, open dependency bounds, a leaking setter, an async path that skips a step and a mismatched level mapping. That is six fixed problems, presented as the current state of the project, at the top of every run.
The agent protected itself a little. Several files carry a warning to “verify before acting” because the code may have changed. That is honest, but it moves the cost to every later run, which now has to re-check a claim before it can use it. A note that has to be verified from scratch each time has saved nothing.
What was worth keeping
Four kinds of entry held up. None of them can be recovered by reading the code.
Decisions that look like bugs. One file lists four designs and says “these design decisions are intentional and verified — do not re-flag them as bugs in future reviews”. A type that is marked unchecked-sendable on purpose. A file protection level chosen so background logging keeps working. Without this note, a fresh reviewer flags all four again, every time, and I explain them again.
What is deferred, and to when. The migration file says which leftovers belong to a later phase, so a phase 3 review should not block on dead code that phase 4 removes. It also says why it was written down: the plan lived in a session scratchpad “that will vanish”. The memory was the only durable copy of the plan’s shape.
Standing checks. One entry about a network layer begins with an instruction to raise a specific gap on any network or release review. That is not a fact about the past. It is a rule for the future, and it stays right until someone deletes it on purpose.
Traps. A base class that ends an analytics page in a lifecycle method, so a page started just before presenting a modal is closed at once. A third-party SDK that wraps a delegate in a proxy. These cost an hour to find the first time and nothing the second, if they are written down.
I can’t prove these entries changed a later review. I have no measurement for a false finding that was never raised. But they are the only ones I would be sorry to lose.
What rots
- File and line references. The memory points at a setter on lines 63 to 66. Line 66 is now a read-only property with a comment explaining why.
- Counts. Two files give the number of tests in the same project: about 96 in one, 127 in the other. Today it is 130.
- Open issue lists. Covered above. They are true until the review succeeds.
- Phase logs. “All six goals passed” describes an afternoon.
- “As of” facts about me. The file about my role says what I was working on in June.
Two smaller things. Files written two hours apart disagree about whether strict concurrency was on, because the code changed between them and the earlier file was never touched. And the files link to each other by name five times. Four of the five point at a name no memory has, because the agent wrote each link from what it remembered the name to be.
- File and line numbers
- Test counts
- Lists of open issues
- Phase logs
- Decisions that look like bugs
- What is deferred, and to when
- Standing checks
- Traps
What I am changing
- A memory entry has to be something the code cannot tell you. If a search would answer it, it does not go in.
- No open issue lists. Findings go in the review file. If one must be remembered, it is written as a standing check with a condition for removing it.
- Decisions carry their reason. “Intentional, do not re-flag” with the why, so a later reader can tell when the reason has gone.
- One file per project, not one per phase. A new phase edits the file. It does not add another.
- The index describes what a file is for, not what it found. “Decisions and standing checks for the logging SDK”, not a list of defects.
- Memory gets a review like code does. A pass every few weeks that checks claims against the repository and deletes what fails.
The performance skill I wrote about in the last post got some of this right by construction. Its memory is written by a script, not by the model. Duplicate entries raise a counter instead of adding a line, each route carries the date it last worked, and one rule says measurements never go in. My review agent’s memory had none of that. It was free text written by a model at the end of a task, and it looked much more trustworthy than it was.