Take an auth migration that lasts most of an afternoon. Codex has to map the legacy client, replace one slice, run contract tests, move to the next slice, and eventually remove the old path. If every slice ends with a hand-off back to the human for another “continue”, the coordination soon becomes more tedious than the code.

Goal Mode fits this kind of job when the destination stays fixed. Codex can keep working towards the same outcome across several turns, provided the success criteria still hold.[1][2][4]

If six hours later Codex is still working on the same migration slice, one Goal can still make sense. If the next two hours jump between auth, homepage polish, documentation and database changes, putting all of that under one Goal is much harder to keep coherent.

When the plan is still moving

If the team is still deciding how to split the migration, which public behaviour must remain unchanged, or whether the session model belongs in scope, it is too early to let the job run for hours. OpenAI’s guidance for larger tasks puts inspection and planning before implementation, and an OpenAI collaborator in the Codex repository explained that Plan mode suppresses an active Goal while planning is in progress.[3][5]

A small, bounded job can go straight into Goal Mode. The awkward case is a long run started while the architecture is still moving. Codex only has the instructions and state in front of it; if they currently allow a change, it may turn a half-decided idea into a real diff.

Daily issue triage at 9am and an auth migration that runs all afternoon can both happen without someone typing every step, but the control problem is different. Triage needs a trigger. The migration needs one objective to survive from inventory through parity verification. They can live in the same workflow later; it still helps to choose them for separate reasons.

A Goal Needs a Work Contract

Figure 1 | A Goal needs a work contract.

Write down what done means

OpenAI’s guide for substantial Codex work uses four pieces in the task brief: Goal, context pointers, constraints and Done when.[3] Those four pieces belong to the task brief; the Goal Mode interface does not need a matching field for each one. The Goal carries the objective, while supporting context, boundaries and acceptance checks can live in the prompt, a plan or a spec.

For the migration above, the brief could look like this:

Goal
Migrate the target auth modules from the legacy client to the new auth client.

Context
Read the migration plan, current auth contracts, and tests under the target paths first.

Constraints
Keep public behaviour unchanged.
Do not redesign the session model.
Keep a rollback path until parity is verified.

Done when
Targeted tests and contract tests pass.
The target paths no longer reference the legacy client.
Pause and report if the old and new API semantics cannot be made equivalent without changing product behaviour.

Refactor auth leaves the stopping point open-ended. The checks above do not. Codex can test the target paths, search for legacy references, and stop when an API mismatch needs a human decision. Goal continuation evaluates the target after a turn and carries on when work remains; in an official repository discussion about blockers, an OpenAI collaborator also recommended putting human-intervention conditions into the completion definition.[4]

If the migration plan, interface contracts and edge cases already live in files, point the task at those files.[3] Implementation detail can stay in the plan or spec. The Goal only needs the objective that should still be true several turns later.

While the Goal is running

If the Goal is running cleanly, checking in every few minutes just adds noise. Disappearing for hours and coming back to a huge transcript is not much better. You should be able to tell where the work got to from the artefacts it left behind, without reconstructing the whole conversation.

Keep the inventory from the migration-surface pass. When a target module moves, inspect the focused tests and the diff. Before removing the legacy path, search for what still depends on it. Another migration may use different checkpoints; each meaningful slice still needs to leave something you can inspect.

If validation fails, fix that slice before moving on. The next checkpoint can wait. A short status is enough if it says where the checkpoint stands, what has been verified, what remains, and whether anything is blocked.

Long-running Goal Control Loop

Figure 2 | The long-running Goal control loop.

Suppose the Goal is still to finish the auth-client migration, but Codex starts redesigning the session model. Steer the current work back into scope and continue. The finish line is still the same, so only the current route needs correcting.[2]

If the product decision changes and both clients will remain permanently, the old Goal has expired. The work has become a dual-stack architecture, and the migration Goal no longer describes it. Keeping that old Goal alive while layering corrections into the same thread makes later instructions harder to interpret. Stop, write the new destination, and continue from there.

For this migration, parity, tests, a reviewable diff and the remaining legacy path tell you whether the agreed end state exists.[1] Hours spent and files changed only show activity.

If the finish line is still fuzzy, or none of the checkpoints leaves evidence you can inspect, shrink the job or settle the missing decision first. Give it a long run once “done” is concrete enough that Codex can stop without guessing.

References

  1. OpenAI, ChatGPT Release Notes — Codex updates: richer context, goal mode, browser improvements, and remote locked use, 21 May 2026. https://help.openai.com/en/articles/6825453-chatgpt-release-notes
  2. OpenAI, ChatGPT & Codex changelog, Goal Mode entries through 15 June 2026. https://developers.openai.com/codex/changelog
  3. OpenAI Academy, Codex for Faculty and Researchers — Follow Along Guide, 9 June 2026. https://academy.openai.com/public/clubs/higher-education-05x4z/resources/codex-for-faculty-and-researchers-follow-along-guide-2026-06-09
  4. OpenAI Codex GitHub, /goal mode repeatedly emits dangerous-operation confirmation prompt and consumes quota, issue #22245, collaborator clarification on Goal continuation and blocker completion definitions, 12 May 2026. https://github.com/openai/codex/issues/22245
  5. OpenAI Codex GitHub, Plan mode makes active /goal look stuck because continuation is suppressed silently, issue #20656, collaborator clarification, 13 May 2026. https://github.com/openai/codex/issues/20656