Your personal memory, across sessions, agents, and devices.

Share Memory Between Claude Code and Codex (and Cursor)

memU Team memU Team

If you switch between Claude Code, Codex and Cursor in one repository, you have probably explained the same test command three times. Each host keeps its own memory in its own folder, and none of them loads the others' learned notes. You can share memory between Claude Code and Codex today with one AGENTS.md file, and Cursor reads it too. The imports between hosts run one way only, and a shared file stops short of learned memory. Every host fact below was checked against vendor docs in November 2026.

What is shared memory across coding agents, in one sentence?

Shared memory across coding agents is project knowledge that every host reads at session start, so a fact taught in one tool is known in the next.

That knowledge comes in two kinds. Instructions are files you write and commit, like CLAUDE.md or AGENTS.md. Learned memory is what an agent writes for itself from your corrections. Instructions are easy to share across hosts now. Learned memory stays in each host's own folder.

How do Claude Code, Codex and Cursor store memory?

Claude Code Codex Cursor
Instruction file you write CLAUDE.md (user, project, local), or AGENTS.md when no CLAUDE.md exists AGENTS.md (global in ~/.codex, then one per directory) Project Rules in .cursor/rules, User Rules, Team Rules, AGENTS.md
Learned memory Auto memory, on by default in local sessions Off by default. When on, fresh profiles use v2 IDE Memories removed in 2.1. Automations keep per-automation memory
Where learned memory lives ~/.claude/projects/(project)/memory, one folder per repo ~/.codex/memories or memories_v2 A per-automation store outside the agent's working files. Cursor does not document a path
What loads at session start CLAUDE.md files in and above the working directory, plus the first 200 lines or 25KB of MEMORY.md The AGENTS.md chain up to 32 KiB, plus the memory summary when memories are on Always-applied rules and AGENTS.md. Other rules load when they match
Reads the other hosts' files AGENTS.md by default since v2.1.277 AGENTS.md only. CLAUDE.md if you add it as a fallback name AGENTS.md. The CLI also reads CLAUDE.md

Claude Code source: Anthropic's memory docs. Codex: OpenAI's Memories page plus the AGENTS.md guide. Cursor: the Rules docs plus the Automations docs.

What does each host load when a session starts?

Claude Code loads every CLAUDE.md and CLAUDE.local.md from your working directory up to the filesystem root. Files in subdirectories load later, when Claude touches a file there. Auto memory adds the first 200 lines or 25KB of its MEMORY.md index, whichever comes first. Topic files stay on disk until Claude decides to read one. Anthropic's docs also say auto memory is machine-local and "not shared across machines or cloud environments."

Codex walks from the project root down to your working directory. In each folder it takes at most one file: AGENTS.override.md, then AGENTS.md, then any fallback names you configured. It stops adding files once the combined size reaches 32 KiB, the default for project_doc_max_bytes. Memories are separate and off until you turn them on. They live in the Codex home folder on that machine, and the Delete Codex memories button resets the store for one machine. OpenAI calls the files "generated state" and says not to rely on hand edits as your main control. We covered the v2 pipeline in detail in Codex memory v2. The short version is one summary file under 10,000 bytes.

Cursor puts applied rules "at the start of the model context." Always Apply rules come in every chat. Rules set to Apply Intelligently load when the agent judges their description relevant, and file-scoped rules load on matching files. When rules conflict, Team Rules win over Project Rules, and Project Rules win over User Rules.

Cursor's learned memory has changed the most. A Cursor staff member wrote on the forum in November 2025 that Memories was "intentionally removed starting from version 2.1.x." The suggested exit was the Export memories command, which saves them to an .mdc file you can move into Rules. The old docs URL for memories now opens the Rules page. The memory that remains arrived with Automations in March 2026. Per the Automations docs, it holds notes "across runs for the same automation."

How do you share one instruction file across all three hosts?

Make AGENTS.md the source of truth, because all three hosts read it.

Claude Code

Claude Code reads AGENTS.md on its own since v2.1.277. It does so only when your working directory and the folders above it have no project CLAUDE.md or CLAUDE.local.md. Your personal ~/.claude/CLAUDE.md does not count, and it keeps loading alongside AGENTS.md. To load both project files, set Project instructions to claude-md-and-agents-md in /config. The other option is a CLAUDE.md that imports the shared file and adds Claude-only notes below it:

@AGENTS.md

## Claude Code
Use plan mode for changes under src/billing/.

A symlink also works if you have nothing Claude-specific to add: ln -s AGENTS.md CLAUDE.md. Anthropic lists two catches. Claude's edit tools will not write through the link, so Claude edits AGENTS.md directly. On Windows, Git checks a committed symlink out as a plain text file unless core.symlinks is on. That clone gets a one-line CLAUDE.md. Anthropic's advice is to use the import if anyone works on Windows.

Codex

Codex reads AGENTS.md by default. It ignores CLAUDE.md unless you list it in project_doc_fallback_filenames in config.toml. That helps a repo that already has a CLAUDE.md and no AGENTS.md. In a folder that has both files, AGENTS.md wins.

Cursor

