Delegate a task to Codex
codex_delegateHand a self-contained coding task to a Codex subagent, get the result and changed files. Checks quota first and returns a handoff when exhausted so you can finish the work yourself.
Instructions
Hand a self-contained coding task to Codex as a subagent. Starts a fresh Codex thread, runs the task, and returns the result plus the files it changed. Checks quota first: if Codex has no quota left it returns status 'quota_exhausted' with a handoff so you can finish the work yourself instead of waiting for a reset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The full task instruction for Codex. Be specific and self-contained. | |
| model | No | Codex model id from codex_get_models. Omit for the account default. | |
| scope | No | Scope boundary: what Codex may and may not touch. | |
| branch | No | Branch name for the worktree. Default: "agent-router/<taskId>". | |
| isolation | No | "worktree" runs Codex in a dedicated git worktree on its own branch, so a bad turn cannot touch the user's working tree. "none" edits in place. Default: none. | |
| waitSeconds | No | How long to block before returning a pollable taskId (default 240s, max 1800s). | |
| reasoningEffort | No | Reasoning effort supported by the chosen model (see codex_get_models). | |
| workingDirectory | Yes | Absolute path Codex should treat as its working directory. |