Delegate work to a new Codex session
delegate_to_codexCreate 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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute project directory where Codex must work | |
| name | No | Optional Codex session title; otherwise one is derived from the prompt | |
| model | No | Model override, e.g. gpt-5.6-luna | |
| effort | No | Override reasoning effort (default whatever ~/.codex/config.toml says) | |
| prompt | Yes | 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 | |
| openInApp | No | Show the task in Codex Desktop; native tasks open immediately while running | |
| requestId | No | 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. | |
| timeoutSec | No | How long to observe the task (Desktop caps the entire call, including creation, at 40s; the task continues and its threadId is returned) | |
| releaseAfterTurn | No | Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed |