
Give Your Claude Agent a Memory That Survives Sessions: The Managed Agents Memory Store
Chris Harper
3 min read
Jul 22, 2026 · 04:05 UTC
TL;DR: Attach a memory store to a Claude Managed Agent session and the agent gets a persistent /mnt/memory/ directory it reads and writes with ordinary bash tools — every write versioned, surviving across sessions.
Every agent conversation ends and context clears. The checkpointer pattern (thread IDs) gives you replay within a thread, but not recall across threads or weeks. Claude Managed Agents ships a simpler answer: a memory store is a directory the agent reads and writes with the same bash and file tools it already uses, persisted and versioned server-side. Today's SDK releases (Python 0.116.0, TypeScript 0.110.0, Go 1.56.0, Java 2.48.0, Ruby 1.55.0, PHP 0.36.0, C# 12.35.0) ship the new agent-memory-2026-07-22 beta header and wire it in automatically on all memory store calls.
Create and mount a memory store
import anthropic
client = anthropic.Anthropic()
# 1. Create a workspace-scoped memory store (one-time setup)
store = client.beta.memory_stores.create(name="user-preferences")
store_id = store.id # e.g. "memstore_01AbC..."
# 2. Mount it in a session — the agent sees it at /mnt/memory/
session = client.beta.agents.sessions.create(
model="claude-opus-4-8",
system=(
"You are a personal assistant. Your long-term memory is at "
"/mnt/memory/. Check it at the start of each conversation and "
"update it when you learn something new about the user."
),
resources=[
{
"type": "memory_store",
"memory_store_id": store_id,
"mount": "/mnt/memory",
"access": "read_write", # or "read_only" for consumer agents
}
],
tools=[{"type": "agent_toolset_20260401"}],
)
What the agent does with it
The agent uses its existing file tools — no new API to learn:
# Agent writes at the end of a session
cat > /mnt/memory/style.md << 'EOF'
User: prefers bullet points, dislikes long explanations, timezone UTC-6
EOF
# Agent reads at the start of the next session (different thread)
cat /mnt/memory/style.md
The same store mounts in the next session (new thread, days later). The agent opens /mnt/memory/style.md and already knows.
Every write is versioned
# Every mutation creates an immutable memver_... ID
versions = client.beta.memory_stores.versions.list(store_id)
for v in versions.data:
print(f"{v.id} — {v.created_at} — session {v.session_id}")
# Roll back a bad write
client.beta.memory_stores.restore(store_id, version_id="memver_01XyZ...")
Multi-agent memory sharing
Mount the same store_id in two sessions with read_only on the consumer to share what one agent learned:
resources=[
{"type": "memory_store", "memory_store_id": store_id, "mount": "/mnt/memory", "access": "read_only"},
]
A research agent writes; a summarizer agent reads — no external message bus needed.
Beta header note
Memory store endpoints use agent-memory-2026-07-22 instead of managed-agents-2026-04-01. The updated SDKs set the correct header automatically. If you set beta headers manually, replace managed-agents-2026-04-01 with agent-memory-2026-07-22 on memory store calls — sending both returns a 400.
Sources: Using agent memory — Claude Platform Docs · Built-in memory for Claude Managed Agents — Claude Blog · Anthropic Managed Agents memory: what it changes — Wire Blog