Cursor reads AGENTS.md in the project root and in subdirectories, and nested files combine with their parents. Its CLI docs say it "also reads AGENTS.md and CLAUDE.md at the project root." Keep path-scoped or always-on Cursor rules in .cursor/rules as .mdc files. A plain .md file in that folder is ignored.

Claude Code does not read AGENTS.override.md. An override file that Codex picks up first will not reach Claude.

Can you import memory from one host into another?

Yes, in one direction at a time.

OpenAI's import guide lets the Codex desktop app import from Claude Code, Claude Cowork or Cursor. The CLI command /import covers Claude Code and Cursor. Instruction files become AGENTS.md. Project memories come across from Claude Code only. The guide says the import leaves your existing setup unchanged. The desktop app can also turn on automatic updates to keep imported work in sync with the original agent. Nothing goes back the other way.

Claude Code has its own import. Anthropic's docs say it appends "a one-time copy" of instruction files such as AGENTS.md to the matching CLAUDE.md. It also carries over MCP servers, commands, subagents and skills. Running /init also reads Cursor rules from .cursor/rules or .cursorrules. Neither path mentions Codex memories.

Claude Code's auto memory can flow into Codex. Codex memories have no documented path into Claude Code or Cursor, and Cursor exports its old memories to rules only.

Where does a shared AGENTS.md break down?

A shared AGENTS.md carries what you wrote down. Claude's auto memory is about corrections and preferences, and it skips anything already in your CLAUDE.md. Codex memories summarize past sessions. Those are exactly the facts you never wrote down, and each one stays in its own host's folder.

Imports drift. Claude Code's import is a one-time copy. After it, an edit to AGENTS.md does not update the copy appended to CLAUDE.md. Codex's import stays in sync only in the desktop app, and only toward Codex. A fix you make in Codex after an import never reaches Claude Code.

Precedence differs by host. Claude Code drops AGENTS.md the moment a CLAUDE.local.md appears, unless you change the setting. Codex reads one file per folder and stops at 32 KiB. Cursor merges all applicable rules and lets Team Rules win.

Size limits differ too. Codex stops reading at 32 KiB, so a long shared file can lose its last sections there. Anthropic suggests keeping each CLAUDE.md under 200 lines, and Cursor suggests rules under 500 lines. Both are suggestions.

The bottom line

Put team rules in one AGENTS.md at the repo root. Add a CLAUDE.md that imports it if anyone needs Claude-only notes, and skip the symlink if anyone uses Windows. Treat each host's learned memory as local to that host. Move any fact you rely on into AGENTS.md, where every tool and every teammate can see it.

How do you share what one coding agent learned with the others?

Say Claude Code learns on Monday that your integration tests need a local Redis. It saves that to auto memory under ~/.claude/projects. On Tuesday you open Codex. If you ran the import, Codex has a copy. Correct the fact in Codex on Wednesday, and Claude Code never hears about it. Cursor never knew in the first place.

Built-in memory memU
Who reads it Each host reads its own store. Claude Code memories can be imported into Codex, one way One memory backend shared by every supported host: what one host learned, another retrieves
How it reaches the session Each host injects its own capped file: 200 lines or 25KB of Claude's index, one Codex summary under 10,000 bytes A standing instruction in CLAUDE.md (Claude Code) or AGENTS.md (Codex, Cursor) tells the agent to retrieve the relevant memory before answering
Fixing a wrong memory Claude Code memory is Markdown you can edit. OpenAI says not to rely on hand edits for Codex memory Readable Markdown you open and fix
Devices Claude Code memory is machine-local, and Codex keeps one store per machine Hosted on memu.so, free and synced across devices

If you only use Claude Code, auto memory is enough: it is on by default and you can read every file. Codex has its own built-in memory once you turn memories on. If your team mainly needs shared rules, the AGENTS.md setup above costs nothing and covers it. memU is for the case where you switch hosts or machines and want what one agent learned to show up in the next.

To try the hosted version, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

Support varies by OS and mode. The matrix lists Cursor on macOS and Windows. The self-hosted setup and the full support matrix are in the memU GitHub repository. The design reasoning is in memU gives memory back to the agent.

FAQ

Does Claude Code read AGENTS.md?

Yes, since Claude Code v2.1.277. By default it reads AGENTS.md only when no project CLAUDE.md or CLAUDE.local.md exists in your working directory or above it. Your user-level CLAUDE.md does not block it. Set Project instructions to claude-md-and-agents-md to load both.

It works on macOS and Linux if you have no Claude-only instructions. If anyone clones the repo on Windows, Anthropic recommends an @AGENTS.md import inside CLAUDE.md. Git on Windows may check the link out as a plain text file.

Can Codex read CLAUDE.md?

Not by default. Add CLAUDE.md to project_doc_fallback_filenames in config.toml and Codex will read it in folders that have no AGENTS.md.

Does Cursor still have Memories?

Not in the IDE. Cursor staff said the Memories feature was removed starting with version 2.1.x and pointed users to export them into Rules. Cursor Automations keep their own memory files, one store per automation.

Can I sync Claude Code auto memory with Codex memories?

Only one way. The Codex import copies Claude Code project memories into Codex, and the desktop app offers automatic updates for imported work. There is no documented path from Codex memories back into Claude Code.