AI Catchup

Codex CLI 0.128.0 Lands Persisted `/goal` Workflows: Ralph-Style Agents That Don't Stop Until Done

By 8 min read

OpenAI shipped Codex CLI 0.128.0 in April 2026 with a new `/goal` system that keeps a goal alive across turns and runs the agent until it is achieved. The release adds app-server APIs and model tools for goals, runtime continuation, and TUI controls to create, pause, resume, and clear goals. Felipe Coury credits co-worker Eric Traut (the Pyright lead) for the design, and frames it as Codex's take on the Ralph loop pattern.

OpenAI shipped Codex CLI 0.128.0 in April 2026 with a feature that has been quietly missing from most agent CLIs: a /goal system that keeps a stated goal alive across turns and continues running the agent until it is achieved. The official Codex changelog describes new app-server APIs and model tools for goals, runtime continuation logic so a turn does not stop short, and TUI controls to create, pause, resume, and clear an active goal. Codex team member Felipe Coury framed the launch as Codex's take on the Ralph loop: "keep a goal alive across turns. Don't stop until it's achieved."

For where this fits in the broader Codex picture, our Codex computer use, comment mode, and thread automations writeup covers the April 16 work-agent expansion, and the Codex CLI vs Claude Code vs Cursor architecture comparison is the right anchor for how Codex CLI differs from the other terminal coding agents.

Key Takeaways

  • What: A persisted /goal workflow that survives across turns and drives Codex CLI to keep going until the goal is achieved.
  • Where: Codex CLI 0.128.0 (the open-source Codex CLI), April 2026 release.
  • How it shows up: App-server APIs and model tools for goals, runtime continuation behavior, and TUI commands to create, pause, resume, and clear a goal.
  • Pattern: Codex's productized take on the Ralph loop -- a fixed objective driving a tight, self-continuing agent loop.
  • Who built it: Eric Traut, per Coury's launch post -- best known publicly as the Pyright lead.
  • Enablement: Coury indicated [features] goals = true in config.toml turns it on. Treat as a post-sourced enablement hint; the durable Codex config docs describe [features] as the experimental toggles table but did not list goals at time of writing.

What /goal Actually Changes

Most agent CLIs treat each turn as a self-contained unit. You prompt, the agent does its thing, the turn ends, and if the agent stopped one step short of finishing the work, that is your problem to notice and re-prompt. /goal flips that: you state the goal once, and the agent's job is to keep going across as many turns as it takes until the goal is met.

Three pieces of plumbing make that possible per the changelog:

  • App-server APIs and model tools for goals. The MCP-style tool surface and the app server both gain first-class goal endpoints. That is the layer external clients (and the model itself) read and write through.
  • Runtime continuation. The Codex runtime knows whether a turn ended in a state that satisfies the active goal. If it did not, the loop continues rather than handing control back to the user.
  • TUI controls. The terminal UI gets the verbs you would expect for a long-lived objective: create a goal, pause it, resume it, clear it. Pausing is the important one -- it is the escape hatch when an agent is grinding on something that needs your judgment.

The combination is what turns a one-shot turn into a persistent intent the agent works toward. The closest analogue in another CLI today is Claude Code's plan mode plus a manually-driven re-prompt loop, but /goal makes the loop the runtime's job, not the user's.

The Ralph Loop, Productized

The "Ralph loop" name has circulated in the agent community for a while as shorthand for the pattern of running an agent in a tight loop against a fixed objective: each iteration looks at the gap between current state and goal state, picks the next action, executes it, and repeats until the gap closes. The pattern is well known; building it as a robust, native part of an agent CLI is the part that takes work.

Coury's framing on launch -- "our take on the Ralph loop: keep a goal alive across turns. Don't stop until it's achieved" -- is the productized version of that pattern. The credit line in his post points at Eric Traut, who Coury describes as a co-worker and OpenAI mentor. Traut is best known publicly as the engineer behind Pyright, the Microsoft Python type checker that powers Pylance and most modern Python tooling. The Pyright lineage is a strong signal for the kind of careful runtime work a continuation loop needs to get right.

How to Turn It On

Per Coury's follow-up reply, the feature is enabled with:

[features]
goals = true

in your Codex config.toml.

A few honest caveats on that line:

  • Coury is on the Codex team and posted this on launch day, so the enablement hint is from a credible source.
  • The durable Codex config-basic docs explain that [features] is the table where optional and experimental capabilities live, but at time of writing the documented feature table did not include goals. That is normal for a same-week launch -- the docs almost always catch up after the changelog -- but it is worth checking the docs before you wire [features] goals = true into a long-lived config you do not want to re-discover later.
  • If you are running an older Codex CLI, run codex update first. The same 0.128.0 batch added the update command, so you can upgrade in place without re-installing.

Other Things That Shipped Alongside /goal

The official Codex changelog batches /goal with several smaller quality-of-life improvements that are easy to miss but materially smooth out a long-running terminal session:

  • codex update command. In-CLI version upgrade. Removes the "go look up the install instructions again" step.
  • Configurable TUI keymaps. Bind the TUI verbs to keys that match your terminal habits.
  • Plan-mode nudges. When a turn is running long, the CLI suggests creating a plan. Friction in the right direction -- the agent equivalent of a code reviewer asking "should this be a separate PR?"
  • Action-required terminal titles. Backgrounded Codex sessions update the terminal title when they need input. If you tile multiple Codex sessions across tabs or panes, this is the difference between noticing the blocker in two seconds and noticing it in two minutes.
  • Editable /statusline and /title mid-turn. You can tweak the active session's status line and title without ending the turn.

