Shared memory for AI coding agents
How to give Claude Code, Codex and Cursor one shared, persistent memory: instruction files in git, MCP memory servers, or a hosted team memory like axs brain.
Claude Code, Codex and Cursor each start every session with an empty context, and each keeps its own notes in its own
format. To share memory across them you need one source all three read: a common instruction file such as
AGENTS.md in your repo, or a memory service the agents reach over MCP and hooks, so a lesson saved in one tool shows
up in the next session of any other.
The problem
Each agent has its own memory files:
| Agent | Where its instructions live |
|---|---|
| Claude Code | CLAUDE.md at user, project and local level, .claude/rules/, and auto memory in ~/.claude/projects/<project>/memory/ |
| Codex | AGENTS.md in ~/.codex and in each directory from the project root down (Codex docs) |
| Cursor | .mdc files in .cursor/rules, AGENTS.md, User Rules and Team Rules (Cursor docs) |
That leads to three common failures:
- Drift. You fix a rule in
CLAUDE.md, and Cursor keeps the old one in.cursor/rules. - Lost lessons. You correct the agent in chat ("we deploy with
make release") and the correction lives only in that chat, or in one tool's private notes. Claude Code's auto memory is machine-local: it is not shared across machines or with your team. - Knowledge that is not about one repo. Servers, accounts, deploy steps and "how I like to work" do not belong in any single repository, so there is no obvious file for them.
The options people use today
1. One instruction file in git
Write the shared rules once in AGENTS.md at the repo root. AGENTS.md is an open format in
plain Markdown, read by Codex, Cursor and many other agents. Claude Code
reads AGENTS.md when the repo has no CLAUDE.md, or you add a
CLAUDE.md that holds @AGENTS.md as an import.
Good: free, reviewed in pull requests, versioned with the code. Limits: you write and update it by hand, it covers one repo, and lessons from chat only land there if someone edits the file. See CLAUDE.md vs AGENTS.md for the details per tool.
2. Per tool memory features
Claude Code's auto memory saves corrections on its own. Cursor has User Rules and, on its Team and Enterprise plans, Team Rules set in the Cursor dashboard. These work well inside one tool. They do not reach the other agents.
3. An MCP memory server
The Model Context Protocol lets any MCP client call tools such as "search memory" and "save memory". Claude Code, Codex and Cursor all support MCP servers, so one server can serve all three. The catch: over MCP alone the agent has to decide to call the tool, and agents rarely search for what they do not know they are missing. You also host the server, handle access for your team, and keep it running.
4. A hosted memory with hooks
A service that combines MCP tools with the agents' hooks can push memories into the session instead of waiting for the agent to ask. This is the approach of axs brain.
When plain files are enough
If you work alone, mostly in one repo, and your rules change rarely, an AGENTS.md in git (plus a CLAUDE.md that
imports it) is enough. It costs nothing and every agent reads it. Add a service only when you notice lessons getting
lost, rules drifting between tools, or teammates repeating the same corrections.
Where axs brain fits
axs brain is one memory for Claude Code, Codex, Cursor and other MCP clients:
- Memories come to the agent. Hooks add your always-on rules at session start, the memories of a project on the first work there, and matching memories on every prompt.
- Lessons are saved while you work. When you correct the agent, axs brain asks it to save the lesson as a short memory. It checks for near-duplicates and refuses memories with secrets.
- Not tied to a repo. A memory has a scope:
global, or what it is about, such asproject:billing-apiorhost:web-1. See Memories and spaces. - Rules that hold. Rules run in the hooks and can block a command, ask first or remind, so the agent cannot skip them.
- Shared with the team. Private and team spaces control who reads and writes what.
Your existing CLAUDE.md, AGENTS.md and Cursor rules can be imported, one memory per rule
or fact. Your files stay as they are.
Clients without hooks, such as claude.ai, connect over MCP only: they can search and save memories, but nothing is pushed and blocking rules do not apply.
Setup
Install the axs CLI, then:
axs login
axs install claude
axs install codex
axs install cursorEach agent gets its own device token. Codex asks you to trust the new hooks with /hooks, and Cursor asks you to sign in to
axs brain under Customize in the sidebar. Details are on
Connect your agents.
Plans are €12 a month for Personal and €20 per person a month for Team, both with a 14 day free trial and every feature. See Plans and billing.
FAQ
Can Claude Code, Codex and Cursor share one memory file?
Yes, with AGENTS.md. Codex and Cursor read it directly, and Claude Code reads it when there is no CLAUDE.md, or
through an @AGENTS.md import in CLAUDE.md.
Is Claude Code's auto memory shared with my team?
No. Auto memory is stored in ~/.claude/projects/<project>/memory/ on your machine and is not shared across machines
or cloud environments.
Why not just use an MCP memory server?
You can. The limit is that the agent must decide to call it. Hooks let a memory reach the session before the agent makes the mistake, which an MCP tool alone cannot do.
Does axs brain replace my CLAUDE.md or AGENTS.md?
It does not have to. A short AGENTS.md for build and test steps can stay in the repo, while lessons, knowledge
that spans repos and rules live in axs brain.
Browser on other machines
Let an agent on a dev box, server or VM drive the Chrome of one of your own devices through the axs cred extension, with logins that never leave that device.
Claude Code team memory: CLAUDE.md in git vs MCP
Share Claude Code memory with your team: commit a project CLAUDE.md to git, deploy a managed CLAUDE.md, or add shared memory over MCP and hooks. The tradeoffs.