Persistent objective, measurable proof, stop rule
After this, you'll be able to use Goal mode for long-running Codex work without letting the task drift.
Complete Split work with subagents first.
Goal mode gives Codex a standing objective and a real definition of done. The goal text works as both the starting prompt and the finish line. Codex keeps checking its own progress against it.
Reach for /goal on work that takes many steps. It works in the desktop app, the terminal version and the IDE extension, but not in ChatGPT on the web.
Type /plan first to make Codex investigate and propose an approach before it edits. Then type /goal and your goal text.
Think moving a project to a new template, building a rough first version, a long cleanup pass, or anything that has to survive interruptions. Use /plan first when the goal still needs shape.
"Improve the app" tells Codex nothing. "Make the profile page save display names, pass npm test -- profile, pass npm run build, and stop if a schema change (a change to how data is stored) is required" gives it something to check against.
Goal mode isn't permission to stop supervising. You still set the checkpoints, the proof commands, and the stop conditions. A goal gives Codex no extra access: the same sandbox and approvals apply, and Codex pauses when it needs a decision.
In the app, a progress row above the message box has pause, resume, edit and clear. You can also ask in plain words, and ask for a short status report that names the checkpoint, the proof run, and what's left. To check it's still running, ask: Is the goal active, and what checkpoint are we at?
A long goal uses your plan's allowance too, and a run can stop at the five-hour limit, so set a checkpoint and pick the everyday model for long runs.
Each chat keeps its own goal, so don't let two chats edit the same files. On a Mac, a long goal stops if the computer sleeps, so turn on Prevent sleep while running.
In Claude Code and Antigravity: This track found no /goal command in Claude Code. Its plan mode is the closest match, because Claude writes a plan and makes no edits until you approve it. Antigravity's /teamwork runs a multi-day team of an orchestrator, workers and auditors on paid plans.
The goal should be specific enough that Codex can tell whether to keep going, stop, or come back to you.
Paste this into Codex
Write the /goal text for one long Codex task of your own. You now know the parts, so there is no form this time. Check yourself against this list: the goal says what is true when done, names proof Codex can run or show, names when to stop and ask, and says when to report progress. No long task of your own? Use the practice site, but know it is a small stand-in: a real goal is a many-step job such as moving every page of a site to a new template, with a checkpoint after each page. For practice, add an About page and a Contact page, each linked from index.html, with the lesson 2 check as proof and a stop if anything needs installing. If your AGENTS.md from lesson 3 says not to add files without asking, expect Codex to pause once, and approve the two new files. When the goal finishes, ask Codex: *Commit the goal's changes as "Add About and Contact pages".* Return: 1. The exact /goal text. 2. The checkpoints Codex should report. 3. The proof required before completion. 4. The stop rule.
What a good response looks like
1. /goal Add an About page (about.html) and a Contact page (contact.html) to the practice site, and link both from index.html. Keep edits to those three files. After each page, run the check from lesson 2 and open the page in the built-in browser. Finish only when the check passes, both pages open, and both links work. Stop and ask me if you need to install anything, add a form that sends data, or change a file outside codex-practice. 2. Checkpoints: after about.html, after contact.html, after the links. Each report says what changed, what ran, and what is left. 3. Proof before completion: the check passes, both pages seen in the browser, both links clicked. 4. Stop rule: any install, any form, any file outside the folder.
Check yours against
Use Codex to help you use Goal mode for long-running Codex work without letting the task drift. Start with the exercise prompt and your real input. Ask for one draft, then check it against this proof: The goal text includes outcome and proof. Accept only the version you can verify yourself.
You can choose when Goal mode is appropriate
Pulling this out of your own head now is the part that actually moves it into long-term memory. Re-reading only feels like it does.
Without scrolling up, write a /goal for a long task of yours. Include everything Codex needs to know it is done.
One good answer: '/goal Move my podcast site's episode pages to the new template. Done when every page renders and the page test passes. Report after each batch of pages. Stop and ask if a page needs content I did not give.' Check yours: if a stranger could tell from the text alone when it is finished, you're there.
Goal mode works when the goal contains the finish line. Give Codex outcome, proof, checkpoints, and a stop rule.