What is the Codex /goal command and how to enable it
The /goal command in Codex lets you set a task, walk away, and return hours later to find it done. It is the official Ralph Loop in Codex. Enable it with codex features enable goals.
The main idea
OpenAI shipped /goal in the Codex CLI and the Codex app. One of the lead engineers who shipped it called it the most consequential thing OpenAI has ever shipped in Codex. You set a task, walk away, and come back hours later to find it done.
/goal is the official Ralph Loop implementation in Codex. The Ralph Loop goes back to early 2024, when Jeffrey Huntley wrote the original bash version. You give Codex an objective, and Codex plans, executes, tests, and refines until the goal is reached. State persists across sessions, so you can close your laptop and the goal is still alive tomorrow.
A good prompt works for a 10-minute task. For a multi-hour refactor or migration, goal is the only thing that holds the line. The goal is a first-class object attached to the thread. It has explicit states: pursuing the goal, paused, achieved, and budget limited. It survives across turns, pauses, and context compactions.
To enable it, update Codex and run codex features enable goals. In my demo I asked for a Lego Game of Thrones game set in King's Landing and north of the wall. The goal was achieved in 4 minutes. A second goal remade the game in 3D. Vincent, who maintains open claw, says goal is a constraint workflow. Give it a finish line, such as build until playable or QA until verified.
Key points
- /goal is the official Ralph Loop implementation in Codex, credited to Jeffrey Huntley's original bash version from early 2024.
- A goal has explicit states: pursuing the goal, paused, achieved, and budget limited.
- The goal survives across turns, pauses, context compactions, and reopened sessions.
- Enable it with codex features enable goals, or by editing the config.toml file.
- Goal works best with constraints and a finish line, such as build until playable or QA until verified.
Chapters
- 0:43What /goal is: the official Ralph loop
- 2:01Isn't this just a really good prompt?
- 3:37How to enable /goal
- 3:56Live demo: Lego Game of Thrones
- 6:04Summary and further reading
Save my free seat →