The pattern across the batch is "make long-lived Codex CLI sessions feel native." /goal is the headline because it changes the runtime model, but the supporting changes are the ones that make a goal-driven session habitable across hours instead of minutes.

When to Reach for /goal

The /goal shape pays off the most for objectives where:

  • The end state is well-defined -- you can recognize "done" without a human in the loop. Tests passing, a benchmark hitting a target, a file matching a schema, a service responding 200.
  • The path is iterative -- multiple small steps that build on each other, where each turn's diff is reviewable but the whole job is too big for one turn.
  • The cost of a stale stop is real -- you do not want to come back to your terminal twenty minutes later to find the agent stopped one step short and has been idle since.

Examples that fit cleanly:

  • "Get this test suite green." Codex iterates: run tests, identify failure, fix, re-run, repeat. The goal is a clean test run, which is trivially checkable.
  • "Migrate this file from class components to hooks until the type checker is clean." Each turn touches a file or two, runs tsc, and only stops when the diagnostics are zero.
  • "Bring this benchmark under 200ms." Each turn proposes an optimization, measures, keeps it or reverts, and continues until the threshold is met.

Where it does not fit: open-ended exploration ("look around the repo and tell me what to refactor"), tasks where the success condition is human judgment ("make this UI feel right"), or anything you would not want running unattended in a loop touching files.

How /goal Compares to Other Long-Running Agent Patterns

The "agent that keeps going on its own" idea is showing up in different shapes across the major coding agents this quarter:

  • Codex CLI /goal. Loop is a runtime feature. The agent keeps turning until the goal is satisfied, in your terminal, against your local checkout.
  • Codex thread automations (covered in our April 16 Codex deep-dive). Always-on, trigger-driven. A thread reacts to external events (Slack, email, PRs) rather than driving toward a single objective.
  • Claude Code Routines (see our Routines launch coverage). Scheduled or HTTP-triggered. Each routine run is stateless; the trigger and schedule are first-class, but the loop within a run is not the focus.

The mental model: /goal is a single-thread, objective-driven loop. Thread automations are an external-event-driven loop. Routines are a schedule- or trigger-driven loop. They are not redundant -- a serious workflow could plausibly use all three for different jobs.

Why This Matters

The reason /goal is more interesting than its small surface area suggests is that it nudges the locus of the work back into the runtime. The 2025 era of agent CLIs treated turns as the unit of agency: you drive each turn, the agent helps. /goal says the unit of agency can be the objective, and the runtime is responsible for getting there. That is a small shift in framing and a meaningful shift in workflow -- you delegate the loop, not just the action.

Pair /goal with the rest of the 0.128.0 batch and the practical effect is that Codex CLI is now noticeably more comfortable as a "leave it running" tool than it was in 0.127. The same direction Cursor is pushing with Background Agents and the SDK, and Claude is pushing with Routines, but at the terminal, against your own checkout, on your own machine. The agent coworker thesis keeps gaining surface; this is the terminal CLI's version of it.

For the canonical references, the Codex changelog is the durable source for what shipped in 0.128.0, and Felipe Coury's launch post and enablement reply are the primary sources for the Ralph loop framing and the [features] goals = true config hint.

Frequently Asked Questions

What is the `/goal` feature in Codex CLI 0.128.0?

`/goal` is a new Codex CLI workflow, shipped in version 0.128.0 in April 2026, that keeps a stated goal alive across turns and continues running the agent until the goal is achieved. The official Codex changelog describes new app-server APIs and model tools for goals, runtime continuation logic so a turn does not stop short of the goal, and TUI controls to create, pause, resume, and clear an active goal.

How does `/goal` relate to the Ralph loop pattern?

Felipe Coury (OpenAI Codex team) framed `/goal` on X as Codex's take on the Ralph loop: keep a goal alive across turns and don't stop until it is achieved. The Ralph loop name has circulated in the agent community for the pattern of running an agent in a tight loop against a fixed objective; `/goal` is the productized version of that idea baked into the Codex CLI runtime.

Who built it?

Per Felipe Coury's launch post, the `/goal` system was built by Eric Traut, the engineer best known publicly as the lead behind Pyright (Microsoft's Python type checker). Coury, who works on Codex at OpenAI, called Traut 'one of the GOATs' he gets to work with daily.

How do I enable it?

In a follow-up reply, Coury indicated the feature is enabled via `[features] goals = true` in your `config.toml`. Treat that as a launch-day enablement hint from a Codex team member; the durable Codex docs page for config basics describes the `[features]` table as the place where optional and experimental capabilities are toggled, but did not list `goals` in the documented feature table at the time of writing -- so behavior may change as the docs catch up.

What else shipped in Codex CLI 0.128.0?

The same April 2026 changelog batch added a `codex update` command, configurable TUI keymaps, plan-mode nudges that suggest creating a plan when a turn is going long, action-required terminal titles so backgrounded Codex sessions visibly flag when they need input, and the ability to edit `/statusline` and `/title` while a turn is active.

Get the weekly AI Catchup

Tools, practices, and what matters -- in your inbox every Monday.