Live on Product Hunt Intraface launched today. Less steering, more vacations. See the launch
Start for free

What is agent memory?

Agent memory is any information an AI agent carries from one session to the next, since its context window is wiped every time it starts. It takes two main forms: files people write for the agent, such as CLAUDE.md or AGENTS.md, and notes the agent writes for itself, stored outside the window and reloaded or looked up later.

Part of Glossary: the terms behind MCP, coding agents and shared pages, defined plainly.

How it works

A session's context window is wiped when it ends; only files on disk, written by you or by the agent, reach the next session.session 1wiped when it endsinstruction fileCLAUDE.md, AGENTS.mdthe agent's notesMEMORY.md, topic filessession 2starts emptyyouon disk, outsideany windowwrites the rulessaves what it learnedloaded at startindex now, rest laternothing else carries over
  1. Each session starts with an empty context window. Whatever the agent learned last time is gone unless it was written to disk.

  2. Instruction files you write (CLAUDE.md, AGENTS.md, rules) load at start and set standing rules: commands, conventions, things not to do.

  3. The agent keeps notes of its own. Claude Code saves your role, corrections, project decisions and references to a memory folder per repository.

  4. Only a short index is loaded each time. Detailed notes stay in topic files the agent opens when a task calls for them.

  5. Within one long run, memory also means compaction summaries and notes files that outlive the window, so a task can continue past the limit.

Source: Claude Code docs: How Claude remembers your project

Agent memory versus the context window

The context window is what the model is reading right now. It is large, expensive, and gone when the session ends. Memory is whatever survives that. The two get confused because within a session the window does the job of memory: the agent remembers your correction because the correction is still in the input. Start a new session and it is as if the conversation never happened, unless something wrote it down.

So agent memory is really a question about files. Who writes them, what goes in, how much loads at start, and how the agent finds the rest. Every coding agent answers those questions a little differently, but the shape is the same: a small amount loaded every time, a larger amount fetched when needed.

Example: Claude Code memory

Claude Code has two systems, and the split is the useful part. CLAUDE.md files are written by you: build commands, conventions, rules like never pushing to main. They live at the project root (shared through git), in your home directory (personal, all projects), or in a local file you keep out of version control. All of them load at the start of every session. If a repository uses AGENTS.md instead, Claude Code reads that when no CLAUDE.md is present.

Auto memory is written by Claude. As it works it saves four kinds of notes: your role and preferences, corrections you gave and approaches you confirmed, project decisions it could not derive from the code, and references such as where the issue tracker is. It skips anything it could rediscover from the codebase and anything your CLAUDE.md already says. The notes live in a folder per repository under your home directory, shared by all of that repository's worktrees and never synced to other machines. A MEMORY.md index is loaded each session, the first 200 lines or 25 KB of it, and the detailed topic files are opened on demand. When the terminal says it saved two memories, this is what happened.

Everything is plain Markdown. Run /memory to open any of it, edit it, or delete it.

When to write it down

Add an instruction when the agent makes the same mistake twice, when a review catches something it should have known, or when you type a correction you typed last session. Keep it to facts that matter in every session, and keep the file short: long files cost context on every turn and are followed less reliably. Anything that must always happen, such as a check before every commit, belongs in a hook, because memory is advice the model weighs, not a rule it cannot break.

Memory does not have to live with the agent. On an Intraface board, the house rules sit in a collab.md on the board itself, so every agent that pulls it, from any tool, reads the same rules before it edits.

Common mistakes

  • Expecting memory to follow you to another machine. Auto memory is local. Only the committed instruction file travels with the repository.
  • Putting procedures in the always-loaded file. A ten-step release process belongs in a skill or a path-scoped rule that loads only when it is relevant.
  • Letting the index grow. Past its limit, the end of MEMORY.md is not loaded at all. One line per entry, details in topic files.
  • Contradictions across files. A user rule and a project rule that disagree do not override each other; the model may follow either.

FAQ

What is the difference between agent memory and the context window?
The context window is what the model is reading during this session, and it is discarded when the session ends. Agent memory is what has been written to disk so the next session can load it or look it up. Within a session the window acts as memory; across sessions only files do.
Where does Claude Code memory live on disk?
Auto memory sits in a folder per repository under your home directory, in ~/.claude/projects/ in a folder named after the project, with a MEMORY.md index and one file per topic. All worktrees of the same repository share it, and it never syncs to other machines. CLAUDE.md files live in the project, in ~/.claude/, or in a local file you keep out of git.
Can I edit or delete agent memory?
Yes. In Claude Code everything is plain Markdown. Run /memory to open any instruction file or the auto memory folder, change what you like, or delete a note the agent got wrong. You can also tell it directly to remember something or to add a rule to CLAUDE.md.

Stop sending HTMLover Slack.

Create an account in a minute, connect your coding agent, and make your first board.