Hand Codex a plan to execute
codex_execute_planExecute a concrete step-by-step plan in the background, returning a job ID for tracking, while Codex follows the plan faithfully without redesigning.
Instructions
The execute half of plan→execute: you do the design thinking in this conversation, write a concrete step-by-step plan, and hand it here for Codex to carry out in the background — getting a jobId back immediately, exactly like codex_start. Codex is told the plan was authored by another model and to follow it faithfully rather than redesign: if a step is wrong or impossible it stops and reports in blockers instead of improvising, so you can revise and resume with codex_reply. Reach for this when the hard part was deciding what to do and the rest is faithful typing across files — it keeps the reasoning on your side and the output tokens on Codex's. Because the design is already done, the execution usually needs less reasoning effort than the planning did, so consider pinning a lower reasoningEffort unless individual steps are themselves subtle. The plan must be self-contained: Codex cannot see this conversation, so state every step, file, and acceptance check in the plan text itself. Keep working while it runs; check codex_status when you need to and collect the result with codex_result, which checks what Codex did against git — don't re-check in a tight loop, since each check is a model turn.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to the directory Codex should treat as its working root. | |
| plan | Yes | The step-by-step plan for Codex to execute. Write it as an ordered list of concrete steps naming the files to touch and what each change is, plus how to tell it worked (tests to run, behaviour to check). Self-contained: Codex cannot see this conversation. | |
| model | No | Pin the model instead of letting it be chosen from the plan. Available: (model index unavailable; Codex config defaults apply). Omit to let routing pick one. | |
| addDirs | No | Extra absolute directories Codex may write to, beyond cwd. | |
| sandbox | No | read-only = cannot modify anything; workspace-write (default) = may edit files under cwd; danger-full-access = unrestricted, avoid unless the caller explicitly asked for it. | |
| autoRoute | No | Default true. Set false to use only the values you pass (or Codex defaults). | |
| structured | No | Default true: Codex returns a typed handoff report. Set false only for long prose where the structure would get in the way. | |
| documentation | No | Default true for jobs that can write: Codex updates existing docs the change makes untrue and reports what it touched. Set false to suppress. Always off under read-only. | |
| reasoningEffort | No | How hard Codex should think while executing. The planning is already done, so mechanical execution can take a lower setting than the task as a whole would — raise it only when individual steps are themselves subtle. Omit to let routing choose from the plan text. |