Codex gives you two useful controls for difficult work: Plan mode shapes an ambiguous task before edits; Goal mode keeps a measurable objective active across a long execution.
Unclear problem or tradeoffs? → /plan Clear multi-step objective? → /goal Small bounded change? → direct prompt Need explanation mid-task? → side chat
A goal is both the starting instruction and the completion test. Replace “improve performance” with an observable condition.
Reduce the dashboard's p95 load time below 800 ms.
Preserve current behavior, add a regression benchmark,
and report the before/after measurement.
A long-running goal still needs explicit constraints. “Do not change the API” remains relevant at every step.
Interrupting every small decision prevents Codex from completing a coherent loop. Instead, establish checkpoints where new evidence should change the plan:
At a checkpoint, ask for the evidence gathered, assumptions invalidated, remaining risks, and the next bounded step.
| Situation | Response |
|---|---|
| Same task, new constraint | Continue the thread and state the constraint explicitly |
| Need explanation without redirecting work | Use a side chat when available |
| Unrelated objective | Start a new thread |
| Long task after compaction | Restate critical constraints and completion tests |
Ask: “Report completed evidence, unresolved decisions, changed files, verification run, and the next action.” This exposes drift without restarting the task.
Take one fuzzy backlog item. Ask Codex in Plan mode to interview you, expose assumptions, and produce a goal with one measurable completion condition. Add two checkpoints and state what evidence must be available at each one.
Prompting Codex documents threads, context, Plan mode guidance, and Goal mode.