AI agent memory has a quiet failure: the agent writes notes in one session that it trusts without checking in the next. Anthropic published a long look at how Claude's memory works on November 6, and one example makes the risk concrete: a single wrong note about a map kept an agent walking in circles until a background pass checked the note against the session it came from. If you are building an assistant or an automation that remembers customers, tickets or rules, the same thing can happen to you. This article covers what Anthropic found and how we would make every memory note carry the words that back it, so a cheap nightly check can catch the ones that do not hold up.

What Anthropic found

Anthropic's post, "The components of agent memory", describes an offline pass it calls dreaming: Claude rereads past session logs and its memory notes, then fixes mistakes, writes new notes or builds linked pages. The idea builds on sleep-time compute, a 2025 paper from Letta and UC Berkeley researchers that lets models "think" offline about contexts before queries are presented.

The problem dreaming addresses is stated plainly: "a note that’s wrong from the start or that drifts as the environment changes can be read, and trusted, by Claude in a later session."

The clearest case comes from Claude playing Pokémon Red. Claude wrote down the wrong side of a mountain for a landmark, and marked the area "Mt Moon DONE." In the run with the uncorrected note, Claude dropped back onto an earlier route three times and never reached the next city. When dreaming checked the note against the session transcript, it caught the error and rewrote it. In Anthropic's words: "The transcript gave Claude a ground truth to validate its memory against." With the corrected note, Claude went back into the cave and reached Cerulean City.

Two more findings matter for anyone designing memory:

  • Fewer notes did better. At about 10,000 steps, Claude Sonnet 3.7 had written 413 memory files across 225 folders and earned one badge. Claude Fable 5 wrote nine files in two folders, plus one top-level file, and earned four.
  • Quoted terms survived. When several agents wrote contract terms into one shared table, a brief built from it contained only 41 of the 57 graded facts, because agents had overwritten one another's work. With one agent per contract, quoting terms word for word, all 57 survived.

The note that is loaded every time

Most memory systems load a small set of notes into every session. Anthropic is direct about the risk: "an incorrect note can be carried into every session." Claude Code, for example, loads only the first 200 lines or 25 KB of its MEMORY.md index, so the top layer has to stay small.

That is where we would focus. A wrong note buried in a folder costs a search. A wrong note pinned to every session steers every answer the assistant gives a customer.

Make every note carry its evidence

Anthropic's own caveat is cost. Dreaming "requires compute", and the post adds that directing Claude to "continuously check all its memories might not be practical." It suggests focusing the pass on information likely to change.

So we would split the check in two, and treat it like any other of the [guardrails we put on AI agents](/solutions/ai-agent-guardrails). When the agent writes a note, it also stores the session it came from and the exact words in that transcript that back it. A cheap job then runs every night without a model call, and only the notes that fail it go to a model or a person. Here is a sketch of that job:

type Note = {
  id: string;
  text: string;      // the fact or rule the agent will trust
  session: string;   // the transcript it came from
  quote: string;     // the words in that transcript that back it
  pinned: boolean;   // loaded into every session
  lastRead: number;  // when a session last used it, in ms
};

type Verdict = "keep" | "review" | "unpin";
const DAY = 86_400_000;

export async function check(
  note: Note,
  load: (session: string) => Promise<string | null>,
): Promise<Verdict> {
  const log = await load(note.session);
  // No transcript, no quote, or a quote that is not in it:
  // send it to the model pass, which is the expensive one.
  if (!log || !note.quote || !log.includes(note.quote)) {
    return "review";
  }
  // Pinned notes cost tokens every session. Unpin the unused.
  const idle = Date.now() - note.lastRead > 30 * DAY;
  if (note.pinned && idle) return "unpin";
  return "keep";
}

What to notice: the expensive part, a model rereading a transcript and judging the note, only runs on the "review" queue. A note with no evidence is never trusted by default. And a pinned note that no session has read in a month moves down a layer, which keeps the always-loaded part small.

Where this costs you

A quote check only proves the note matches what was said. In the Pokémon case, Claude's own transcript said "Mt Moon is behind me", which was wrong. A note quoting that line would pass. Catching that needs the model pass, reading what happened after the claim, so the cheap check narrows the work without replacing it.

Writing evidence with every note adds tokens at write time and a field your memory store has to keep. Transcripts have to be kept as long as the notes that cite them, which matters for retention rules if they hold customer data.

Rules about what to save can also backfire. Anthropic tested a fixed rule to record only failures, and both Opus 5 and Opus 4.7 "lost much of the performance boost that memory gave them". Asking for evidence with each note changes the format of a note and leaves the choice of what to remember to the agent. We would still measure it against the same tasks without it.

What to take from this

  1. Treat every memory note as a claim the agent will trust later without checking.
  2. Store the source session and the exact backing words with each note.
  3. Run a cheap nightly check without a model, and send only the failures to a model or a person.
  4. Keep the always-loaded layer small, and unpin notes no session has used in a while.

If you are building an assistant that remembers and want a second opinion on how it does it, book a conversation.

Sources