Delegate a task to Codex
codex_delegateDelegate coding or analysis tasks to a local Codex CLI for read-only investigation, review, or optional file edits. Set model, reasoning effort, sandbox, and context per request.
Instructions
Delegate a coding or analysis task to the local Codex CLI, choosing model and reasoning effort. Codex runs read-only by default: it investigates and reports. Set sandbox to workspace-write to let it edit files. Codex cannot see this conversation, so pass everything it needs in prompt, context, and target_files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | blocking (default) waits and streams progress; background returns a job_id immediately. | |
| model | No | Catalog slug from list_codex_models. Omitted means the recommendation matrix picks one. | |
| prompt | Yes | The task for Codex. Be specific and self-contained: Codex cannot see this conversation. | |
| context | No | Background Codex needs: prior findings, constraints, relevant excerpts. | |
| sandbox | No | Sandbox policy. Defaults to read-only: Codex analyses and reports but cannot modify files. | |
| add_dirs | No | Additional absolute directories that should be writable alongside working_dir. | |
| web_search | No | Enable Codex's native web search tool. | |
| working_dir | No | Absolute path Codex uses as its working root. | |
| auto_approve | No | Adds --approve-for-me so Codex auto-approves its own commands. Only applies when sandbox allows writes. | |
| target_files | No | Paths Codex should focus on, relative to working_dir. | |
| use_worktree | No | Run in a managed git worktree so changes never touch the current working tree. | |
| timeout_seconds | No | Wall-clock budget. Defaults to 1800s. | |
| reasoning_effort | No | Reasoning depth, independent of model choice. Clamped to what the chosen model supports. | |
| acceptance_criteria | No | Concrete conditions that must hold for the task to be considered done. | |
| skip_git_repo_check | No | Allow running outside a git repository. | |
| system_instructions | No | Persona or extra rules inherited from the orchestrator, layered on the built-in quality contract. |