Keep Codex working toward a goal
On this page
A Codex goal tells the agent to keep working toward an objective across responses: when one response finishes, Codex can start the next one itself, without another prompt from you. Use a goal for a task that needs repeated rounds of investigation, changes, and testing, such as finding and fixing a failure that is difficult to reproduce.
Set a useful goal
In a Codex thread, enter /goal followed by the outcome you want. You can
also choose goal mode in the composer and type the objective there. For
example, suppose checkout is failing in your app and you want Codex to keep
working until purchases succeed again:
/goal Fix the failing checkout flow. Run the relevant tests and verify that a user can complete a purchase in local development.
Include how Codex should verify the result and any limits on the work, such as which files it may change or whether it may deploy.
Follow progress
The goal panel shows the saved objective and its status. While it says Pursuing goal, you can still answer questions and provide information in the conversation.
Use Edit goal to change the objective, or Pause goal and Resume
goal to control when Codex pursues it. To replace the objective, enter
/goal with the new objective and confirm Replace goal; you will keep the
same thread. Clear goal will remove the saved objective.
If the status is Goal blocked, read Codex's explanation and resolve the reported blocker. Goal usage limited means your provider usage limit was reached, and Goal limited means the goal used up its own token budget; neither means the objective is complete. In each case, check the conversation and your remaining allowance, resolve what stopped the work, then choose Resume goal to continue.
Review before finishing
When the panel says Goal achieved, review the result and the checks Codex ran. For code changes, inspect the changed files and try the affected app behavior. If you need more work, set another goal or send a normal prompt.
Claude can also work on long tasks, but saved goals are a Codex feature. To start work on a schedule, from an API request, or from an integration, use an automation.