Skip to main content
Glama

Delegate work to a new Codex session

delegate_to_codex
Destructive

Create a named Codex session at the requested project directory, send Claude's prompt into it, return Codex's reply, and hand the session to Codex Desktop without leaving the bridge writer lock behind.

Instructions

Create a named Codex session at the requested project directory, send Claude's prompt into it, return Codex's reply, and hand the session to Codex Desktop without leaving the bridge writer lock behind. Use for independent new work when the user explicitly or through standing instructions authorizes new conversations. Desktop creation returns a durable deliveryId; on timeout continue with wait_codex_reply instead of resending. In Desktop mode, supply a fresh requestId per independent task and keep it on retries; omit requestId in legacy app-server mode. Use send_to_codex_thread for unfinished work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute project directory where Codex must work
nameNoOptional Codex session title; otherwise one is derived from the prompt
modelNoModel override, e.g. gpt-5.6-luna
effortNoOverride reasoning effort (default whatever ~/.codex/config.toml says)
promptYesThe complete task Claude is delegating to Codex. The prompt for the recipient agent, with an explicit From Codex or From Claude header naming the actual author, all agent-authored text in English including the header purpose, and the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim
openInAppNoShow the task in Codex Desktop; native tasks open immediately while running
requestIdNoDesktop creation identity: fresh UUID for each independent new task; retain exactly on retries. Omitting it preserves legacy title/prompt deduplication and can return an older task. Not supported in legacy app-server mode.
timeoutSecNoHow long to observe the task (Desktop caps the entire call, including creation, at 40s; the task continues and its threadId is returned)
releaseAfterTurnNoUnsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.22.2
    • changedInput schema / properties / prompt / description
      Previous value: -"The complete task Claude is delegating to Codex. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"New value: +"The complete task Claude is delegating to Codex. The prompt for the recipient agent, with an explicit From Codex or From Claude header naming the actual author, all agent-authored text in English including the header purpose, and the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"
  2. Changed1 schema field changedv1.19.3
    • addedInput schema / properties / requestId
      Added value: +{
      +  "description": "Desktop creation identity: fresh UUID for each independent new task; retain exactly on retries. Omitting it preserves legacy title/prompt deduplication and can return an older task. Not supported in legacy app-server mode.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  3. Changed1 schema field changedv1.18.0
    • changedInput schema / properties / prompt / description
      Previous value: -"The complete task Claude is delegating to Codex"New value: +"The complete task Claude is delegating to Codex. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"
  4. Changed2 schema fields changed
    • changedInput schema / properties / openInApp / description
      Previous value: -"Open the finished session in Codex Desktop on Windows or macOS"New value: +"Show the task in Codex Desktop; native tasks open immediately while running"
    • changedInput schema / properties / timeoutSec / description
      Previous value: -"How long to wait for the turn to finish (default 240s)"New value: +"How long to observe the task (Desktop caps the entire call, including creation, at 40s; the task continues and its threadId is returned)"
  5. Changed1 schema field changedv1.12.3
    • changedInput schema / properties / releaseAfterTurn / description
      Previous value: -"Stop the bridge app-server after a terminal turn so Codex Desktop owns the writer lock"New value: +"Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed"
  6. First observedv1.11.2

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the destructive/openWorld/idempotent=false annotations: it discloses that the bridge writer lock must not be left behind, that Desktop creation returns a durable deliveryId and caps calls at 40s while the task continues, and that requestId/deduplication behavior differs between Desktop and legacy app-server modes. This is exactly the operational context 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?

The four sentences are dense but front-loaded, leading with the full action and following with authorization, timeout, and mode-specific rules. Slightly crowded with mode-switching advice, but each clause earns its place.

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

Completeness4/5

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

For a 9-parameter, multi-mode mutation tool with no output schema, the description covers authorization, timeout recovery, mode-specific requestId handling, and session handoff. It does not explain return values (deliveryId/threadId) beyond the schema, which is acceptable given the schema carries them.

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 the baseline is 3, but the description adds cross-cutting semantics: fresh requestId per independent task retained on retries, omitting it can return an older task, and requestId is unsupported in legacy app-server mode. It also clarifies the timeout-continue path, though per-parameter detail largely duplicates 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 precise verb+resource sequence (create session, send prompt, return reply, hand off to Desktop) and explicitly contrasts with the sibling send_to_codex_thread for unfinished work. An agent can distinguish it from start_codex_thread and open_codex_thread without opening schemas.

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?

Specifies when to use it ('independent new work when the user explicitly or through standing instructions authorizes new conversations'), names the fallback on timeout (wait_codex_reply instead of resending), and routes unfinished work to send_to_codex_thread. Explicit when/alternatives coverage.

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