Skip to main content

Command Palette

Search for a command to run...

Session memory is not project memory. It fixes the same complaint.

"My coding agent forgets everything between sessions." Two different things answer that, and they are not competing.

Updated
•6 min read•View as Markdown
Session memory is not project memory. It fixes the same complaint.
O
I build systems that work — technically sound, security-first, and actually useful to the people who depend on them. Creator of the UNICORN Binance Suite — six open-source Python libraries with 3.3M+ downloads and 390+ dependent public projects — and Keep the Why, an open-source agent skill that preserves the reasoning behind engineering decisions alongside the code. Currently pioneering AI-driven open-source maintenance: running a controlled AI agent that maintains production code and documenting what this shift means for engineering teams. Vienna, Austria 🇦🇹

The most common complaint about coding agents is the same on every forum: a new session starts from nothing. The explanation you gave yesterday is gone, the decision you made together is gone, the wrong turn the agent took and you corrected is gone, and tomorrow it proposes it again. Everyone who has worked with an agent for more than a week knows the feeling.

Two different things answer that complaint. They get compared as if they were rivals, and they are layers.

Session memory: what the agent keeps for itself

Claude Code's auto memory is the clearest example, because it is built in and on by default. As it works, Claude writes notes for itself: your role and preferences, corrections you gave, project context it can't derive from the code, ongoing work, decisions, and references to things outside the repository. The notes live in a directory on your machine, one per repository, and the first part of the file is loaded into every session. No setup, nothing to decide.

Three properties define it, and none of them is a flaw:

  • It belongs to one person on one machine. The directory is under your home, not in the repository. A teammate's clone does not have it. Your second laptop does not have it. That is by design: a memory that holds your preferences and your corrections should not automatically travel with the code.

  • It belongs to one tool. The notes are Claude Code's; Codex, Cursor or Copilot on the same repository do not inherit them.

  • It is not reviewed with the code. You can inspect and edit the memory, but it is not part of the repository's normal Git and pull-request review flow.

This is the right shape for what it holds. Your preferences are yours. A note like "keep explanations short unless I ask for detail" is between you and your agent. Nobody needs that in a shared project file.

Claude Code also has repository-level CLAUDE.md and AGENTS.md files. Those are shared project instructions rather than auto memory: rules, workflows, architecture and things Claude should do. They can contain rationale too, but rationale is not their dedicated job. The distinction here is specifically between Claude's local auto memory and a repository-native rationale layer.

The complaint session memory answers is: the agent forgot what I told it.

Project memory: what the repository keeps for everyone

A repository already is a project's memory, and has been for decades. The README says what it is, the docs how to use it, the tests what it must do, the changelog what changed, the history who changed it and when. Whoever has the clone has all of it, in every tool, on every machine, reviewed in every pull request.

What the classic layout never had a clear place for is the why: the decision, the alternative that was rejected and the reason it lost, the constraint the code doesn't show, the workaround that must not be cleaned up. That reasoning used to live in people's heads, and left with them.

Keep the Why is the convention and the agent skill for that layer: the agent writes the reasoning into context/ as it comes up in the session, as Markdown, committed with the code.

Three properties again, and they are the mirror image:

  • It belongs to the project. It is in the repository, so the clone carries it. Your teammate's agent can read the same file yours wrote.

  • It belongs to no tool. Any agent that can read the repository can read it, and switching tools does not remove the information.

  • It is reviewed. The why arrives in the same pull request as the code, and a wrong entry is a diff somebody can see.

The complaint project memory answers is: the agent forgot why the code is the way it is.

The same complaint, two answers

"The agent forgets" covers several different losses. Sort them and the answer sorts itself:

What the agent forgot Which memory answers it
that you prefer short commit messages session memory: personal, one tool, one machine
what you two did yesterday afternoon session memory, or git log
where the staging dashboard is session memory as a personal reference, or the README if the team needs it
that the plain retry loop was rejected, and why project memory, the why layer
that the ugly workaround exists because of a rate limiter project memory, the why layer
that a teammate's agent already found the migration trap project memory: it has to reach the other machine

The last three are the ones that come back as production incidents when they are lost.

A session memory may remember those facts locally. What it cannot do by itself is make them shared project knowledge across people, machines and tools.

That is the important distinction.

Why you keep both

The temptation is to pick one. Both directions are wrong.

Putting the why only into a personal memory is where many people start, because it is zero setup. It works until the second person, the second machine or the second tool. At that point the reasoning may still exist, but it is trapped in a memory the rest of the project does not carry.

