Skip to main content
Glama

Transfer session to Codex (free)

codex_transfer

Convert a Claude Code session transcript into a Codex thread and receive the resume command to continue the conversation.

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

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. Dates show when Glama detected each change.

  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 declare readOnlyHint=false and destructiveHint=false, but the description adds critical behavioral nuance: it creates a thread in $CODEX_HOME (so mutates state) but never edits the working tree, and it is free/no token spend. It discloses that a live session creates a NEW thread each call (non-idempotent), addresses validation failures via cli_contract_changed, and specifies that resume_command is POSIX shell syntax. This goes well beyond the annotations.

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?

Reasonably compact for the information density, with front-loaded purpose and usage. Some redundancy with the schema (e.g., transcript_path guidance repeated nearly verbatim), but the extra behavioral notes (non-idempotency, validation, free/ no-token) are valuable. Could trim the verbatim echo of schema text, but not enough to lower to 3.

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?

Given the tool's complexity (state mutation, validation, side effects) and that the output schema exists, the description covers: prerequisites (codex_status), failure modes, side effects, idempotency, and parameter resolution. The only minor gap is that it doesn't describe the exact shape of the return (though an output schema exists, so the agent can see that). Complete for a hand-off tool.

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% — both parameters are well documented in the schema. The description adds: how to locate the current transcript (newest *.jsonl), the ambiguity fallback (ask the user), the workspace_root fallback behavior (cwd fallback + meta.workspace_warning, and that it is not a read boundary). This is above the baseline 3 because it clarifies the practical meaning and failure modes of the parameters.

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?

The description states a clear verb ('hand off'), a specific resource (the Claude Code session transcript converted to a Codex thread), and the deliverable (resume_command). It distinguishes from siblings by noting this is for a resumable session transfer while codex_consult, codex_delegate, etc. cover different actions. Even without reading sibling descriptions, an agent knows this is the conversion/hand-off tool.

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 ('to continue that exact conversation in Codex'), what to verify beforehand (codex_status confirms install/auth), and when to ask the user (ambiguous transcript path). It also notes the tool is not idempotent for an active session, which is crucial usage context. Alternatives like codex_consult/delegate are implicitly distinct by the 'hand off to a resumable thread' framing, though siblings aren't named explicitly.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/briandconnelly/codex-in-claude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server