Skip to main content
Glama

Transfer session to Codex (free)

codex_transfer

Import a Claude Code session transcript into a resumable Codex thread and get a resume command to continue the exact conversation in Codex.

Instructions

Deprecated: amicus has no equivalent. 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

TableJSON Schema
NameRequiredDescriptionDefault
workspace_rootNoAbsolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning. On an active call it selects where Codex works, not what it can read — it is not a read boundary.
transcript_pathYesAbsolute 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

TableJSON Schema
NameRequiredDescriptionDefault
okYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.19.0
    • addedInput schema / properties / transcript_path / pattern
      Added value: +"^[^\\x00-\\x1F\\x7F-\\x9F]*$"
    • changedInput schema / properties / workspace_root / description
      Previous value: -"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning."New value: +"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning. On an active call it selects where Codex works, not what it can read — it is not a read boundary."
  2. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / workspace_root / description
      Previous value: -"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."New value: +"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning."
  3. Changed1 schema field changedv0.11.0
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "fingerprint": {
      -        "type": "string"
      -      },
      -      "meta": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "codex_home": {
      -            "type": "string"
      -          },
      -          "elapsed_ms": {
      -            "type": "integer"
      -          },
      -          "import_id": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "request_id": {
      -            "type": "string"
      -          },
      -          "thread_id_source": {
      -            "enum": [
      -              "import_notification",
      -              "ledger"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "codex_home",
      -          "thread_id_source",
      -          "elapsed_ms"
      -        ],
      -        "type": "object"
      -      },
      -      "ok": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "resume_command": {
      -        "type": "string"
      -      },
      -      "source_path": {
      -        "type": "string"
      -      },
      -      "thread_id": {
      -        "type": "string"
      -      },
      -      "tool": {
      -        "const": "codex_transfer",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "thread_id",
      -      "resume_command",
      -      "source_path",
      -      "meta"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      -        "type": "object"
      -      },
      -      "meta": {
      -        "type": "object"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "error",
      -      "meta"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "fingerprint": {
      +        "type": "string"
      +      },
      +      "meta": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "codex_home": {
      +            "type": "string"
      +          },
      +          "elapsed_ms": {
      +            "type": "integer"
      +          },
      +          "import_id": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "request_id": {
      +            "type": "string"
      +          },
      +          "thread_id_source": {
      +            "enum": [
      +              "import_notification",
      +              "ledger"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "codex_home",
      +          "thread_id_source",
      +          "elapsed_ms"
      +        ],
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "resume_command": {
      +        "type": "string"
      +      },
      +      "server_version": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "source_path": {
      +        "type": "string"
      +      },
      +      "thread_id": {
      +        "type": "string"
      +      },
      +      "tool": {
      +        "const": "codex_transfer",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "thread_id",
      +      "resume_command",
      +      "source_path",
      +      "meta"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      +        "type": "object"
      +      },
      +      "meta": {
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "error",
      +      "meta"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Addedv0.9.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only flag non-read-only/non-idempotent; the description adds substantial context beyond them: thread creation in $CODEX_HOME, that the working tree is never edited, that dedup requires byte-identical transcripts, the seconds-scale local conversion, and the cli_contract_changed validation failure mode. This is exactly the extra behavioral disclosure the annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the deprecation notice and the core action, and nearly every sentence carries distinct information (cost, side effects, failure mode). It is somewhat long and repeats transcript-location guidance already present in the schema, which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, yet the description still explains the key return artifact (resume_command in POSIX syntax) and the failure semantics. For a tool with prereqs, side effects, and ambiguity handling, the coverage is thorough and leaves no critical gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds a concrete heuristic for locating the transcript (newest *.jsonl under ~/.claude/projects/<cwd-slug>/) and the ambiguity resolution policy. It also clarifies workspace_root's scope (selects where Codex works, not a read boundary), though much of this is duplicated from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('imports a Claude session transcript into a persistent Codex thread') and immediately flags deprecation status. It is clearly distinguishable from siblings like codex_delegate or codex_consult, which run model calls rather than perform a local file conversion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use it (hand off current session, free, no token spend), names a pre-flight alternative (codex_status to confirm install/auth), and gives a decision rule for ambiguity ('ask the user which one to transfer'). The not-idempotent warning for live sessions tells the agent when repeated calls are inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.