codex_transfer
Convert a Claude session transcript into a persistent Codex thread. Returns a resume command to continue the conversation without token spend.
Instructions
Hand off the current Claude Code session to a resumable Codex thread.
Imports a Claude session transcript (.jsonl) into a persistent Codex thread via
codex app-server and returns resume_command (codex resume <thread_id>) to
continue that exact conversation in Codex (TUI or App). FREE — no model call and no
token spend; it is a local file conversion, typically seconds. It does create a
thread in $CODEX_HOME (so it is not read-only) but never edits your working tree.
Pass transcript_path: the current session's transcript is the newest *.jsonl under
~/.claude/projects//. If that is ambiguous — for example, more than one recent
transcript could be the current session — ask the user which one to transfer. Transferring
a still-live session creates a NEW thread each call — Codex dedups only a byte-identical
transcript — so this is not idempotent for an active session.
Identifiers the app-server reports (the imported thread id and $CODEX_HOME) are validated:
a drifted, oversized, or malformed value fails as cli_contract_changed rather than
producing a corrupt resume_command or importing into the wrong home. resume_command is
POSIX shell syntax.
codex_status (free) can confirm Codex is installed and authenticated beforehand.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_root | No | Absolute path to the target repository root. Pass it (or rely on an MCP root) so the call targets the intended repo; otherwise it falls back to the server's own cwd and meta.workspace_warning is set. | |
| transcript_path | Yes | Absolute path to the Claude Code session transcript (.jsonl) to hand off to Codex. Must be an existing, non-empty .jsonl file under ~/.claude/projects. Find the current session's transcript as the newest *.jsonl under ~/.claude/projects/<cwd-slug>/. If that is ambiguous — for example, more than one recent transcript could be the current session — ask the user which one to transfer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes |