hopsesh guide · Claude Code and Codex
How to continue a Claude Code session in Codex (and back)
Why switching agents is a conversion, not a copy: the handoff note, Codex’s own importer, what is always lost, and a round trip that keeps the original session intact.
What each agent stores
Claude Code writes each session to ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is named after the directory the session ran in (CLAUDE_CONFIG_DIR moves the whole tree). Its tool calls name Claude Code’s own tools, such as Bash, Read, Edit and Write. Its reasoning is kept as thinking blocks, signed for the account that made them. Its project instructions are in CLAUDE.md.
Codex keeps its state under CODEX_HOME (~/.codex by default) and writes each session as a rollout file, ~/.codex/sessions/YYYY/MM/DD/rollout-<time>-<id>.jsonl, filed by date with the working directory recorded inside. Its tool calls name Codex’s tools, such as shell and apply_patch. Its reasoning is stored encrypted. Its project instructions are in AGENTS.md.
Both are JSON Lines, one record per line, appended as the session goes. That is where the resemblance ends.
Why you can’t copy a Claude Code session into Codex
Renaming a Claude Code .jsonl and dropping it into ~/.codex/sessions gives Codex nothing it can read. Even a careful conversion runs into four things:
- The tools are different. A Claude Code session is full of
EditandReadcalls with their results. Codex has no tools by those names, so it can’t take those calls as its own. Converted, they become a record of what the other agent did, as text. - The reasoning is private to its vendor. Claude Code’s thinking blocks are signed for Anthropic; Codex’s reasoning is encrypted for OpenAI. Neither model can be handed the other’s, so reasoning is always left out.
- The instructions differ. Codex reads
AGENTS.md. Claude Code readsCLAUDE.md, and since 2.1.277 anAGENTS.mdonly where there is noCLAUDE.md. Whatever only the first agent read, the second has never seen. - The context windows differ. A long session may not fit the other model as it is, so the oldest steps have to be shortened or summarised.
So the useful question is how much survives the conversion, and whether you can see that before you start.
Continue a Claude Code session in Codex with a handoff note
The simplest way needs no tools, and it works between any two agents:
- Ask Claude Code to write a handoff note to a file: the goal, what is done, what is left, the decisions made and why, and anything that failed.
- Commit your work, so the code and the note are on disk where Codex will look.
- Start Codex in the same repository (
codex), and tell it to read the note and continue.
What you lose is the conversation itself: Codex knows only what the note says, and nothing of the exchanges that led there.
Codex’s own /import
Codex can import from Claude Code itself. In a local Codex CLI session, type /import, choose Claude Code, and pick the setup, project files and recent chats you want. The CLI imports up to 50 chats from the last 30 days. The ChatGPT desktop app has the same under Settings › Import, and can keep imported work in sync. Importing doesn’t change your Claude Code setup.
Its limits, from OpenAI’s documentation and its design:
/importisn’t available while a task is running, in a remote session, or while connected to the local app-server daemon.- It reads the Claude Code data on the computer it runs on. A session on your other computer has to be brought over first.
- It goes one way, into Codex. Going back is covered in how to continue a Codex session in Claude Code.
- Review what it imported before you rely on it, especially tool permissions, hooks and MCP servers.
What doesn’t carry over, whichever way you do it
- Reasoning. Claude Code’s thinking and Codex’s encrypted reasoning stay with their own vendor.
- Tool calls as calls. The other agent sees what was run and what came back, as history, not as calls it made itself.
- Long outputs and old steps, when the history is too long for the other model.
- Instructions only one agent read, unless you bring them along.
- Anything not in the repository on disk. On one computer the code is already there; across two, it has to follow.
Continue it in Codex with hopsesh, on this computer or another
hopsesh is a free, open-source command-line tool, terminal UI and app for macOS and Windows that moves coding-agent sessions between your machines and between agents.
hopsesh plan studio:"fix flaky tests" --in codex # see what carries over, change nothing
hopsesh pull studio:"fix flaky tests" --in codex # then do it
Leave out the machine name (hopsesh pull "fix flaky tests" --in codex) to take the newest copy of the session, wherever it is: here, or on one of your other computers over SSH. In the app, choose Move › Continue with Codex… on the session, with the same plan as a sheet.
The conversation arrives as a Codex session, in one of these forms:
- history, the default: the conversation as text, with tool activity labelled as the previous agent’s, long outputs shortened and the oldest steps summarised when the history is long;
- note (
--fidelity note): only a briefing; - native replay (
--native, experimental): exact shell calls replayed as Codex’s own, where it can; - Codex’s importer (
--via import): Codex converts the session itself, and hopsesh adds its briefing and keeps the result undoable.
The loss report and the briefing
Every plan shows a loss report before anything is written: what was kept, what was shortened or summarised, which paths were mapped for this machine, and what was left out.

