Skip to content
notes.saurav.io
Go back

OpenAI's /goal Command Lets Codex Agents Code for Days

OpenAI shipped /goal in the Codex CLI and the Codex app, so I made a video showing what it does and how to turn it on, since that is the question I kept seeing in every thread. The pitch: set a task, walk away, come back hours later to find it done, no babysitting the agent every two steps. One of the lead engineers who shipped it called it the most consequential thing OpenAI has put in Codex.

What the Codex goal command actually is

/goal is the official version of the Ralph loop. You give the agent an objective with constraints and a definition of done, and it plans, executes, tests, and refines until it gets there. Jeffrey Huntley wrote the original bash Ralph loop back in early 2024, and OpenAI credited him by name when it made this a first-class feature. A plain prompt runs once. A goal persists across sessions, so you can close the laptop and it is still alive tomorrow.

Why it isn’t “just a good prompt”

That was my first objection too, and I answer it in the video. Codex already plans and retries, so for a 10-minute task a good prompt gets you most of the way. The difference shows up on multi-hour refactors and migrations. A goal is a first-class object attached to the thread, not words in the transcript, with explicit states: pursuing, paused, achieved, budget limited. That state is what lets it survive turns, pauses, and context compaction. The agent is not re-deriving what it is working on from chat history every turn, it just knows.

The live build

To keep it concrete, I build a game on camera. I enable goals and say: build a Lego Game of Thrones scene set in King’s Landing and north of the wall, with a secret door that takes me north. Goal achieved in about four minutes, and it is playable, with crowns to collect and enemies. Then I set a second goal to remake it in 3D and the redo came out noticeably better. The agent carried each objective through without me re-explaining it.

Turning it on

Get on the latest Codex, then run codex features enable goals, or set it in config.toml. The toggle is the easy part. The hard part is writing a goal with real constraints and a clear finish line. As Vincent, who maintains open claw, put it after running goal for three days, it is not a “do my ticket” button, it is a constraint workflow to keep the ship on course. Build until playable, map until clear, QA until verified. It struggles when you treat it like a magic wish.

Watch the video for the state-machine framing, the setup, and the full 3D build, and subscribe for more practical AI agent videos.

I specialize in putting long-running coding agents to work on real engineering backlogs. Book a call at cloudyeti.io/meet.


Share this post on:


Previous Post
The Claude Code Skills That Run My Content Pipeline
Next Post
The Codex Reset Feature Most People Missed