How do I switch from Codex to Claude Code without losing context?
Open Claude Code in the same project folder. Recent versions read the AGENTS.md
Codex already uses, so your rules come along with no new file. The task does not: before you leave
Codex, check the diff, type /export session.md, and write a five-line note for Claude
Code's first message. If you use BuildGist, choose Continue on the card that
appears when you start the new Claude Code session, and the task's context goes with you.
BuildGist is a Mac app for Claude Code, Cursor and Codex. Download for Mac.
What carries over and what does not
- The code. Everything Codex changed is in the folder, committed or not. Claude Code reads it there.
- The rules. Claude Code reads
AGENTS.mdwhen there is noCLAUDE.mdorCLAUDE.local.mdin the working directory or above it. Anthropic's memory page says that needs Claude Code v2.1.277 or later. - The conversation. It stays in Codex. Claude Code has no documented way to open a Codex session, so what you asked for, what is finished and what you ruled out has to be carried by you, or by Continue.
1. Read what Codex changed
git status
git diff --stat
In Codex, /diff shows the same changes and includes files Git is not tracking yet.
Read them before you switch. A half-finished edit is easier to explain while the chat that made it
is still open. The order to read in is in
how to review what Codex changed.
2. Save the Codex chat
Wait for the current turn to finish, then type:
/export session.md
Codex writes the whole conversation as Markdown. You will rarely paste all of it into Claude
Code, since a long transcript fills the new session's context. Keep it so you can copy one error
message or one decision when you need it. codex resume also reopens the chat later in
Codex itself.
3. Make Claude Code read the same rules
If the project has only AGENTS.md, there is nothing to do. If it also has a
CLAUDE.md, Claude Code reads that file instead, so add this line to the top of
CLAUDE.md:
@AGENTS.md
Claude Code expands the import, and both agents now follow one set of rules. Type
/memory in Claude Code to see which instruction files it loaded.
4. Write the note
Task: (what you asked Codex for, in one line)
Done: (what is finished; the diff has the details)
Not done: (what is left)
Ruled out: (what failed, and why)
Next step: (the one thing to do first)
Codex did the work so far. Read the diff before you edit.
Check each line against git diff --stat. If the note calls something done and the
diff does not show it, fix the note first.
5. Start Claude Code
cd your-project
claude
Paste the note as the first message and ask Claude Code to say the next step back before it edits anything. If it reads the plan back wrong, correct it now, while nothing has changed.
Or choose Continue
When you start a new chat in Claude Code in the same project, a BuildGist card at the bottom right of your screen offers the task Codex was working on, if it was active in the last 12 hours. Choose Continue and the new session starts with that task's context, or Start fresh and nothing is handed over. Claude Code takes the context on a new session, not one you are in the middle of. The context is your own words, what you asked for and the constraints you typed, plus, when the files are as that run left them, how many files changed, whether a test failed and up to three paths. It does not include the patch. The reverse trip is in how to switch from Claude Code to Codex.
Questions
Does Claude Code read AGENTS.md?
Yes, from v2.1.277, when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. With a CLAUDE.md present, it reads CLAUDE.md, so put @AGENTS.md on its first line.
Can Claude Code open a Codex session?
Not directly. Export the Codex chat with /export session.md and give Claude Code the parts it needs, or a short note. BuildGist's Continue carries the task's context for you.
Can I keep using Codex on the same project?
Yes. Both read the same folder. If they work at the same time, give each its own branch or git worktree so they do not edit the same files.
Sources
- Claude Code memory and AGENTS.md, checked October 25, 2026.
- Codex developer commands (/diff, /export, resume), checked October 25, 2026.
What you need
- A Mac with Apple silicon and macOS 12 or later.
- Claude Code, Cursor or Codex.
- A Git project. No commit, push, remote or GitHub repository is needed.
- A GitHub account, to sign in. BuildGist does not access your GitHub repositories.
Codex needs you to approve BuildGist once, in Codex. BuildGist shows the steps. Setup is in Getting started.
To explain a run, your computer sends BuildGist what that run needs, and BuildGist passes it to Anthropic. BuildGist does not keep this material. It does not send your whole repository, files the run did not change, or files named like secrets, such as .env files and keys. It keeps the explanation and short cited excerpts of changed code, at most 12 lines each. Secret masking is best-effort. Privacy has the full list.
Every account gets 7 days of BuildGist Pro free, with no card. The 7 days start at your first explanation or Continue handoff. Nobody is charged when the trial ends. After that, BuildGist Pro is $12 per month, plus any applicable tax shown at checkout. See pricing.
Try BuildGist Download for Mac
Apple silicon, macOS 12 or later. United States, 18 or older.
Related
- What did Claude Code change?
- Switch from Claude Code to Codex
- Understand code an agent wrote
- Hand off Claude Code to Cursor
- Review what Codex changed
- You’ve hit your session limit in Claude Code
- You’ve hit your usage limit in Codex
- Keep context across agents
- Review AI code before merging
- BuildGist or the git diff
- Claude Code session history
- Undo Claude Code changes
- BuildGist vs CLAUDE.md, AGENTS.md and HANDOFF.md
- Keep context from Claude Code to Cursor
- Resume an agent session in another tool
- BuildGist vs Conductor
- Codex context window full
- Undo Codex changes
- Cursor usage limit reached
- Review Cursor agent changes
- Codex session history location
- Your conversation is too long in Cursor
- One default coding agent, or two?
- Tools that summarize agent sessions
- Move from Cursor to Claude Code
- Switch from GitHub Copilot to Claude Code
- Move from Windsurf to Cursor
- Switch from Gemini CLI to Claude Code
- Coding agent crashed mid-task
- Claude Code lost context after compacting
- What commands did the agent run?
- Turn an agent session into a PR description
- Which coding agents read AGENTS.md?
Questions: kayvanandre@gmail.com.