What the tool actually is
The memory tool is one of the tools Anthropic provides in the Claude API. You switch it on with a single entry in the tools list: {"type": "memory_20250818", "name": "memory"}. That is the whole configuration. You do not write an input schema, and the name must be memory.
What makes it different from most memory products is where the memory lives. Anthropic does not store it. The documentation calls the tool client-side: Claude asks for a file operation, your application runs it and sends back the result in a normal tool_result block. The path /memories is only a prefix that your code maps onto real storage, such as a folder per user or rows in a database. A later conversation continues from the same memory when it sends the same tool and your handler serves the same store.
When the tool is present, the API adds a short protocol to the system prompt on its own. It tells Claude to view its memory directory before doing anything else, to record progress as it works, and to assume its context window may be reset at any moment.
The six commands
| Command | What Claude asks for | What your handler does |
|---|---|---|
view |
Show a directory or a file, optionally a line range | List files up to two levels deep, or return the file with line numbers |
create |
Write a new file | Create it (the reference behavior errors if it exists; overwriting is allowed) |
str_replace |
Replace one exact piece of text | Replace it, or report that it was missing or not unique |
insert |
Add text after a given line | Insert it, line 0 means the top of the file |
delete |
Remove a file or directory | Delete it, but never the /memories root |
rename |
Move or rename a file or directory | Move it, and refuse to overwrite an existing destination |
The Python and TypeScript SDKs ship a ready-made local file implementation, BetaLocalFilesystemMemoryTool. Python and C# let you subclass BetaAbstractMemoryTool, TypeScript has betaMemoryTool and Java has BetaMemoryToolHandler, so you can back memory with your own storage. Go, Ruby and PHP have no dedicated helper; you run the tool loop yourself.
How it fits with context editing and compaction
Memory is one half of keeping a long-running agent on track. The other half is removing what no longer belongs in the context window.
- Context editing (beta header
context-management-2025-06-27) clears old tool results once the input passes a threshold you set, by default 100,000 input tokens, keeping the three most recent tool uses unless you change it. - Compaction summarizes the whole conversation on the server when it approaches the window limit.
- Memory keeps what must survive either of those. With context editing switched on, Claude gets an automatic warning when the clearing threshold is near, so it can write important results to memory files first.
Anthropic describes the pattern as just-in-time retrieval: instead of loading everything up front, the agent writes down what it learns and reads it back when the task needs it. For multi-session coding work, the documentation recommends a deliberate setup: a first session that creates a progress log and feature checklist, later sessions that start by reading them, and an update of the log before each session ends. More on the summarizing side in What is context compaction?
The misunderstanding: “Anthropic manages the memory”
Many developers read “memory tool” and expect a managed memory service, like the memory in the Claude app. It is not. Anthropic supplies the interface and the prompting; you supply storage, retention and security. That has consequences:
- Path traversal is your problem. The documentation warns that a path such as
/memories/../../secrets.envcan reach files outside the memory folder, and that your handler must validate every path in every command. - Size and expiry are your problem. Anthropic suggests capping file sizes, limiting how much
viewreturns and deleting files that have not been read for a long time. - Sensitive data is mostly your problem. Claude usually refuses to write sensitive information to memory, but for stronger guarantees you strip it before writing.
- Organization is partly your problem. If Claude creates cluttered files, the documentation suggests adding an instruction to keep the folder coherent and to avoid new files unless needed.
The upside of this design is control: data retention is yours, which is why the tool is eligible for zero data retention.
What this means for a team
The memory tool gives one agent a notebook. Whether two agents, or two colleagues, share that notebook depends entirely on how you map /memories to storage. Map it per user and every person’s agent learns alone. Map it to one shared folder and you have shared memory, but also the questions that come with it: who may overwrite whose notes, how you stop one bad entry from spreading (see What is memory poisoning in AI agents?), and how you see which note an answer relied on. And the memory only exists for agents built on the Claude API with this tool. Your colleagues in ChatGPT, Copilot or Cursor do not see it. For the wider picture, see How can a team share one AI memory?
Where Bombos fits
The memory tool is a good fit for one agent’s working notes. When what an agent learns has to reach the rest of the team and its other AI tools, that is a different layer. Bombos is a plugin that gives Claude, Claude Code, ChatGPT, Copilot, Codex, Cursor, Grok and your own agents one shared memory, with team knowledge, learned rules and what already sits in mail, documents and repos. You can see what each answer rests on, and it runs in our cloud or on your own server. One developer can try it first for their own agents.
Related questions
Where does the Claude memory tool store data?
Wherever you decide. The tool is client-side: Claude requests a file operation and your handler runs it, for example on local files, a database or cloud storage. /memories is only a path prefix that your handler maps onto that storage.
Does the memory tool need a beta header?
No. Per Anthropic's documentation (November 2026), the tool itself does not need a beta header. The SDK helpers and tool runner do live in the SDKs' beta namespace, and context editing still uses the beta header context-management-2025-06-27.
Is the memory tool the same as memory in the Claude app?
No. The memory in claude.ai is a product feature for people using the app. The memory tool is an API building block for developers who build their own agents, and you implement the storage yourself.
Which models support the memory tool?
Anthropic's documentation says it is available on all Claude 4 and later models, and that it is eligible for zero data retention and HIPAA readiness.
