Using Claude Code, Codex and Cursor on one repo: how to stop re-teaching each one

Published · Updated · Checked against Claude Code 2.1.319

Write your project instructions once in AGENTS.md, and make each tool read that file. Instructions are the part you can share cleanly. Memory and history cannot be shared across these three tools today, because each writes its own format to its own place, and no documented setting changes that.

The docs were current on 10 November 2026. Only the Claude Code half of this setup was run against the real CLI, in a scratch directory; the Codex and Cursor parts rest on their docs.

The three layers

Every tool keeps three different kinds of thing, and they behave differently, so it helps to separate them before deciding what to share.

Instructions are text you write that is loaded at the start of a session. Memory is text the tool writes about you or the project. History is the raw record of past sessions. You can share the first by agreeing on a file. You can only reach the other two by exporting or indexing them.

Claude CodeCodexCursor
InstructionsCLAUDE.md, .claude/rules, and AGENTS.md under a conditionAGENTS.md.cursor/rules/*.mdc, User Rules, Team Rules, AGENTS.md
MemoryAuto memory in ~/.claude/projects/<project>/memory/Opt-in, off by defaultNot in the current docs
HistoryJSONL transcripts under ~/.claude/projects/Rollout JSONL under ~/.codex/sessions/Not covered here

For the history locations see where Claude Code stores sessions, where Codex stores sessions and the guides index.

The part that trips people up

Claude Code does not read AGENTS.md by default if a CLAUDE.md exists. The docs say AGENTS.md support needs v2.1.277 or later, and that by default it is read only when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above. The Hacker News thread "Claude Code now reads AGENTS.md if there is no Claude.md" says the same in its title, and the long-running request anthropics/claude-code#6235 to support AGENTS.md is closed after 6,691 reactions and 409 comments.

A rule like this is easy to misread, so here is a test. On Claude Code 2.1.319 with claude -p --model haiku --no-session-persistence --setting-sources project, each scratch project was asked "What is the release codeword in your project instructions? Reply with the codeword only, or NONE." The AGENTS.md in each said the codeword was PELICAN-7.

The third result is the one that causes silent drift. A repo that already has a CLAUDE.md, and then gains an AGENTS.md for Codex, quietly gives Claude Code the old instructions only.

The shared layer

The Claude Code docs recommend a one-line CLAUDE.md that imports the shared file, plus anything specific to Claude:

@AGENTS.md

## Claude Code

Use plan mode for changes under `src/billing/`.

That is the setup that returned PELICAN-7 above. The docs also offer a symlink, ln -s AGENTS.md CLAUDE.md. The symlink itself was not run through Claude Code. The docs warn that the Edit and Write tools refuse to write through a symlink, and on Windows they prefer the import, because Git checks a symlink out as plain text unless core.symlinks is enabled. The import is the safer choice everywhere.

Codex reads AGENTS.md directly. Its config has project_doc_max_bytes and project_doc_fallback_filenames for tuning that, and the AGENTS.md guide gives project_doc_max_bytes a default of 32 KiB. Cursor's rules page says it supports AGENTS.md in the project root and in subdirectories. Its own .cursor/rules format needs the .mdc extension, and a plain .md file there is ignored.

So one AGENTS.md serves all three, with a two-line CLAUDE.md. Keep tool-specific advice, such as plan mode or a Cursor rule glob, in the tool's own file.

Memory does not travel

Claude Code's auto memory is machine-local and written for Claude. Codex memories are off by default, and the config reference says features.memories is "off by default". The stored files are generated summaries under $CODEX_HOME/memories_v2/ on fresh profiles. The two stores are different formats written by different models, and there is no documented way to point one at the other.

Do not try to merge them. Take anything in memory that is a durable rule, check it, and put it in AGENTS.md by hand. That is the only copy all three tools will read.

Export Cursor memories before they vanish

Cursor changed here, and its official docs no longer carry a memories page: cursor.com/docs/context/memories does not mention memories, and the old docs.cursor.com address redirects to the docs home. What follows comes from forum posts, not docs.

In one forum thread, a forum user named deanrie wrote that the Memories feature was intentionally removed starting from version 2.1.x, and described exporting with the command palette entry "Export memories", which saves an .mdc file. The reporter then confirmed the export worked. A separate thread, custom modes and memories gone in 2.1, has a user reporting memories and custom modes gone in 2.1.20. The forum does not state deanrie's role, so treat these as forum answers, not documentation.

If you have memories you care about, export them now, review them, and move the rules into AGENTS.md. The exported .mdc is plain text, so it is easy to read through.

History across tools

None of the three reads another's transcripts, and Cursor's history is not covered here. A shared place for history is something you build, by indexing the transcripts each tool writes. Sealkeep does this for Claude Code and Codex only; Cursor is not a supported agent. It does not replace AGENTS.md or CLAUDE.md, so the shared instruction file above is still needed.

FAQ

Do I need CLAUDE.md at all if I have AGENTS.md?

Not strictly. Claude Code reads AGENTS.md when no CLAUDE.md or CLAUDE.local.md exists, on v2.1.277 or later. Add a CLAUDE.md with the import once you need something Claude-specific.

Why does Claude Code ignore my AGENTS.md?

Probably because a CLAUDE.md or CLAUDE.local.md exists. In the test above that gave NONE. Add @AGENTS.md to the CLAUDE.md. There is also a setting named "Project instructions" in the docs whose values include claude-md-and-agents-md.

Is there a sync tool for memory across the three?

The vendors do not document one. Treat third-party tools as unproven until you have run them on a copy.