Codex CLI 0.128.0 Adds /goal Command: The AI Coding Agent That Won't Stop Until the Job Is Done

Codex CLI's new /goal command enables autonomous looping execution until goals are achieved or token budgets are exhausted.
OpenAI's Codex CLI 0.128.0 introduces the /goal command, enabling the AI coding agent to autonomously loop through tasks until a high-level goal is achieved or a token budget is depleted. Built on just two markdown prompt files, the feature implements agentic engineering through prompt-as-program design, representing a significant step in coding agent evolution from single-step tools to persistent, goal-driven collaborators.
Codex CLI 0.128.0 Adds /goal Command: The AI Coding Agent That Won't Stop Until the Job Is Done
When AI learns to never give up until the goal is met, developers' wallets start trembling.
OpenAI's Codex CLI coding agent just released version 0.128.0, bringing an eye-catching new feature — the /goal command. In short, Codex CLI has graduated from its obedient "you say a step, I take a step" mode and evolved into an autonomous agent that can lock onto a target and grind until it's done. While the update may seem small on the surface, the design philosophy behind it deserves serious attention from every developer following AI coding tools.
What Does the /goal Command Actually Do?
Previously, using Codex CLI went something like this: you gave it a task, it completed one step and politely waited for your next instruction — like a well-behaved intern.
Now with /goal, the dynamic has completely changed. You set a high-level goal description, like "get test coverage for this module up to 90%" or "fix all TypeScript type errors," and Codex enters a continuous loop mode: it completes one round, self-evaluates whether the goal has been achieved, and if not, keeps going — until one of two things happens: the goal is completed, or your configured token budget runs out.
This concept isn't an OpenAI original. A community developer named ghuntley (Geoffrey Huntley) previously proposed something called the Ralph loop, whose core idea is to have an AI agent work like a tireless worker — completing a round, automatically assessing the gap, then continuing the loop. Codex CLI's /goal is essentially the official implementation of this community idea.
A good open-source community is like a never-sleeping product management team — except they don't want a salary, they just want you to turn their ideas into features.
Two Markdown Files Powering an "Autonomous Loop"
What's most fascinating is that this seemingly sophisticated "autonomous loop" mechanism is powered by just two markdown files at its core:
- continuation.md: Responsible for injecting prompts at the end of each conversation round, asking the model the hard question — "Is the goal complete? If not, keep going." It guides the model to evaluate the gap between the current state and the target, then decide what to do next.
- budget_limit.md: Responsible for hitting the brakes when token consumption approaches or reaches the budget limit, notifying the model "funds are running low, stop and report your progress."
Put plainly, this is implementing a while(!done && wallet.balance > 0) loop through prompt engineering. Elegant enough to applaud, simple enough to laugh at.
This is also a highly representative design philosophy in current AI agent development — "prompts as programs." No need to write complex control flow code; a few carefully designed prompt templates can drive autonomous looping behavior. This is the practice of agentic engineering: designing the agent's decision loop, tool-calling mechanisms, and goal evaluation logic to give AI the ability to autonomously plan and iterate.
Token Budget: Poverty as the Last Line of Defense Against AI Going Rogue
However, letting AI loop through tasks on its own comes with an unavoidable real-world concern — money.
Tokens are the basic unit LLMs use to process text. Every API call consumes tokens, and tokens cost money. If you set a goal like "refactor the entire project" with no budget limit, you might wake up the next morning to find your OpenAI bill higher than your mortgage — a picture too beautiful to contemplate.
That's why the token budget design is the true safety rope for the /goal feature. You can set a token consumption cap for each task, and the agent will automatically stop execution and report current progress when cumulative consumption hits the limit. This isn't just a technical safeguard — it's one of the core challenges of cost control in agentic engineering.
After all, an autonomous looping agent without a budget limit is just as dangerous as a credit card with no spending cap.
The Evolution of Coding Agents
From a broader perspective, Codex CLI's /goal feature represents an important evolutionary direction for coding agents.
Early AI coding tools, like the original GitHub Copilot, were essentially code completion — you write half a line, it finishes it for you. Later they evolved to understand context and operate across files. Now, the new generation of coding agents represented by Codex CLI, Anthropic Claude Code, Cursor, and Devin can understand high-level task descriptions, autonomously plan implementation steps, navigate file systems, execute command-line operations, and iteratively correct based on execution results.
The arrival of /goal pushes this evolution one step further: from "can autonomously execute single-step tasks" to "can autonomously loop through multi-step tasks until the goal is achieved." The gap between these is like the difference between "can run 100 meters" and "can run a marathon."
Of course, this feature is still in its early stages. In practice, the granularity of goal-setting, accuracy of evaluation, and reliability in complex projects all await large-scale community validation. But the direction is clear — AI coding agents are transforming from "tools" into "colleagues."
AI has evolved from "you say a step, I take a step" to "point me in a direction and I'll run on my own." The only safety rope is your token balance — this is probably the first time in human history that poverty has become the last line of defense against AI going rogue.
Sources: Simon Willison's Weblog, GitHub: openai/codex
Related articles
Tech FrontiersA Rare Quiet Day in AI: Recursive Self-Improvement Stirs Beneath the Surface
A rare quiet day in AI sees multiple sources go silent simultaneously. Behind the calm, Recursive Self-Improvement (RSI) research continues. What this means for the industry.
Tech FrontiersReve 2 vs. Ideogram 4: A Deep Dive into Layout Control in AI Image Generation
A deep comparison of Reve 2 and Ideogram 4's layout control capabilities, covering technical approaches, real-world use cases, and industry trends for designers and creators.
Tech FrontiersIn the Weights: Check Your Influence Score in the AI World
In the Weights is an AI influence search engine that quantifies your presence in the AI world with a score. Explore how it evaluates practitioners and what it means for digital identity.