Skip to main content
Glama

Delegate work to a new Codex session

delegate_to_codex
Destructive

Create a named Codex session in a project directory, send a prompt, and return Codex's reply while handing the session to Codex Desktop for independent new work.

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. 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, 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
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.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"
      +}
  2. 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"
  3. 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)"
  4. 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"
  5. First observedv1.11.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and non-idempotency, so the safety profile is covered. The description adds real context beyond that: a bridge writer lock it must not leave behind, an authorization precondition, Desktop-mode requestId identity rules, and the 40s cap on the overall call even though timeoutSec allows up to 3600. It does not describe auth/credential requirements beyond the user-authorization note.

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 core action is front-loaded in the first sentence, followed by usage, mode rules, and the sibling pointer. Dense but slightly long-winded; the requestId rules repeat what the schema already says, which weakens justification for the length.

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 mutating tool with no output schema, the description covers workflow, mode differences, alternative tools, and lock cleanup. It stops short of stating what is returned (the threadId appears only inside a parameter description) and the failure/error behavior of the call.

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-parameter semantics the schema states per-parameter: a fresh requestId per independent task kept exactly on retries, omission in legacy mode, and the Desktop 40s cap conflicting with the timeoutSec ceiling. That interaction guidance is genuinely additive.

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 precise multi-step verb sequence — create a named session at a project directory, send the prompt, return Codex's reply, hand off to Desktop without leaving the bridge lock behind. It is clearly distinguishable from siblings start_codex_thread and send_to_codex_thread.

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?

It names the triggering condition ('independent new work when the user explicitly or through standing instructions authorizes new conversations') and routes unfinished work to the explicit alternative send_to_codex_thread. Mode-specific guidance (Desktop vs legacy app-server) is also given.

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