You'll finish with: An agent that gets sharper every time you use it.
By default an agent starts fresh every time. It doesn't know it researched this company last month, or that the last proposal got knocked back on price.
What builds up over time
One line in the file turns this on.
Add memory: project to the agent's file. That gives it a notes folder that survives between sessions.
It's a notebook the agent keeps, and it uses the notebook on its own. Setting the field is the whole setup: Claude Code tells the agent how to read and write those notes, and hands it the first page — the top of a file called MEMORY.md — at the start of every run. You don't have to remind it.
One switch turns the whole thing off. Subagent memory rides on Claude Code's auto memory, which is on by default. If auto memory has been switched off — the autoMemoryEnabled setting, or CLAUDE_CODE_DISABLE_AUTO_MEMORY set on the machine — the memory line does nothing at all. Type /memory in Claude to see the toggle.
Worth knowing too: turning memory on also gives the agent Read, Write and Edit so it can keep the notes. Fine here. Not fine on a reviewer — chapter 5 explains why.
The reading and the writing happen without you. What the agent decides is worth keeping is up to it, and that's the part worth aiming. A couple of lines at the end of the prompt do it:
When you finish, save what would save time next visit —
what this client pushed back on, which openings got a
reply, what price they've already seen.
Keep MEMORY.md short: one line per company. Put the
detail in a separate file named after them.
That last instruction matters more than it looks. Only the top of MEMORY.md is loaded at the start of a run, so a sprawling index quietly stops being read.
memory: project is in the top block./memory and check the auto memory toggle is on. If it's off, the field you just checked does nothing.Second run mentions something from the first without you saying it. That's the memory working.
If every run starts cold, the field isn't taking effect. First thing to check is auto memory: run /memory and look at the toggle, and check nobody has set CLAUDE_CODE_DISABLE_AUTO_MEMORY on the machine. With auto memory off, memory: project is ignored completely. Second most likely is a typo, or the line sitting below the --- instead of inside the top block.