OpenAI Codex Goal Mode Explained: How the AI Programming Assistant Executes Tasks Lasting Over 100 Hours

OpenAI Codex launches Goal mode, enabling AI programming assistants to execute long-running tasks until completion.
OpenAI Codex introduces the Goal feature, allowing users to set clear objectives while the AI works continuously for hours or even days until the goal is achieved. Based on the Agent architecture's "perceive-reason-act" loop with added termination condition evaluation, it forms a goal-oriented closed loop. Users can course-correct in real time via steering and monitor progress through Side Chat, while official guidance recommends setting quantifiable goals following the SMART principle for optimal results.
Article
OpenAI Codex recently launched a brand-new Goal feature that enables the AI programming assistant to work continuously for hours or even days toward a clearly defined objective. This feature is now available across the Codex app, IDE extensions, and CLI, marking a major shift in AI programming tools—from "one-off conversations" to "sustained task execution."
This shift has deep roots in technical evolution. From GitHub Copilot to ChatGPT code explanations, early AI programming tools were essentially "context-limited autocompletion," with working windows typically bounded by a single conversation or single file, unable to maintain task state across sessions. These architectural limitations gave rise to the "agentic" exploration direction—enabling AI not just to answer questions, but to decompose tasks, invoke tools, and iteratively verify results like a human engineer until the goal is achieved. Goal mode is the concrete realization of this trend, and it echoes the concentrated investment by competitors like Anthropic's Claude and Google's Jules in long-running programming agents, signaling that AI programming tools have entered an entirely new competitive dimension.
What Is Goal Mode?
Goal mode allows users to set a specific objective for Codex, which then works continuously until the goal is achieved. Unlike traditional single-turn conversations, Goal mode uses a single message as both the task initiation instruction and the completion criteria—Codex knows not only what to do, but also when it's done.
At the technical level, Goal mode relies on the core architectural paradigm of AI Agents. In traditional single-turn conversations, the model receives input, generates output, and terminates. Agent mode introduces a "perceive-reason-act" loop (the ReAct framework: Reasoning + Acting), where the model can invoke external tools such as code execution, file read/write, and test running, then adjust its next action based on tool return results. Goal mode adds "termination condition evaluation" on top of this—Codex not only executes actions but continuously assesses whether the current state satisfies the user-defined completion criteria, forming a truly goal-oriented closed loop.

Usage is straightforward: type /goal in the message editor to activate goal mode, then define the objective you want Codex to achieve.
How to Write High-Quality Goals
Set Clear, Measurable Criteria
A good Goal should have clear evaluation conditions. According to official recommendations, there are several key principles:
- Make goals quantifiable: For example, "increase test coverage to 90%" rather than the vague "improve code quality"
- Specify test pass criteria: Define which test cases must pass
- Define specific deliverables: Enable Codex to self-assess whether the task is complete
In short, the more specific the goal you give Codex, the better its execution results.
The advice to "make goals quantifiable" isn't unique to AI—it originates from the classic SMART principle in software engineering (Specific, Measurable, Achievable, Relevant, Time-bound). For AI Agents, quantifiable goals carry additional technical significance: they provide the model with a clear "reward signal"—similar to a reward function in reinforcement learning. When Codex can verify goal completion through objective means such as running test suites or checking coverage reports, the quality of its autonomous decision-making is significantly higher than when relying on vague semantic judgment. This is precisely why "achieve 90% test coverage" drives higher-quality execution results than "improve code quality."
Let Codex Help You Formulate Goals
If you're unsure how to describe your objective, there are two practical strategies:
- Use Plan mode first: Have Codex create a plan, then convert the plan into an implementation goal
- Let Codex interview you: Through Q&A, let Codex understand your requirements and set the goal itself

This "plan first, execute later" workflow essentially simulates the complete software engineering process from requirements analysis to implementation. It has deep methodological foundations, corresponding to the standard process in Requirements Engineering: "requirements discovery → requirements specification → requirements validation." When AI "interviews" users to clarify requirements, it's essentially performing Structured Requirements Elicitation, effectively avoiding the classic engineering pitfall of "vague requirements leading to implementation drift." Notably, having AI autonomously convert vague requirements into executable specifications is also the embryonic form of the "AI Product Manager" concept—AI participates not only in task execution but in task definition itself.
Interaction Capabilities During Execution
Real-Time Guidance and Course Correction
During Goal execution, users aren't limited to passive waiting. You can send additional messages through the steering feature to help Codex correct course. This means that even if the initial goal description isn't perfect, you can fine-tune it at any point during execution.
The steering feature technically corresponds to the Human-in-the-Loop mechanism—an important design principle in current AI safety. For high-risk or long-running autonomous tasks, retaining the ability for humans to intervene, correct course, or terminate at any time is crucial. Steering is not just a UX design choice; it's a safety valve preventing AI from "going further and further down the wrong path." From an engineering practice perspective, it's similar to manual approval gates in CI/CD pipelines—introducing human judgment at critical decision points rather than letting automated processes run entirely unsupervised.
Side Chat: Check Progress Without Interrupting the Task
One particularly practical design is Side Chat. You can open a side conversation to check current progress without interrupting the main task. This feature addresses the common anxiety of "not knowing where things stand" during long-running tasks.

Side Chat's design involves an elegant technical trade-off: how to allow users to query task status without polluting the main task context. In large language model implementations, conversation history directly constitutes the model's input context (context window). If user progress queries are mixed into the main task conversation flow, they could interfere with the model's understanding of task state or even trigger unexpected behavioral drift. Side Chat maintains an independent conversation thread, implementing an "observer pattern"—users can read task state without writing to it.
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.