OpenAI Codex Goal Mode is generally available since May 21. Set a persistent objective, Codex enters plan-act-test-review loop for hours. How it works, pricing, and when to use it over Claude Code.
OpenAI Codex Goal Mode lets you describe a software objective at 9am and come back at noon to a working implementation. That is the pitch, and after a 6-week closed beta, it is now live for all ChatGPT Plus, Pro, and Team subscribers as of May 21, 2026. Five million weekly active Codex users means this is not a niche feature — it is becoming the default way a significant portion of developers interact with AI coding tools.
The critical distinction between Goal Mode and standard Codex sessions: persistence. A standard Codex session is reactive — you ask, it responds, you approve each step. Goal Mode is proactive — you define a terminal objective, Codex builds a plan, executes it step by step, runs tests after each change, handles failures autonomously, and keeps going until the goal is achieved or it hits a blocker requiring human judgment.
How Goal Mode Works Technically
Goal Mode operates on a four-phase loop that runs without user input until completion or intervention:
- Plan phase: Codex reads the repository structure, identifies relevant files, and builds a step-by-step execution plan. This plan is shown to you before execution begins — you can edit it, approve it, or abort. Average plan generation time: 45–90 seconds for a medium-sized repository.
- Act phase: Codex executes plan steps sequentially, writing code changes to a sandboxed working copy of your repository. It does not touch your main branch until the goal is complete.
- Test phase: After each significant change, Codex runs your existing test suite (pytest, Jest, cargo test, or whatever is configured in your repo). Failures trigger the Review phase.
- Review phase: On test failure, Codex reads the failure output, forms a hypothesis, and either tries an alternative approach or surfaces a blocker message if it determines the failure requires human context to resolve.
The loop runs asynchronously. You do not need to stay in the browser. OpenAI sends a notification (email or push) when the goal completes, hits a blocker, or reaches a configurable timeout (default: 4 hours, max: 12 hours).
The 6 New Role Plugins
Goal Mode launched GA with six role plugins that configure Codex’s behavior for specific engineering tasks:
| Plugin | Optimizes for | Typical goal type |
|---|---|---|
| RefactorBot | Safe large-scale refactoring | “Migrate all uses of deprecated API X to the new API Y” |
| SecurityAuditor | Vulnerability identification + patching | “Find and fix all SQL injection vectors in the query layer” |
| TestWriter | Test coverage expansion | “Bring authentication module coverage from 40% to 85%” |
| DocBot | Documentation generation | “Generate JSDoc for all exported functions in src/api/” |
| MigrationGuide | Dependency upgrades | “Upgrade from React 18 to React 19, fixing all breaking changes” |
| PerformanceProfiler | Code optimization | “Reduce P99 latency in the order processing pipeline by 30%” |
Each plugin changes the underlying system prompt Codex uses, adjusting how cautious it is with changes, how aggressively it tests, and what kinds of interventions it surfaces to you. SecurityAuditor, for example, surfaces every potential issue as a blocker rather than auto-patching — because patching a security vulnerability without developer review is a trust boundary violation even in an agentic context.
Comments · 0
No comments yet. Be the first to share your thoughts.