Claude Managed Agents memory stores, explained

Claude Managed Agents keep memory in memory stores: folders of text files mounted into each session, versioned on every write. How they work, and their limits.

On this page

Claude Managed Agents memory lives in memory stores. Each session starts with a fresh context, and a memory store is what carries knowledge from one session to the next: a collection of small text files, scoped to your workspace, that you attach when you create a session. The store is mounted as a folder under /mnt/memory/, and the agent reads and writes it with its ordinary file tools. Every change creates a version you can audit, roll back or redact. Memory stores are in beta, under the agent-memory-2026-07-22 header.

This is from Anthropic’s memory stores documentation, as of November 2026. Beta features change, so check that page before you build on a detail.

Anthropic now has three kinds of agent memory, and they’re easy to mix up:

Managed Agents memory stores The memory tool Claude Code auto memory
For Agents Anthropic hosts Agents you run on the Messages API Claude Code on your machine
Stored by Anthropic, in your workspace You: your handler maps /memories onto your storage Claude Code, in ~/.claude/projects/<project>/memory/
The agent reaches it through A folder mounted at /mnt/memory/<store>/, with the normal file tools The memory tool’s commands, which your code runs Its file tools, with MEMORY.md loaded at the start
History A version for every write, kept at least 30 days Whatever your storage keeps None
Shared between sessions Any session the store is attached to Any request that uses your handler Sessions of one repository on one machine

How memory stores work

A memory store is an object in your workspace with a name and a description. The description is shown to the agent, so write it for the model. Each memory in the store is a text file addressed by a path, like /preferences/formatting.md.

You attach stores in the session’s resources when you create the session:

store = client.beta.memory_stores.create(
    name="User Preferences",
    description="Per-user preferences and project context.",
)

session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    resources=[
        {
            "type": "memory_store",
            "memory_store_id": store.id,
            "access": "read_write",
            "instructions": "User preferences and project context. Check before starting any task.",
        }
    ],
)

Inside the session, the store appears as a folder named after it: “User Preferences” mounts at /mnt/memory/user-preferences/. A short note in the system prompt tells the agent the mount exists, with its path, access mode, description and your instructions. There are no memory-specific tools. The agent uses read, write, edit, grep and the rest of the agent toolset, which must be enabled on the agent. Writes under the mount are saved back to the store and reach every other session that shares it.

You can also work on a store without a session. The API creates, reads, updates and deletes memories by path, and the Claude Console shows them. Use that to seed a store before the first session, or to fix a bad memory.

Limits of Managed Agents memory

  • 100 kB per memory, 10,000 memories per store. The docs recommend many small files over a few large ones.
  • 8 stores per session, attached at creation only. You can’t add or remove a store from a running session.
  • History is kept 30 days. Older versions may be deleted, though the most recent versions of a live memory are always kept. Export them through the API to keep more.
  • No restore button. To roll back, read an old version and write its content back.
  • Archiving is one-way. An archived store is read-only and can’t be attached to new sessions. There is no unarchive.
  • Not eligible for zero data retention, except on self-hosted sandboxes, where the worker keeps a synced local copy instead of a live mount.

Read-only by default for anything shared

Stores attach as read_write unless you say otherwise. The docs warn that an agent reading untrusted input, such as user prompts, fetched pages or third-party tool output, can be steered by a prompt injection into writing to the store, and later sessions then read that content as trusted memory.

So the pattern the docs suggest is two kinds of store. One read-only store for shared reference material (standards, conventions, domain knowledge), attached to many sessions. One read-write store per user, team or project, which the agent keeps. And never write credentials into a store: memories are replayed verbatim into every later session that mounts it.

If a secret or personal data does get in, delete or overwrite the memory, then redact the old version. Redacting clears its content and path but keeps who changed what, and when. The current version of a live memory can’t be redacted.

Memory stores or the memory tool?

Use memory stores when your agent runs on Managed Agents: Anthropic keeps the files, the versions and the mount, and you write no storage code.

Use the memory tool when you run the agent loop yourself on the Messages API. It works client-side: Claude asks for view, create or str_replace on a path under /memories, and your code carries it out against storage you choose, a folder, a database or encrypted files. You own retention, and you must reject paths outside /memories yourself.

What it says about agent memory

Anthropic’s hosted answer to agent memory is plain text files in folders, written by the agent with the same tools it uses for code, with a version for every change and read-only access for what shouldn’t drift. No embeddings, no extraction model. That’s the same bet behind Claude Code’s auto memory, and behind Memorinth: a person can open what the agent remembers, read it and correct it. Agent memory should be Markdown you own makes that case.

Memorinth is for a different place, though. It’s a memory layer for the coding agents on your own machine, Claude Code, Codex, Cursor and Gemini CLI, served over a local MCP connection. It doesn’t connect to Managed Agents sessions. If your agents run on Anthropic’s platform, memory stores are the tool. If they run on your laptop, see Give Claude Code a long-term memory, and Decisions for how Memorinth keeps a history of what was decided.

All posts