How to Give Claude Code, Cursor and Codex the Same Context
One AGENTS.md for the repo, one context layer for you, and no more copying instructions between three agents.

You run Claude Code in one terminal, Cursor in the editor and Codex for the jobs it does better, and each one starts its session knowing nothing about what you did in the other two. The fix has two halves: project rules go in one AGENTS.md that all three agents read, and context about you goes in one source outside the repo that every agent queries over MCP.
Skip that, and the same paragraph about your stack ends up in three files, drifting at three different rates.
Do Claude Code, Cursor and Codex share context?
No. Each reads its own instruction files and keeps its own memory, and none reads another's.
| Claude Code | Cursor | Codex | |
|---|---|---|---|
| Instruction files | CLAUDE.md, .claude/rules/; reads AGENTS.md when there's no CLAUDE.md |
.cursor/rules/*.mdc, AGENTS.md, User Rules, Team Rules |
AGENTS.md (global ~/.codex/AGENTS.md + per directory) |
| Built-in memory | Auto memory in ~/.claude/projects/<project>/memory/ |
None since version 2.1 | Local memories in ~/.codex/memories/, off by default |
| Loading and limits | Auto memory: first 200 lines or 25KB per session | Rules apply always, by file pattern, or on request | AGENTS.md chain: 32 KiB by default |
| MCP support | Yes | Yes | Yes |
Sources: Claude Code memory docs, Cursor rules docs, Codex memories and AGENTS.md guide. The legacy single .cursorrules file that older guides mention no longer appears in Cursor's docs; rules now live in .cursor/rules as .mdc files.
Does Cursor remember across conversations?
Not on its own anymore. Cursor removed its Memories feature in version 2.1, in November 2025; a reply on Cursor's official forum confirms the removal was intentional and points users to an "Export memories" command that saves them as a rules file (Cursor forum, 2025). Cursor's docs now describe rules as the persistent layer: "Large language models don't retain memory between completions. Rules provide persistent, reusable context at the prompt level."
The same is true when the context starts somewhere else. Cursor can't read your ChatGPT or Claude conversations, so the architecture you worked out in a chat window doesn't reach the editor unless you move it there or both tools read a shared source.
What does splitting work across three agents cost?
It costs a few minutes per session, plus the errors you only catch later. A worked illustration, not a benchmark: two minutes of re-orientation per session, three tools, four fresh sessions a day comes to 24 minutes a day of telling machines what their neighbors already know.
The re-explaining is the visible part. Two costs hide behind it:
- Drift. You update
CLAUDE.mdbecause that's where you were working;.cursor/rulesstill describes last month's approach. One agent undoes what another built, confidently. - Contamination. On client or multi-project work, context from one job leaks into another's output, and the better the model, the more convincing the wrong answer. More on that in How Freelancers Should Structure AI Context for Client Work.
Both get caught after you've built on them, which is what makes them expensive.
Can one AGENTS.md cover Claude Code, Cursor and Codex?
Yes, for repo rules. Codex and Cursor read AGENTS.md natively, including nested files in subdirectories. Claude Code (v2.1.277 or later) reads AGENTS.md when the repo has no CLAUDE.md; if you want both, import it from CLAUDE.md:
# CLAUDE.md
@AGENTS.md
## Claude Code only
- Use plan mode for changes touching more than three files.
That's one file to edit instead of three, and you're in good company: AGENTS.md is used by more than 60,000 open-source projects and became a founding project of the Linux Foundation's Agentic AI Foundation in December 2025 (Linux Foundation, 2025). Keep it lean. Anthropic's guidance for CLAUDE.md is under 200 lines per file, because longer files cost context and lower adherence, and the same logic holds for AGENTS.md. The file itself is covered in depth in What Is CLAUDE.md?
What about context that isn't about the repo?
That's the half AGENTS.md can't solve. Who you are, how you like to work, which client this is for, and what changed in Tuesday's planning call aren't project rules, and pasting them into every repo's instruction file recreates the drift problem.
People climb a ladder of fixes here:
- Copy-paste or symlinks. Rots the moment one copy changes.
- A sync script or git hook that generates each tool's file from one source. Solves the rot; now you own a pipeline that breaks when a tool changes formats.
- A self-hosted brain like GBrain, Garry Tan's open-source, MCP-native memory on Markdown and Postgres. It's good, and it's developer-operated: you run the CLI, the embeddings and the sync jobs, and the payoff builds over months.
Each step automates the copying. None removes it, because the context still has to be written by you from somewhere.
Doesn't connecting everything over MCP eat your context window?
Less than it used to. The worry is real: every MCP server describes its tools to the model, and wiring a dozen raw servers into every agent can crowd the window. Claude Code now handles this with tool search, on by default, which loads only tool names at session start and fetches full definitions when needed (Claude Code MCP docs). The breakdown for other clients is in The MCP Context Tax.
The bigger point is what you connect. One server that serves a compact, current picture of you is a small surface. Fifteen raw connectors that each agent has to search and reconcile on its own is a large one.
How do you set up one context for all three tools?
Keep project rules in AGENTS.md, and connect all three agents to one personal context layer over MCP.
Unabyss is that layer. It builds your context from the apps where it already lives (Gmail, Google Calendar, Notion, Slack, GitHub, Linear), keeps it current, and serves it to every MCP client from one source:
- Claude Code:
claude mcp add --transport http unabyss https://mcp.unabyss.com/, then sign in from the session. - Cursor: one-click install from Unabyss's connect page.
- Codex: the official Unabyss plugin in the Codex app, the same plugin ChatGPT uses.
Then choose how much gets saved back with Unabyss's global instructions, so a decision you make in Codex is there when Cursor opens.
The case for doing this is in the numbers. In an August 2026 Unabyss benchmark, adding a hand-written CLAUDE.md barely changed cost, time or quality; adding Unabyss cut cost by 36%, time by 38% and follow-ups by 60% (What Structured AI Context Is Worth). If updating how you work still means editing more than one place, you don't have a sync problem. You have a source-of-truth problem.