Claude Code and Codex can share project context when the decisions, constraints, and background live in a place both tools can read before a new task starts, usually a checked-in document or a Markdown project brain, not either tool's private memory store. That is not a mid-task handoff. A file such as HANDOFF.md can describe work in flight; it does not replace a durable project record, and a project brain is not a live transfer of half-done diffs or tool state.
The confusion is common because both jobs show up as “I was in Claude Code, now I want Codex to know what we know.” One of those requests is about durable project memory. The other is about pausing a half-finished session and continuing it somewhere else. They need different artifacts.
Shared project context and a mid-task handoff are different jobs
Project context is the standing picture: what this project is, what has already been decided, what was ruled out, and which constraints still hold. The test is the one in If a fresh session can't see it, it isn't project context yet. Open a session that never had the original conversation, in either tool. If that session cannot recover the current decisions and reasons, you do not yet have project context. You have a chat log, or a private memory store.
A mid-task handoff is narrower and more perishable. It answers: what is this task for, what already works, what is the next step, what is still dirty in the working tree, and which approach should not be tried again today. Guides that recommend a HANDOFF.md are usually solving that problem. The note is a bridge for one piece of in-flight work. It goes stale quickly, and it should not be merged into the always-loaded rules file.
A project brain does not close that second gap. In MindMux, the brain is compiled from discussions into Markdown that agents read before each task. It is cross-session, cross-tool decision memory. It does not hot-switch a running agent, a half-done diff, or one tool's session state into another. If you need to leave a task mid-edit, commit or stage the code and write a short handoff for that task. Do not expect the brain, or AGENTS.md, to reconstruct an uncommitted editor buffer.
MindMux also has its own Tasks and Handoffs model: after a discussion has converged, dispatch a task that inherits the relevant brain pages. That is still “start the next run with the right project memory,” not a live transfer of tool state between Claude Code and Codex.
What each tool already keeps to itself
Claude Code and Codex both have a shared instruction layer and a private recall layer. Official docs for each product draw that line, independently.
Claude Code loads CLAUDE.md or AGENTS.md as instructions you write, and auto memory as notes it writes for itself. Auto memory lives under ~/.claude/projects/<project>/memory/ in the home directory. Anthropic's memory docs call it machine-local: the files are not shared across machines or cloud environments, and they are not a store Codex can read. A fuller map of what a teammate still cannot see is in What does Claude Code remember, and what can the next teammate still not see?.
Codex reads AGENTS.md before it starts work, walking from the project root down to the working directory, and it also has a global file under ~/.codex. OpenAI's AGENTS.md docs say Codex stops adding project instruction files once their combined size reaches project_doc_max_bytes, which is 32 KiB by default. Local Codex memories are a separate store. The Memories page is explicit: ChatGPT web uses ChatGPT memory; local Codex clients use their own files under the Codex home directory, by default ~/.codex, in memories_v2/ or memories/. Those memories are off by default. The same page tells you to keep required team guidance in AGENTS.md or checked-in documentation, and to treat memories as a helpful recall layer, not as the only source for rules that must always apply.
Neither private store is a shared project record. That is the argument in A memory only one agent can see is not project memory yet: a decision written only into ~/.claude or ~/.codex is available to that agent, on that machine. The other tool never sees it.
Session history does not cross the boundary either. Resuming a Claude Code session and resuming a Codex session are features of each product. They are not a handoff protocol.
What both tools can read before a new task
The shared surface is the repository, plus any Cloud Brain or other remote source you have deliberately connected in both clients.
In practice, that surface has three useful parts:
-
A short instruction file both tools load.
AGENTS.mdis the common one. Codex reads it by default. Claude Code reads it directly when there is noCLAUDE.mdorCLAUDE.local.mdin the working directory or above it, or when you import@AGENTS.mdfrom aCLAUDE.mdor set Project instructions to load both. If you maintain two parallel briefs, you are already on the path described in One home per rule. - Checked-in documentation the brief can point at. Architecture notes, constraints, and decision records that do not need to occupy the always-loaded budget.
- A reviewable Markdown project brain, if you want the current conclusion and its trail in one structured place, rather than scattered through the brief and a pile of docs.
The instruction file should stay a brief: how to work in this repo, which commands to run, where the longer record lives. It is not a changelog, and it is not a decision log. Those cases are already covered in AGENTS.md is not a changelog and AGENTS.md is not a decision log.
A single instruction file is not enough on its own
Sharing AGENTS.md is necessary and still incomplete.
Claude Code will skip AGENTS.md under the default setting if a CLAUDE.md or CLAUDE.local.md is present. A team that “already has AGENTS.md” can still have a Claude Code user who never loads it. Confirm in Claude Code with /context all.
The file also has a size budget, especially on the Codex side. If the brief becomes the archive, later instructions fall off the load cap, or every new session pays for history it does not need. Point at the durable record; do not paste it in.
And an instruction file does not accumulate a trail. When a decision changes, a rewritten paragraph can hide the reversal. The next agent may follow the new rule and still not know what was ruled out, or why.
Put durable decisions in one home
If the next session in either tool will need a fact, write that fact once, where both can read it.
- Preferences that only matter in one product can stay in that product's local memory or local instruction file.
- Standing rules belong in the shared brief.
- Decisions, constraints, and project background belong in a reviewable home the brief points at. Update the current answer when the truth changes, and keep a trail of how you got there.
Copying the same decision into CLAUDE.md, AGENTS.md, and both tools' private memories is not sharing. It is four copies that will disagree.
Where a project brain fits, and where it does not
A project brain is the durable, structured memory of a project: root documents for background, architecture, stack, and roadmap, plus pages that keep a current compiled_truth and an append-only timeline. It is meant to be portable, inspectable, and versionable. It is not a transcript dump, and it is not an opaque store only one product can read.
brain.md is the open, repo-local convention for that shape. MindMux is one product implementation. A local Brain lives with the project as ordinary Markdown; a Cloud Brain is the same kind of memory, kept in a Cloud Project you can open in the browser, share, or connect from a coding agent through MCP. The knowledge model does not change with the location. What changes is who can reach it.
Because the brain is Markdown, Claude Code and Codex can be pointed at the same record. The MindMux CLI is @mindmux/cli (mmx, mmx setup); it can connect either agent to a Cloud or local Brain. Related open tooling is @mindmux/brain-md. This is not a mid-task switch: after setup, each new task can start by reading the same compiled background, decisions, and constraints.
Use a brain for facts that should outlive the session you are in. Do not use it as a parking place for an uncommitted patch, a tool's current file handles, or a running test process. Those are the mid-task handoff's problem, or git's.
If you do need to switch tools in the middle of a task, keep the two artifacts distinct:
- Commit or stage the code, and write a short
HANDOFF.md(or equivalent) for the work in flight: goal, done, next, decided, open, branch. - Leave standing decisions in the brain or the checked-in record, and leave standing rules in
AGENTS.md. - When the task finishes, update the durable record if project truth changed. Then delete or ignore the handoff note so it cannot be mistaken for current state. A stale “current state” line will send the next agent the wrong way.
A short test before you switch tools
Before you call the context “shared,” try this in a clean checkout, once in Claude Code and once in Codex, without either tool's private memory to lean on:
- Can the session find the current decisions, constraints, and reasons without the original chat?
- Does Claude Code actually load the shared brief, not only a local
CLAUDE.md? - Is the brief still a brief, or has the decision record been pasted into it?
- If you are in the middle of a task, is the in-flight state in git and in a handoff note, rather than only in the brain or only in one session?
If the first three fail, you have a project-context problem. If only the last fails, you have a handoff problem. Solving one of them with the artifact meant for the other is how the two jobs get confused.
FAQ
Can Codex read Claude Code's auto memory, or the other way around?
No. Claude Code's auto memory stays under ~/.claude/projects/ and is machine-local. Local Codex memories stay under ~/.codex. Official docs for both products point required team guidance at checked-in files, not at those private stores.
Should I put a HANDOFF.md into the project brain?
No. A handoff describes one task in flight and ages quickly. The brain holds standing project truth. If the finished work changes a decision or a constraint, update the relevant brain page after the task, and keep the perishable status note somewhere else.
Is connecting both tools to a Cloud Brain a live session bridge?
No. MCP setup lets each agent read and update the same Cloud Brain. Each task still starts from that memory. It does not move an in-progress Claude Code session into Codex.
Top comments (0)