Putting personal preferences into the repository is the opposite mistake. A shared context/ that holds one developer's habits is noise for everyone else, and a privacy problem on top.

Keep the Why refuses that on purpose: personal settings live outside the project, in the developer's own home directory, and the skill does not record who said what.

So: session memory for what is yours, project memory for what belongs to the project.

Leave auto memory on. Give the repository a why layer.

They may remember the same fact. Only one of them makes it part of the project.

The test

Clone the repository on a machine that has never seen it. Open it with a tool you have not used on it before. Hand it to a colleague.

What is still available to the agent is project memory. What has disappeared was session memory, however good that memory was on your laptop.

The complaint "my agent forgets everything between sessions" is really two complaints, and only one of them was ever about the session.


I hope you found this informative and useful.

Follow me on GitHub, Bluesky, Mastodon, X, and LinkedIn, or join Telegram for updates on my latest publications. Constructive feedback is always appreciated.

Thank you for reading, and happy coding! ¯\_(ツ)_/¯

G
Grunz_ai9d ago

there's a third one hiding in between: memory inside one long session. both of yours cover the gap between sessions, but compaction eats stuff mid run too. building grunz (coding agent on open models) the worst case we hit was the goal itself getting summarized into something vague, and the agent restarting the plan like it was a brand new task. keep the why would probably catch the decisions, but does it also pin what the user originally asked for?

O

That's a good third layer: working memory inside the current session.

Keep the Why deliberately wouldn't pin the original prompt verbatim - that would turn project memory into a session log.

But if part of the request becomes durable project intent, a constraint, or a decision, that distilled part should survive in context/.

If compaction loses the current task goal before that point, I'd treat that as a session/runtime problem rather than project memory.

The live graph is a good illustration of what happens after something crosses that durability threshold: it becomes connected repository knowledge rather than another isolated session note.

https://keepthewhy.com/dashboard/live/#graph

Grunz's example is a really good illustration of the boundary.

J

This split matches what I’ve seen building agent tools. Personal memory is useful, but anything the whole project needs should live with the code.

O

Exactly. Personal memory and project memory solve different problems.

If the knowledge should survive people, sessions and tools, keeping it with the code gives it the same ownership, history and review process as the project itself.

That's the core idea behind Keep the Why.

E

The distinction also makes me think about how information should move between the two layers. Not everything an agent learns during a session deserves to become project memory. A temporary workaround, one-off debugging observation, and an architectural decision have very different lifetimes. A useful pattern could be to treat promotion into project memory as an explicit step: the agent identifies a finding, captures the evidence and scope, and only then proposes it as durable project knowledge. That would reduce the risk of turning every session observation into repository noise while still making important reasoning available to future sessions and teammates.

O

I like that framing a lot - especially the idea of a durability threshold between session observations and project knowledge.

If you ever feel like exploring this further, contributions and discussions are very welcome here:

https://github.com/oliver-zehentleitner/keep-the-why

This is exactly the kind of edge case I want the project to get better at.

R
Rulestack13d ago

A rejection made only in PR review seems to miss both the clone and session memory. Does Keep the Why pick it up, or does someone carry it in?

O

Good edge case.

If the rejection exists only in PR review comments, Keep the Why cannot magically see it from the clone.

It gets picked up when an agent with access to that review context processes the feedback - for example during review, revision, or merge work - and records the rationale into context/.

Otherwise someone has to carry it in.

That is actually the boundary I care about: PR comments are transient discussion; once a rejection matters to future work, the reasoning should become repository knowledge.

R
Rulestack13d ago

Makes sense to me. The case I'd watch is a PR a person rejects and simply closes, since no agent reviews, revises or merges it, and I suspect that's how many rejections end.

B

Logging every tool call as a receipt changed how I debug agents. When a run goes sideways I replay the receipt trail instead of guessing from chat. Cheap to store and it cuts the mystery hours.

O

Yes - I’d put that in a third bucket: execution trace.

Session memory helps the agent continue. Project memory preserves what the project must not forget. Receipts preserve what actually happened during a run.

All three reduce different kinds of forgetting, and the receipt trail is invaluable when you need evidence instead of reconstruction.

AI-Assisted Development

Part 5 of 14

Real-world experiences with AI-assisted software development — what works, what breaks, where the limits are, and how AI changes development workflows in practice.

Up next

Keep the Why vs. Claude Code Auto Memory vs. MemoryCustodian vs. AgentsRoom

Four tools that get called project memory. Three questions sort them. One table, as of September 2026.