HHandover
All guides

Claude Code to Codex

How to transfer context from Claude Code to Codex

To transfer context from Claude Code to Codex once, use Codex's built-in import flow: open Settings > Import in the desktop app or run /import in an idle Codex CLI session, choose Claude Code, and select the supported setup, project files, and recent chats. For recurring handoffs, keep the repository in Git, put stable instructions in CLAUDE.md and AGENTS.md, publish changing task state and evidence to Handover from Claude Code, then have Codex retrieve the current revision, verify the checkout, and continue it.

Handover workspace with versioned context shared between humans and AI agents

Can Codex import Claude Code context directly?

Yes, for a one-time migration. Codex can import supported Claude Code instructions, settings, skills, plugins, project folders, project memories, recent chats, MCP configuration, hooks, commands, and subagents. The desktop app exposes Settings > Import; Codex CLI exposes /import when no task is running. The CLI can import up to 50 chats from the previous 30 days, and the source setup is left unchanged.

  • Use the built-in import when you are moving your setup or recent work into Codex.
  • Review imported permissions, hooks, MCP authentication, and path-dependent commands before relying on them.
  • Start a fresh Codex task after import so the imported project guidance is loaded.
  • Do not treat import as a live synchronization channel between the two agents.

When should you use Handover instead of import?

Use Handover when Claude Code and Codex will alternate on work over time, when a teammate or service agent also needs access, or when the transfer requires attributable revisions, attached evidence, review comments, access policy, and a stable URL. Import moves supported local setup and recent history into Codex; Handover maintains a shared continuation record that either authenticated agent can read and advance.

One-time move
Claude Code setup and recent chats
  -> Codex /import
  -> review imported configuration
  -> continue in Codex

Recurring collaboration
Claude Code checkpoint
  -> Handover revision and artifacts
  -> Codex verifies and continues
  -> Handover next revision
  -> Claude Code can resume later

What context should Claude Code publish before the switch?

The sender should publish the task state that cannot be reconstructed reliably from the repository alone. Keep source code in Git and attach a concise continuation record with the exact checkout, decisions, evidence, unresolved constraints, and next action. Claude Code's auto memory is machine-local, so a receiving Codex session should not depend on it.

  • Objective and acceptance criteria.
  • Repository, branch, commit, and relevant uncommitted changes.
  • Files changed and files intentionally left untouched.
  • Decisions made, rejected alternatives, and reasons.
  • Commands run with the material output or failure.
  • Open review comments, risks, and missing verification.
  • The smallest next action and its expected result.

How do you connect Claude Code and Codex to Handover?

Connect both hosts to the same Handover MCP endpoint with separate, named service credentials. Handover supports per-user Google OAuth in explicitly configured clients such as Gatana, but it does not currently expose first-party dynamic OAuth registration for arbitrary MCP clients. Generic Claude Code and Codex connections therefore use scoped service credentials created under Company > Agents. Never reuse one credential across both hosts if you need reliable authorship or independent revocation.

# Claude Code
export HANDOVER_CLAUDE_TOKEN='hnd_tok_...'
claude mcp add --transport http --scope user   handover https://handover.sh/api/mcp?profile=core   --header "Authorization: Bearer $HANDOVER_CLAUDE_TOKEN"

# Codex
export HANDOVER_CODEX_TOKEN='hnd_tok_...'
codex mcp add handover   --url https://handover.sh/api/mcp?profile=core   --bearer-token-env-var HANDOVER_CODEX_TOKEN

# In both hosts
Call handover.whoami before publishing or continuing.

What is the exact Claude Code to Codex handoff sequence?

Claude Code should verify its authenticated identity, search before creating a duplicate, publish a checkpoint with source artifacts, and read the result back. In a fresh Codex session, Codex should verify its own identity, retrieve the canonical revision and open annotations, inspect the local Git state, reproduce one meaningful result, and continue using the expected revision identifier.

Claude Code
1. handover.whoami
2. handover.search for the task
3. handover.create or handover.continue
4. attach HANDOFF.md and material evidence
5. handover.get and read every uploaded artifact

Codex
6. handover.whoami
7. handover.search and handover.get
8. read artifacts and unresolved annotations
9. compare the handoff with Git and active AGENTS.md
10. reproduce one test or failure
11. handover.continue with expectedRevisionId
12. handover.get to verify the new canonical revision

How do CLAUDE.md and AGENTS.md fit into the transfer?

CLAUDE.md and AGENTS.md are repository instruction layers, not task checkpoints. Claude Code loads CLAUDE.md files and Codex discovers layered AGENTS.md files. Keep durable architecture rules, commands, conventions, and safety constraints in those files. Put the changing objective, state, evidence, risk, and next action in HANDOFF.md or a Handover revision.

  • Duplicate critical cross-host repository rules only when both agents must obey them.
  • Keep host-specific configuration in its native instruction file.
  • Do not paste entire chat transcripts into either instruction file.
  • Restart or start a new agent session after changing instruction files so discovery runs again.

How do you verify the transfer worked?

A successful connection or create call is not enough. The transfer passes only when a separately authenticated Codex session finds the handoff without receiving the Claude chat, reads the exact artifacts, states the correct objective and next action, reproduces one piece of evidence, and appends a new revision without overwriting concurrent work.

  • Claude Code and Codex resolve to the intended separate identities.
  • Codex finds the record by title or unique marker.
  • Artifact bytes and the declared Git state match the sender's checkpoint.
  • Open annotations and assignments remain visible.
  • A stale expectedRevisionId is rejected.
  • Revoking one service credential does not revoke the other actor.

Primary references

Sources and further reading