hopsesh guide · Codex and Claude Code
How to continue a Codex session in Claude Code (and back)
No importer goes this way. The handoff note and the exported transcript, what survives the switch, and how to come back to Codex with only the new turns added.
Why there is no official way from Codex to Claude Code
OpenAI’s import flow goes one direction. In a local Codex CLI session, /import brings setup, project files and up to 50 recent chats from Claude Code or Cursor into Codex; the ChatGPT desktop app does the same under Settings › Import. Nothing in it writes a Claude Code session.
On the other side, Claude Code resumes sessions from its own transcripts, ~/.claude/projects/<project>/<session-id>.jsonl, or from a cloud session with --teleport. Its documentation describes no importer for other agents’ sessions.
And a Codex session can’t simply be dropped in. It is a rollout under ~/.codex/sessions/YYYY/MM/DD/, with Codex’s own record shapes, tool calls to Codex’s tools (shell, apply_patch) and reasoning stored encrypted for OpenAI. Claude Code has no tools by those names and no way to read that reasoning. Continuing in Claude Code is always a conversion.
What survives the switch, and what can’t
- The conversation: your prompts and Codex’s answers carry over as text.
- Tool activity: what Codex ran and what came back, as history. Claude Code sees it as something the previous agent did, not as calls of its own.
- Reasoning: never. Codex’s encrypted reasoning stays with OpenAI.
- Long outputs and old steps: shortened or summarised when the history is too long for the other model.
- Instructions: Codex reads
AGENTS.md. Claude Code readsCLAUDE.md, and since 2.1.277 reads anAGENTS.mditself where there’s noCLAUDE.md. Instructions only Codex read, such as your~/.codex/AGENTS.md, don’t come along unless you bring them. - The code: the session is the conversation, not the files. On one computer they’re already there; across two, they have to follow.
Continue a Codex session in Claude Code by hand
With a handoff note
-
In the Codex session, ask for a handoff note in a file such as
HANDOFF.md: the goal, what is done, what is left, decisions and why, commands that failed, and what to check first. -
Commit your work, so Claude Code sees the same code.
-
Start Claude Code in the repository and point it at the note:
cd ~/git/app claude "Read HANDOFF.md and continue from there. Check git status first."
It works between any two agents and in any direction. What you lose is everything that isn’t in the note.
With the exported transcript
Codex’s /export saves a complete transcript to a file or copies it to the clipboard. Save it inside the repository and ask Claude Code to read it:
claude "Read codex-transcript.md: it's a Codex session on this repository. Summarise where it stopped, then continue."
This keeps more of the conversation, at a cost: a long transcript fills Claude’s context fast, the tool calls in it read as a document rather than history, and a transcript can hold tokens or passwords a tool printed. Read it before you hand it over, and don’t commit it.
Across two computers
Both ways work on one computer. If the Codex session is on another one, bring it over first, as in how to resume a Codex session on another machine, or write the note there and push it with the code.
Continue it in Claude Code with hopsesh
hopsesh is a free, open-source command-line tool, terminal UI and app for macOS and Windows that converts a session into the other agent’s own format, so it opens with claude --resume like any Claude Code session.
hopsesh ls --agent codex # Codex sessions here and on your other computers
hopsesh plan "fix flaky tests" --in claude # what carries over; changes nothing
hopsesh pull "fix flaky tests" --in claude # continue it in Claude Code here
hopsesh pull studio:codex/7f3c2a1e --in claude --clone # one from another computer
Leave out the computer name to take the newest copy wherever it is. In the app, choose Move › Continue with Claude Code… on the session.
Before anything is written, the plan shows a loss report: how many messages and tool calls carried over, what was shortened or summarised, which paths were mapped for this computer, and how much reasoning was left out. Claude Code also gets a briefing at the end of the history: where the session came from, that the tool names in it are Codex’s, what to verify first (git status and the commit at the time of the transfer), the open plan, and the instruction files only Codex read. --note-file adds your own note, --carry-rules adds your instructions for every project, and --fidelity note brings the briefing alone. Nothing is sent to a model until you start the session; --go starts it with “Continue.”
From another computer, hopsesh finds the repository here or clones it, recreates the worktree, brings the code to the session’s commit and rewrites the paths, then writes the Claude Code session under the folder name Claude Code expects.
The round trip: back to Codex with the original intact
Work in Claude Code for a while, then go back:
hopsesh pull 7f3c2a1e --in codex
hopsesh adds only the new turns to the original Codex session. Everything Codex wrote before, its encrypted reasoning included, stays as it was, byte for byte, so Codex picks up its own history plus what happened in Claude Code. If both copies changed in the meantime, hopsesh stops and asks; --keep-both brings the new work in as a separate session. It never merges.
While the session is away, the Codex original keeps its title and, by default, refuses new prompts until it comes back, so the two never drift apart. Codex asks you once to approve hopsesh’s hook for that (/hooks), and hopsesh says when it is waiting. Settings can make it warn instead, and hopsesh unblock lifts it for one session. A small file beside the session records its copies and hops, so the next move works from any of your computers. hopsesh undo reverses any step.
The other direction, Claude Code into Codex, is in how to continue a Claude Code session in Codex (and back).
If you’d rather ask than type, hopsesh skill install teaches Claude Code and Codex to use hopsesh: ask Codex to “continue this in Claude Code”, and it plans first and moves only after you say yes.
hopsesh has no server and no telemetry, and it never calls the OpenAI or Anthropic API: only your agents talk to their models. It is alpha software, and an independent project, not affiliated with OpenAI or Anthropic.
Switching from Codex to Claude Code
Can Claude Code import a Codex session?
Not on its own: Claude Code resumes its own transcripts and cloud sessions, and its documentation describes no importer for Codex sessions. Codex’s /import goes the other way, from Claude Code or Cursor into Codex. hopsesh converts a Codex session into a Claude Code one with --in claude.
How do I continue a Codex session in Claude Code by hand?
Ask Codex to write a handoff note to a file (goal, done, left, decisions, what to check first), commit your work, and start Claude Code in the repository with “Read HANDOFF.md and continue.” Codex’s /export gives a full transcript if you need more, at the cost of context.
Does Claude Code read AGENTS.md?
Since Claude Code 2.1.277 it reads a repository’s AGENTS.md when there is no CLAUDE.md in the working directory or above it. With a CLAUDE.md, import AGENTS.md from it. Instructions only Codex read, such as ~/.codex/AGENTS.md, don’t come along on their own.
Does Codex’s reasoning carry over to Claude Code?
No. Codex stores its reasoning encrypted for OpenAI, so it can’t be handed to Claude. The conversation and the tool activity carry over as text, with a briefing. hopsesh’s loss report shows how much reasoning was left out before anything is written.
If I go back to Codex, is the original session changed?
With hopsesh, only new turns are added to it. Everything Codex wrote before, its encrypted reasoning included, stays byte for byte. If the original changed in the meantime too, hopsesh stops and asks instead of merging; --keep-both brings the new work in as a separate session.
Use the method
Try it with hopsesh
Open-source CLI and desktop app: move a Claude Code or Codex session to another computer, into the other agent, or to the cloud, with undo built in.
See everything hopsesh does →curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh Checks the download against the release’s checksums.txt and its signature. hopsesh update installs later releases with the same checks.irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex Same checks as the macOS and Linux script. The Windows app installs this command as well.More ways to install
- Installer for Arm64 Windows 10 or 11 on Arm
- Portable .zip x64 or Arm64, no install, on the release page
- Command line only in PowerShell, without the app
irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex