I use Claude Code every day, and it manages its own memory. While we work on something, it decides to keep a fact and writes it down. In a later session, it decides that the fact is relevant and uses it. I can ask it to remember something, but most of what it keeps it has chosen itself, in the middle of other work.
Then I checked what was in there, and whether it was still true. I used Enola, an open-source CLI and MCP server that builds a graph of your code on your own machine, and the enola-memory skill that comes with it. In short:
- Some notes described code that was gone. Two rested on functions removed sixteen weeks earlier, and one was about a tool that no longer exists.
- Four days and 30 commits later, most still held. Of 91 links between notes and code, 88 were unchanged and three needed a second look.
- You can check your own by running
/enola-memoryin your coding agent.
How Claude Code memory works, and why it matters
Every Claude Code session starts with an empty context. Two things carry knowledge from one session to the next. CLAUDE.md is the one you write: instructions and rules. Auto memory is the one Claude writes for itself, and it is on by default.
What gets saved. Claude decides, based on whether a fact would be useful in a future conversation: your preferences, corrections you made, decisions and context of the project, pointers to other resources. It is meant to skip what it can read from the code. In practice, the reason behind a decision comes with the names of the functions it was about, and so do most of my notes.
Where it goes. Into Markdown files on your machine, under ~/.claude/projects/<project>/memory/, one fact per file. An index, MEMORY.md, has one line for each.
How it comes back. The index is loaded at the start of every session, up to 200 lines or 25 KB. The notes themselves are not. Claude reads those lines, judges which notes the task needs, and opens them. Retrieval therefore depends on two texts matching in Claude's reading: how you describe today's task, and how a past session summed up its note in one line.
Claude Code may show that it saved or recalled memories. It does not tell you which sentence of an answer rests on which note. And nothing in this process compares a note with the code it describes: a note from July and a note from this morning look the same.
That matters because a note is an input, like your prompt. It can save the agent from rediscovering something. When it is wrong, the agent plans a change around a function that isn't there or a rule that no longer applies, and you see only a wrong assumption with no sign of where it came from. When it is right but not retrieved, the agent repeats a mistake it had already written down.
July: Claude Code saves two notes to memory
On 20 July, Claude and I were working on the part of Enola that decides whether two repositories share code. Two Rails applications will both have an ApplicationController, and that doesn't mean one depends on the other, so we taught the linker to ignore such names. When we were done, Claude wrote a note: what the rule is, why it exists, and that it lives in linkSharedSymbols, next to a list called frameworkConventionNames.
The next day we fixed the direction of those links, and Claude wrote another note. That one pointed to directedSharedPairs.
Both were good notes. I wasn't aware of either.
They went into the folder, with a line each in the index.
August: the code moves, the memory goes stale
On 3 August I split that linker into plugins. linkSharedSymbols went away, and so did directedSharedPairs and frameworkConventionNames. The behaviour survived, in other packages and under other names.
Nobody updated the notes. Nothing in a pull request says that some file in a home directory now describes code that isn't there. So for the next sixteen weeks, every session in that project started with an index that offered both notes as facts.
By November the folder had grown to about 80 notes, most of them about Enola's own code: why a lock is not needed here, which function composes route prefixes, what not to touch without bumping a version. It was useful knowledge, and each note had been true on the day it was written, at best.
I knew how fast this goes wrong in general. In Keeping AI Coding Agent Memory Relevant as Code Changes I measured it on Excalidraw and Vite: within thirty days, 29% and 16% of saved line references pointed into a different function. I had not looked at my own.
24 November: finding stale memories with enola-memory
The enola-memory skill ties each note to the code it describes, so that a later session can ask whether that code is still the same. To start, you run it with no task:
/enola-memory
None of my notes was tied to any code at that point. They named functions in their text, and that was all. For every function or type a note mentions, the skill has the agent ask Enola where it is now. When Enola finds it, the note gets a stamp: the symbol's id, its name and a hash of its code. When Enola doesn't, the name goes on a list.
The two July notes were on that list.
Text search would not have settled it. linkSharedSymbols still appears in the repository today, in a comment above the code that replaced it. And deleting the notes would have been the wrong fix, because the rules they describe still apply. The skill doesn't change a note's content without asking, so it was my decision: I had Claude mark both as stale and stamp the code that does the job now.
Three more notes used names that had since changed or been removed. Another mentioned a function deleted nine days earlier. The rest of each still held.
One note was obsolete from top to bottom. It explained how to read the results of validate_architecture_change, an Enola tool that no longer exists. The functions it used as examples were all still there, so its stamps alone looked fine. This is why the skill also looks for the tools, commands, flags and config keys a note names, and reports those that no longer appear anywhere in the repository. I confirmed the tool was gone, and Claude deleted the note.
By the end of the day, 28 notes were tied to their code. A run two days later added eight more, in about a minute. It also found nine names that no longer exist, all in notes that had recorded the removal themselves, and correctly called none of them stale.
28 November: checking 91 memory stamps after 30 commits
This time the notes were stamped when the code moved. In the four days since the first run the repository took 30 commits touching 269 files. For this post, I checked every stamp against today's code:
| Status | Stamps |
|---|---|
current: same code |
88 |
rewritten: the code changed |
3 |
moved, gone, ambiguous |
0 |
The check took two and a half seconds, including building a fresh snapshot of the repository.
Of the 88 that are current, 18 are no longer on the line where they were stamped. A file:line reference would have pointed to the wrong place for each of them. The stamps followed the functions.
That left three stamps to look at, out of 91. walkNestedScope gained a case for nested classes, and the note about it still holds. confidenceFor gained a condition, and that note still holds too.
The third was IsGeneratedPath, which gained the suffixes of Dart code generators. Its note says in one place that files named zz_generated.* are not covered by that function. Fifty lines further down, the same note says they are. The second is right. The first had been wrong since 10 October, when the rule was added, and the two had sat in one file for seven weeks.
The Dart change didn't cause that mistake. It gave us a reason to reread that note, which nothing had done before.
In August, a refactoring left two notes pointing at code that was gone, and it took sixteen weeks to find out. In November, four days of changes came down to three notes to reread, one of which needed fixing.
Before the next change: finding the right notes through the code graph
Finding stale notes doesn't help if the agent misses the right note before it edits the code.
Say I am about to change Engine.linkCrossRepo, the function that links repositories together, which is where the two July notes belong. Searching my notes for its name finds two, and neither is one of them. Searching for "cross-repo" finds 13, many about something else.
The skill uses the code graph that Enola builds from the source instead: which function calls which, and what depends on what. It starts at the function, walks two steps out to what calls it and what it calls, and picks the notes stamped on any of those symbols:
| Distance | Note is stamped on | What it knows |
|---|---|---|
| The function itself | linkCrossRepo |
Changing the linker needs no cache version bump, but test outputs must be regenerated |
| The function itself | linkCrossRepo |
How shared code between repositories is verified |
| One step | ComputeLinks |
The first July note: why framework boilerplate is excluded (marked stale: old names) |
| One step | Store.Add |
How facts are laid out in memory |
| Two steps | vocab.Set |
The second July note: which way a link points (marked stale: old names) |
Both July notes are there, with the stale warning attached.
So did I get what I needed? For this function, yes. Four of the five notes are ones I want the agent to read first. It knows which rules the linker follows, which tests to regenerate, and that two notes have the right rules under old names. The fifth, about memory layout, is a weak match through a widely used method. The stamps that brought up these notes are all current: the code under them has not changed since they were taken. I asked for none of the notes by name.
It didn't find everything. I went through the 13 notes the "cross-repo" search had found, and one more belongs here: shared type names alone never make one repository depend on another. It is stamped on functions inside the shared-code plugin, which the linker reaches through an interface, and two steps from linkCrossRepo don't get that far.
That note is about the plugin, so I ran the same recall from there, starting at the plugin's Contribute method. It returned three notes and nothing else: the missing one, and both July notes.
The closer the starting point is to the code you will edit, the better the notes. In practice, name the function you are going to change and ask before the first edit:
What do we know about
Signal.Contributein the shared-code plugin before I change it?
What comes back is a short reading list, with a status on each entry. Both July notes now reach the session that needs them, with a warning where the names are out of date.
How enola-memory ties local notes to code
Enola stores no memories. Your notes stay where they are, and the skill adds a few lines to each one. For Claude Code that is the note's own frontmatter (shortened here):
anchors:
- at: internal/engine/engine.go:659
name: engine.Engine.linkCrossRepo
symbol_kind: method
id: 88f3bf6869631b1c...
body_hash: 6bb4fada8c03e53eid says which symbol it is, independent of line numbers. body_hash says which version of its code the stamp was taken from. A note about a whole file or folder records the path. Notes with no code of the repository behind them, such as preferences, working habits and other projects, are left alone: 43 of mine were.
Later, the skill passes the stamps back to Enola and acts on each answer:
current: same code, use the note.rewritten: the code changed. Reread the note against it, then restamp or correct it.moved: same code, new place. The stamp is updated and nothing needs rereading.gone: the symbol is not there under that identity. The note is a candidate for removal, and you are asked first. If Enola found a likely successor, it is listed.ambiguous: more than one symbol fits. The skill shows them and picks none.
The stamps and checks come from parsing your source on your machine, with no model involved. Your agent reads the notes with whatever model it already uses.
Nothing here depends on Claude Code's memory in particular. A notes/ directory in the repository or a memory service works the same way. Where there is no frontmatter or metadata, the stamps go in a block at the end of the note or in a file beside it.
Why not let the agent check its own notes?
Because you would be asking for a judgement where you can have a fact. Whether a function's code is the same as on the day of the stamp has one answer. Enola gets it by comparing hashes, so with the same Enola version, the same stamp and the same code give the same answer every time, on any machine, whichever model is asking. An agent that reads the code and decides can answer differently tomorrow. Its judgement is better spent on the question that needs it: the code changed, so does the note still hold?
I saw the difference in a small test. I gave fresh Claude Code sessions 37 notes about Excalidraw, stamped 180 days earlier, and asked what had become of the code behind each. Three sessions worked without Enola, and one of them disagreed with the other two on three notes. The three sessions with Enola and the skill available all gave the same 37 answers, for a median of $0.58 and 89 seconds against $0.63 and 121 seconds.
On Vite, with 34 notes, all six sessions agreed. The median was $0.48 and 65 seconds with Enola and the skill, and $0.55 and 122 seconds without. Most of that difference comes from Enola's tools rather than the skill. With three sessions each, the costs are close to noise; an earlier Vite round, whose prompt defined symbols differently from Enola, cost about the same on both sides.
How to check your own Claude Code memory
The skill ships with Enola 0.5.4 and later.
New to Enola. Install the binary, then run two commands in your repository:
curl -fsSL https://raw.githubusercontent.com/enola-labs/enola/main/install.sh | sh
enola install
claude mcp add-json enola '{"command":"enola","alwaysLoad":true}'The last line is for Claude Code. Other agents are in Connect your coding agent.
Already using Enola. Run enola upgrade, then enola install again in the repository, because only install writes the skills.
Then restart your agent session and run the skill with no task:
/enola-memory
The first run stamps what you already have and lists the names it cannot find. Read that list first. After that, ask in plain words:
Which of our notes still hold?
What do we know about this function before I change it?
Two habits keep the notes checked:
- Add one line to your agent's standing instructions: "stamp notes about code with enola-memory". Without it, a note saved in passing can be written without a stamp.
- Ask which notes still hold after a large merge or refactoring. A skill runs only when it is loaded, and nothing checks your notes in the background.
What a memory check won't tell you
A current stamp does not prove the note is right. It says the code has not changed since the stamp. If the note was wrong that day, it is still wrong, and existing notes are stamped on the day you first run the skill.
A change elsewhere can break a note too. A function can stay the same while its callers change around it. And as the obsolete note above showed, a note can outlive its subject when its stamps are on its examples.
The first list needs a human. A missing name may be a deleted function, or a test, a constant or a field that Enola never held as a symbol. The skill keeps the two apart, and you decide what happens to the note.
FAQ
How do I find outdated notes in Claude Code's memory?
Install Enola, run enola install in your repository and call /enola-memory in Claude Code. The skill ties each note about code to the function or type it describes, and lists the names it can no longer find. Later, ask which notes still hold, and it reports the ones whose code has changed, moved or gone.
How do I see what Claude Code remembers?
Run /memory in Claude Code and open the auto memory folder, ~/.claude/projects/<project>/memory/. The files are plain Markdown that you can read, edit or delete. The same command turns auto memory on or off.
Does Enola upload my notes or my code?
No. Enola runs locally, and what your coding agent sends to its own model works as it did before.
Will enola-memory delete my notes?
Not on its own. enola-memory adds stamps, updates the stamp of code that only moved, and asks before changing or removing the content of a note.
Does enola-memory work with agents other than Claude Code?
Yes. enola install adds the skill for Claude Code, Codex, Cursor, GitHub Copilot, opencode and Pi. The Skills documentation shows how to call it in each.
Why not just use git blame?
git blame says which commit last changed a line that exists now, and who made it. It cannot say whether the function a note describes still exists, whether it is the same as when the note was tied to it, or which notes matter for the code you are about to change. A note usually has no line to blame. It has a name and a claim.
- Getting from the note to the code. Blame needs to be told where to look. If the function was renamed, moved or deleted, there is no line to blame. Enola starts from the symbol and says whether it is there, has moved or is gone.
- Deciding whether the code changed. Blame gives a commit per line. It has options to ignore whitespace and follow moved lines, but comparing the result with the day the note was written is left to you or the agent. A stamp compares the whole function with the version stamped and returns one status. Re-indenting or moving the function does not count as a change.
- Finding the right notes. Blame knows nothing about which functions call each other, so it cannot say which notes matter for the one you are about to change.
Git has more than blame: git log -L follows a function within a file, and git log -S finds the commit that added or removed a name. The skill itself suggests the second for names it cannot find. They work well together: Enola says which of your notes to look at, and git says who changed that code, when and why.
Further reading
- Keeping AI Coding Agent Memory Relevant as Code Changes
- How Claude Code remembers your project (Claude Code documentation)
- The Four Memory Layers Every Coding Agent Needs
- Enola skills: review, test plan, intent and memory
- Shift-Left Testing for AI Coding Agents
- How to Enforce Architecture Rules for AI Coding Agents
- Enola on GitHub