---
title: "Continue a Claude Code session in Codex"
canonical: "https://agentdrive.sh/resume/claude-code-to-codex"
---
# Continue a Claude Code session in Codex

> For the complete documentation index, see [llms.txt](https://agentdrive.sh/llms.txt). Every docs page is also served as markdown at its URL plus `.md`, and the full docs are in one file at [llms-full.txt](https://agentdrive.sh/llms-full.txt).

[Resume across agents](https://agentdrive.sh/resume)

To continue a Claude Code session in Codex, install AgentDrive once with `curl -fsSL agentdrive.sh/install | sh`. After that, the Claude Code plugin syncs each session in the background. Open Codex in the same project and ask it to resume your session, or mention the AgentDrive skill with `$agentdrive`. Codex loads a handoff brief with the goal, the files touched and the recent turns.

## Steps

1. ### Install AgentDrive

   Run `curl -fsSL agentdrive.sh/install | sh`. It signs you in and wires session sync and resume into every agent it finds on this machine, Claude Code and Codex included. In Claude Code you can install the plugin instead: `/plugin marketplace add agentdrive-sh/agentdrive-mcp`, then `/plugin install agentdrive@agentdrive`. Setup approves the AgentDrive hooks in Codex for you. On an older Codex, approve them once via `/hooks`.

   ```
   curl -fsSL agentdrive.sh/install | sh
   ```

2. ### Work in Claude Code as usual

   The AgentDrive plugin hooks `SessionStart`, `Stop`, `SessionEnd` and `PreCompact`, and hands each session to a background sync, so Claude Code never waits on it. The sync uploads the redacted transcript, plus files the agent wrote that git doesn't track, to `sessions/<project>/claude-code/<session>.md` in your workspace. Before you switch, leave a clear goal and next step in the session; the brief carries them over.

3. ### Resume in Codex

   Open Codex in the same project and ask it to resume your session, or mention the AgentDrive skill with `$agentdrive`. It calls `drive_resume`, which loads the latest session in this project from a different agent. If you run several agents, ask for the session from Claude Code by name, or list sessions with a plain request such as "list my AgentDrive sessions" and pass an id.

   ```
   $agentdrive resume my last AgentDrive session
   ```

4. ### Check the files before continuing

   Ask Codex to check the files on disk before it continues: the brief says what happened, the repo says what is true now.

From a shell, `adrive resume --list` lists this project's sessions and `adrive resume <id>` prints the brief for one.

## Before you switch from Claude Code to Codex

- Ending the session in Claude Code triggers a sync right away. Turn-end events re-sync at most every two minutes, so end or compact the session if you switch mid-task.
- With auto-context on, Codex is told at session start about up to three recent sessions in this project, the newest from each other agent first, so the Claude Code session shows up before you ask.

In Codex you call a skill by name by typing $ to mention it, so $agentdrive invokes the AgentDrive skill that setup installs. Codex has replaced custom prompts with skills, and current Codex no longer runs the /prompts:agentdrive-resume prompt that setup also writes. [Source](https://learn.chatgpt.com/docs/build-skills).

Codex can pull recent Claude Code sessions in by itself with /import: the 50 most recent from the last 30 days, one way, on one machine. Use it for a one-time move. Use AgentDrive when you switch back and forth, need older sessions, or hand off to another machine or a teammate. [Source](https://codex.danielvaughan.com/2026/07/24/codex-cli-v0145-import-command-cursor-claude-code-migration-mcp-servers-memories-settings/).

Claude Code deletes local transcripts after 30 days by default (the cleanupPeriodDays setting), so the copy AgentDrive keeps is also your long-term record. [Source](https://code.claude.com/docs/en/settings-reference#cleanupperioddays).

## What carries over

- The goal, the files touched and the most recent turns, as a compact brief (12,000 characters by default).
- Files the Claude Code agent wrote that git doesn't track, such as plans and notes.
- The full redacted transcript, which stays in your workspace and is searchable later.
- Sessions encrypted with Private Workspace resume with `adrive resume <id>` on a machine that holds your key.

## Frequently asked questions

### How do I pick a specific Claude Code session in Codex?

List sessions with a plain request such as "list my AgentDrive sessions". It calls `drive_sessions`, which takes a platform filter, so asking for `claude-code` sessions shows only Claude Code's. Then resume with the session id.

### Do Claude Code and Codex need to be on the same machine?

No. Signed-in sessions sync to your workspace, so Codex can resume a Claude Code session from another machine with the same AgentDrive account. With a git remote, the project is keyed by the normalized remote, so any clone of the repo matches. Without an account, `adrive resume` reads only this machine's local transcripts.

### How long is the Claude Code session kept?

Claude Code deletes its local transcripts after 30 days by default (`cleanupPeriodDays`). The synced copy stays in your AgentDrive workspace, as a redacted transcript you can search later.

### Can I hand the work back from Codex to Claude Code?

Yes. Sync runs in both directions: Codex sessions sync too, and in Claude Code you run `/agentdrive:resume` to load the latest session from another agent.

## Related guides

- [Continue a Codex session in Claude Code](https://agentdrive.sh/resume/codex-to-claude-code), the same handoff in reverse
- [AgentDrive for Claude Code](https://agentdrive.sh/integrations/claude-code) and [AgentDrive for Codex](https://agentdrive.sh/integrations/codex): setup details for each agent
- [Quick start](https://agentdrive.sh/docs/quick-start): install, sign in and run your first handoff

### Other handoffs

- [Continue a Claude Code session in OpenCode](https://agentdrive.sh/resume/claude-code-to-opencode)
- [Continue a Claude Code session in Cursor](https://agentdrive.sh/resume/claude-code-to-cursor)
- [Continue a Claude Code session in Antigravity](https://agentdrive.sh/resume/claude-code-to-antigravity)
- [Continue an OpenCode session in Codex](https://agentdrive.sh/resume/opencode-to-codex)
- [Continue a Cursor session in Codex](https://agentdrive.sh/resume/cursor-to-codex)
- [Continue an Antigravity session in Codex](https://agentdrive.sh/resume/antigravity-to-codex)