Codex also gets a briefing at the end of the history: where the session came from, that the tool names in it aren’t its own, what to verify first (git status, and the commit at the time of the transfer), the open plan, and the instruction files only Claude Code read. --note-file adds a note of your own, and --carry-rules adds your instructions for every project. Nothing is sent to a model until you start the session; --go starts it with “Continue.”
Back to Claude Code, with the original intact
Work on it in Codex, then bring it back with hopsesh pull <id> --in claude: hopsesh adds only the new work to the original Claude Code session, whose earlier turns, signed reasoning included, stay byte for byte. 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.
The copy left behind keeps its title and, by default, refuses new prompts until you bring the session back. Across computers, hopsesh finds or clones the repository, recreates the worktree and brings the code to the session’s commit first. hopsesh undo reverses the move on every machine it touched.
If you’d rather ask than type, hopsesh skill install teaches Claude Code and Codex to use hopsesh: say “continue this in Codex”, and the agent plans first and moves only after you say yes.
hopsesh has no server and no telemetry, and never calls the Anthropic or OpenAI API. It is alpha software, and an independent project, not affiliated with Anthropic or OpenAI. More: move a Claude Code session to another computer and resume a Codex session on another machine.
Switching from Claude Code to Codex
Can Codex resume a Claude Code session?
Not as it is. The two agents store sessions in different formats with different tools, so a Claude Code session has to be converted first. Codex’s own /import does that on the same computer, and hopsesh does it on one computer or across two, in either direction.
How do I import Claude Code chats into Codex?
In a local Codex CLI session, type /import, choose Claude Code and pick the setup, project files and recent chats you want. The CLI imports up to 50 chats from the last 30 days. In the ChatGPT desktop app it is under Settings › Import.
Can I move a Codex session back into Claude Code?
Not with /import, which only goes into Codex, and Claude Code’s documentation describes no importer for Codex sessions. hopsesh continues a Codex session in Claude Code with --in claude, and when the session started in Claude Code, it adds only the new work to the original.
Does Claude’s reasoning carry over to Codex?
No. Claude Code’s thinking blocks are signed for Anthropic and Codex’s reasoning is stored encrypted for OpenAI, so neither can be handed to the other model. The conversation, the tool activity as text and a briefing carry over; hopsesh’s loss report shows exactly what was left out.
Can I continue a Claude Code session from another computer in Codex?
Yes, with hopsesh: hopsesh pull <machine>:<session> --in codex brings it over SSH, finds or clones the repository, brings the code to the session’s commit and writes it as a Codex session here. Codex’s own importer only sees sessions on the computer it runs on.
What should I tell Codex when it takes over?
Where the session came from, what is done and what is left, and what to check first: git status and the commit it was at. hopsesh writes that briefing for you, with the open plan and any instruction files only Claude Code read, and adds your own note with --note-file.
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 →brew install roeehrl/tap/hopsesh Without Homebrew: curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh, which checks the download against the release’s checksums and signature.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
- With Homebrew the same app, from the roeehrl tap
brew install --cask roeehrl/tap/hopsesh-app
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 with Scoop from the roeehrl bucket, without the app
scoop bucket add roeehrl https://github.com/roeehrl/scoop-bucket; scoop install hopsesh - Command line only in PowerShell, without the app
irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex