codex_run
Delegates coding, research, refactoring, or audit tasks to the local OpenAI Codex CLI, with async fan-out, model/reasoning presets, and session IDs for follow-ups.
Instructions
Delegate a coding, research, refactoring, or audit task to the local OpenAI Codex CLI (codex exec). Supports anchor project grouping (group + task_name), concurrent async fan-out (wait_seconds: 0), GPT model/reasoning presets (fast, balanced, deep, ultra), and returns session_id for follow-ups via codex_resume.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"cwd": "<cwd>"
},
"name": "codex_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to the target working directory. | |
| group | No | Parent task group name in the orchestrator ledger & live console. | 默认任务组 |
| model | No | Optional GPT model slug override (e.g., "gpt-6.2-astra", "gpt-6.2-sol"). | |
| images | No | Optional image file paths to attach to the prompt. | |
| preset | No | Quick model + reasoning preset from routing.json. | |
| prompt | Yes | Detailed task specification / instructions for Codex. | |
| sandbox | No | Sandbox policy for Codex shell commands. | workspace-write |
| add_dirs | No | Additional writable directories alongside cwd. | |
| worktree | No | Run inside a new managed Git worktree (forces use_anchor_project=false). | |
| ephemeral | No | Do not persist session files to disk (disables resume). | |
| task_name | No | Numbered child agent label (e.g., "01-库结构盘点"). | |
| wait_seconds | No | Seconds to wait before returning running status with job_id (0..600). Use 0 for async fan-out. | |
| approval_policy | No | Approval policy (use "never" for non-interactive execution). | never |
| reasoning_effort | No | Optional reasoning effort override. | |
| use_anchor_project | No | Anchor Codex session metadata in CODEX_ANCHOR_DIR while granting --add-dir access to cwd. | |
| skip_git_repo_check | No | Allow running outside a Git repository. |