Codex CLI 0.128.0 Lands Persisted `/goal` Workflows: Ralph-Style Agents That Don't Stop Until Done
OpenAI shipped Codex CLI 0.128.0 on April 30, 2026 with a persisted `/goal` system that keeps a goal alive across turns and runs the agent until it is achieved. As of September 2026 the feature is stable and on by default (`features.goals`, no config change needed), Goal mode left experimental status on May 21, 2026, and the `/goal` command is documented with set, view, edit, pause, resume, and clear subcommands. The five goal PRs in the release were authored by Eric Traut.
OpenAI shipped Codex CLI 0.128.0 on April 30, 2026 with a feature that had been 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 GitHub release notes describe it in one line: "Added persisted /goal workflows with app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear." 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." Goal mode has since left experimental status and is on by default in the Codex app, IDE extension, and CLI (details under What Changed After Launch).
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
/goalworkflow 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), released April 30, 2026. As of September 2026 the same Goal mode is in the ChatGPT desktop app and the IDE extension (updated September 3, 2026).
- 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 and per the release notes, which list the five goal pull requests under
@etraut-openai. Traut is best known publicly as the Pyright lead. - Enablement: none needed.
features.goalsdefaults totrueand is marked Stable in the Codex config docs; set it tofalseto turn goals off (updated September 3, 2026). - Status: Goal mode left experimental status on May 21, 2026 (updated September 3, 2026).
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.
Update (September 3, 2026): that comparison was written on launch day. Cursor added its own /goal command in August 2026; see Cursor Cloud Agents event triggers, goals, and subagents.
OpenAI's long-running-work documentation now describes what the goal text is: "The goal text becomes both the first prompt and the completion criteria for the task." It recommends writing a goal Codex can verify on its own, with three elements when they apply: the outcome, the constraints, and the verification ("tests, measurements, or review criteria that prove the work is complete"). Its example goal is: "Migrate this codebase from JavaScript to TypeScript. Preserve existing behavior, compile in strict mode without explicit any types, and make the full test suite pass." If the outcome is unclear, the docs say to start with /plan and turn the result into a goal.
Two limits the docs state plainly. A goal does not widen access: "Starting a goal doesn't grant ChatGPT broader access. It keeps the same sandbox and approval policy and pauses when it needs a decision." And parallel goals live in separate chats: "Run chats concurrently, but avoid letting two chats change the same files," with worktrees recommended for separate checkouts.
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. The release notes corroborate the credit: the five goal pull requests, #18073 "Add goal persistence foundation (1 / 5)" through #18077 "Add goal TUI UX (5 / 5)", are all listed under @etraut-openai. Traut is best known publicly as the engineer behind Pyright, the Microsoft Python type checker that powers Pylance and most modern Python tooling.
How to Turn It On
Per Coury's follow-up reply, the feature was enabled at launch with:
[features]
goals = true
in your Codex config.toml. At the time, the Codex config-basic docs did not list goals in the documented feature table.
Update (September 3, 2026): the flag is now documented and you do not need to set it. The config-basic feature table lists goals with default true, maturity Stable, and the description "Enable persisted goals and automatic continuation". The configuration reference describes features.goals the same way, "stable; on by default". Goal mode left experimental status in OpenAI's changelog entry of May 21, 2026. To disable it, set goals = false under [features]. If you are on an older CLI, codex update (also added in 0.128.0) upgrades in place.
How to Use It
As of September 2026 the CLI slash-command reference documents the command. Verbatim:
- "Type
/goal <objective>to set the goal, for example/goal Finish the migration and keep tests green." - "Type
/goalto view the current goal." - "Use
/goal editto revise the objective. Use/goal pause,/goal resume, or/goal clearto pause, resume, or remove it."
The reference adds one constraint: "Goal objectives must be non-empty and at most 4,000 characters. For longer instructions, put the details in a file and point the goal at that file." While a goal runs, follow-up messages in the same session add context or adjust constraints, and you can ask for a status recap before Codex continues.
Where It Works
| Surface | /goal available | Source |
|---|---|---|
| Codex CLI, interactive session | Yes | Long-running work, CLI tab |
| ChatGPT desktop app (Codex app) | Yes; a progress row above the composer pauses, resumes, edits, or clears the goal | Same page, app tab |
| IDE extension chat | Yes, for the open workspace | Same page, IDE tab |
| ChatGPT on the web | No /goal; the docs point hosted long-running work at ChatGPT Work with the outcome and review criteria in the prompt | Same page, web tab |
| Codex Mobile (Remote) | Manages goals on a connected Mac; OpenAI's weekly digest for the June 9, 2026 app release says Remote on iOS can "manage goals" | What's new |
Plan eligibility is not stated on the goal pages; the feature flag is a client setting, not a plan entitlement. Admin control is not documented for goals specifically. OpenAI's managed configuration page covers enforcing runtime requirements across local clients in general, and this page does not claim goals are on that list.
What Changed After Launch
Later entries in OpenAI's changelog that touch goals, each checked on September 3, 2026:
| Date | Surface | Entry |
|---|---|---|
| May 21, 2026 | Codex app 26.519 | "Goal mode is no longer an experimental feature and is available in the Codex app, IDE extension, and CLI. With Goal mode, you can have Codex drive toward a specific objective for hours or even days." |
| July 27, 2026 | ChatGPT for iOS 1.2026.202 | "Improved goal controls with clearer progress when pausing or resuming." |
| August 7, 2026 | ChatGPT for iOS 1.2026.209 | "Fixed follow-up /goal prompts after completing a goal." |
| August 29, 2026 | Codex CLI 0.151.0 | "Counted nested subagent token usage toward root goal budgets." |
The last row implies a goal token budget exists. The configuration reference documents a features.rollout_budget group ("under development and off by default") but no goal-specific budget key, so this page does not describe one.
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 updatecommand. 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
/statuslineand/titlemid-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.
- Cursor
/goal(added August 2026; see our coverage). The same shape as Codex's: a long-lived objective the agent works toward until it is complete.
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.
Corrections and Updates
September 3, 2026: the feature has moved on since this page published.
Sources
Every entry was fetched on September 3, 2026.
| Source | What it supports | Status on September 3, 2026 |
|---|---|---|
| GitHub release rust-v0.128.0, published April 30, 2026 | The feature list, the five goal PRs by @etraut-openai, the rest of the batch | Fetched; quotations verbatim |
| Codex config basics | goals default true, Stable | Fetched; the flag is now in the table |
| Configuration reference | features.goals, "stable; on by default" | Fetched |
| CLI slash commands | /goal subcommands and the 4,000-character limit | Fetched; quotations verbatim |
| Long-running work | Surfaces, goal text as completion criteria, sandbox and approval policy, parallel goals | Fetched; quotations verbatim |
| Codex changelog | The May 21, July 27, August 7, and August 29 entries | Fetched |
| Felipe Coury, launch post and enablement reply, April 30, 2026 | The Ralph loop framing, the "one of the GOATs" line, and the launch-day config hint | x.com returns an HTTP 200 JavaScript shell with none of the post text, so neither post can be re-verified by tools. The quotations stand as published on May 1, 2026. The Traut credit is independently corroborated by the release notes; the config hint is superseded by the documented default. |
| Pyright | Traut's public work | Fetched |
Read next
Keep building the workspace playbookCodex CLI 0.129.0 Adds Modal Vim Composer, Redesigned Resume/Fork Picker, and a `/hooks` Browser
OpenAI shipped Codex CLI 0.129.0 on May 7, 2026. The release brings modal Vim editing to the TUI composer via `/vim`, a redesigned resume/fork picker, a raw scrollback mode, workspace-aware `/diff`, a new `/hooks` browser with before/after compaction support, expanded plugin management with workspace sharing and share access controls, theme-aware status lines, and Codex Apps auth surfaced through Guardian. Plus a long bug-fix list across Linux/Windows sandboxes, MCP, and TUI input handling.
Cursor Cloud Agents Add Event Triggers, Long-Lived Goals, and Isolated Subagents
Cursor says Cloud Agents can now pick up work from events, keep working toward a long-lived goal, monitor pull requests, watch Slack threads, run scheduled tasks, and launch subagents in isolated virtual machines. The same update adds skill-based Custom Modes and less disruptive steering while an agent is working.
OpenAI Codex Goes 'For Almost Everything': Mac Computer Use, Browser Comment Mode, and Thread Automations Explained
OpenAI shipped a major Codex update on April 16, 2026 that pushes the product past coding into general work. Three changes matter: Codex can now drive your Mac apps directly, an in-app browser captures both screenshots and DOM elements through 'comment mode', and Codex threads can run continuously to watch Slack, email, and PRs. Here is how each works, the workflows that justify each one, and where Codex now sits relative to Perplexity Personal Computer and Claude Code Routines.
Codex CLI vs Claude Code vs Cursor: 2026 Architecture Deep-Dive (Sandboxing, Context, Plugins, Scheduling)
Codex CLI, Claude Code, and Cursor all reach for the same outcome -- an AI agent that ships code -- with three different architectures. Codex enforces safety at the OS kernel layer. Claude Code uses application-layer hooks for programmable governance. Cursor builds the agent into a visual IDE with a marketplace of plugins. The right one depends less on which model you prefer and more on which architecture matches your security posture, your composition needs, and your team shape.
Claude Code Routines: Schedule, API, and GitHub-Trigger Your AI Agents
Claude Code Routines is Anthropic's new way to run saved Claude Code configurations automatically -- by schedule, API call, or GitHub event. Routines run on Anthropic's cloud infrastructure with a prompt, repo, and MCP connectors. Available in research preview on Pro, Max, Team, and Enterprise plans.
Frequently Asked Questions
What is the `/goal` feature in Codex CLI 0.128.0?
`/goal` is a Codex CLI workflow, shipped in version 0.128.0 on April 30, 2026, that keeps a stated goal alive across turns and continues running the agent until the goal is achieved. The GitHub release notes describe persisted `/goal` workflows with app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear. As of September 2026 OpenAI's documentation calls it Goal mode, says the goal text is both the first prompt and the completion criteria, and lists it as a stable feature that is on by default.
How does `/goal` relate to the Ralph loop pattern?
Felipe Coury (OpenAI Codex team) framed `/goal` on X at launch 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. The framing rests on the X post alone; OpenAI's documentation does not use the term. As of September 2026 that post cannot be read by automated tools, so the quotation is reproduced as published on May 1, 2026 and has not been re-verified since.
Who built it?
Eric Traut, the engineer best known publicly as the lead behind Pyright (Microsoft's Python type checker). The GitHub release notes for rust-v0.128.0 list the five goal pull requests (#18073 through #18077, titled 'Add goal persistence foundation' through 'Add goal TUI UX') under the author @etraut-openai, which corroborates Felipe Coury's launch post crediting Traut.
How do I enable it?
As of September 2026 you do not need to enable it. OpenAI's config-basic documentation lists `goals` in the `[features]` table with default `true` and maturity `Stable`, described as 'Enable persisted goals and automatic continuation'. Goal mode left experimental status on May 21, 2026. To turn it off, set `goals = false` under `[features]` in `config.toml`. At launch in May 2026 the flag was not yet in the documented table and a Codex team member's reply on X pointed at `[features] goals = true`.
Which Codex surfaces support /goal?
As of September 2026, OpenAI's long-running-work documentation says to enter `/goal` in an interactive Codex CLI session, in the ChatGPT desktop app, or in the IDE extension chat. ChatGPT on the web does not have `/goal`; the docs point hosted long-running work at ChatGPT Work with the outcome and review criteria written into the prompt. Starting a goal keeps the same sandbox and approval policy and pauses when Codex needs a decision. In the CLI, goal objectives must be non-empty and at most 4,000 characters.
What else shipped in Codex CLI 0.128.0?
The rust-v0.128.0 release notes on GitHub list `codex update`, configurable TUI keymaps, plan-mode nudges, action-required terminal titles, and active-turn `/statusline` and `/title` edits in the same line. The release also expanded permission profiles, added plugin marketplace installation and plugin-bundled hooks, added external agent session import, and deprecated `--full-auto` in favour of explicit permission profiles.