OpenAI's Codex CLI Adds /goal Command for Long-Horizon Autonomous Coding

AI Bot
By AI Bot ·

Loading the Text to Speech Audio Player...

OpenAI shipped Codex CLI v0.128.0 on April 30, 2026, introducing a new experimental slash command, /goal, that turns the coding agent into a long-horizon autonomous worker. Once a goal is set, Codex plans, edits files, runs tests and iterates in a loop until it judges the objective complete or hits the configured token budget — without further prompting from the developer.

Key Highlights

  • New /goal <objective> slash command persists across turns, with pause, resume and clear controls in the terminal UI.
  • Goals are tracked through explicit lifecycle states: pursuing, paused, achieved, unmet and budget-limited.
  • Release adds app-server APIs, model tools and runtime continuation so goals survive restarts and can be managed remotely.
  • Demonstrations on social media show single goals running for more than 11 hours of unattended execution.

Details

The release notes describe "persisted /goal workflows with app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear." Internally, the agent injects two prompt templates — goals/continuation.md and goals/budget_limit.md — at the end of each turn, instructing the model to either keep iterating or stop cleanly when limits are reached.

Developer Simon Willison described the feature as Codex's adoption of the so-called Ralph loop, a pattern where an AI agent cycles through plan, act and verify steps with explicit stopping conditions rather than waiting for fresh human instructions on every iteration. To enable it, users update the CLI to v0.128.0 or higher and add goals = true under a [features] section in ~/.codex/config.toml, then issue /goal: your objective here from the CLI.

OpenAI initially scoped the command to the CLI, with desktop app support deferred to a later release. A known issue, tracked as GitHub issue #20591, reports that the slash command does not yet activate in some 0.128.0 environments — a documentation issue, #20536, asks the team to publish a formal lifecycle reference.

Impact

The launch lands during what OpenAI is calling its strongest model release ever. The company said API revenue from GPT-5.5 is growing more than twice as fast as any prior launch, and Codex revenue doubled in under seven days. Codex is now reported to serve more than four million developers per week, with rapid month-over-month growth driven by enterprise adoption of agentic coding tools.

By making goals a first-class object — with persistence, lifecycle states and remote APIs — Codex is positioning itself as an execution engine rather than a chat companion. That shift moves the developer's role from prompting line-by-line to defining objectives, granting permissions and reviewing outcomes. It also intensifies the head-to-head between Codex and rival agentic platforms such as Anthropic's Claude Code.

Background

Codex CLI has shipped weekly releases throughout 2026, layering plugin support, multi-agent orchestration and security tooling onto the original coding assistant. Earlier versions added a plugin marketplace and a MultiAgentV2 mode with explicit thread caps and subagent hints. The /goal release brings those primitives together by giving any plugin or sub-agent a durable objective to pursue across sessions.

The Ralph loop concept itself has circulated in agent research for over a year, with open-source projects such as autoresearch experimenting with similar continuation patterns. OpenAI's contribution is productizing the loop inside a mainstream developer tool with permission profiles, sandboxing and runtime governance baked in.

What's Next

OpenAI has signaled that goal management will eventually land in the Codex desktop app for visual monitoring of multiple agents at once. Expect deeper integrations with the Codex app-server APIs so that CI systems, schedulers and external orchestrators can launch and inspect goals programmatically. As more teams hand entire features and refactors to autonomous loops, the operational questions — budgets, audit trails, rollback and approval — will move from research papers into mainstream engineering practice.


Source: OpenAI Codex Changelog


Want to read more news? Check out our latest news article on France 2030: First 23 Laureates of the 'AI Pioneers' Program Unveiled.

Discuss Your Project with Us

We're here to help with your web development needs. Schedule a call to discuss your project and how we can assist you.

Let's find the best solutions for your needs.