OpenAI Codex's /goal Feature: Letting the AI Decompose Tasks and Dispatch Agents on Its Own
Codex's new self-generating goal feature: humans supply the intent, and the AI automatically decomposes tasks and dispatches subagents to execute them


OpenAI Codex's /goal Feature: Letting the AI Decompose Tasks and Dispatch Agents on Its Own
Codex's new self-generating goal feature: humans supply the intent, and the AI automatically decomposes tasks and dispatches subagents to execute them
"I basically never write /goal myself anymore." That line from Pietro Schirano — a former Anthropic member and current CEO of MagicPath — set the developer community on fire. Codex's /goal feature is changing how coding gets done: humans supply the intent, and the AI decomposes tasks, dispatches sub-agents, executes, and verifies on its own. This article unpacks the feature's core playbook and its caveats.
What Is /goal
/goal is a new self-generating goal feature in the OpenAI Codex CLI (version 0.128.0). Once enabled, you only need to give a high-level intent, and Codex will:
- Generate a detailed /goal for itself automatically
- Write a separate goal for each sub-agent
- Decompose tasks and schedule parallel execution autonomously
- Self-check against the goal after each round until it's done

Developers call this loop the "Ralph loop": plan, execute, test, review, iterate — it keeps spinning on its own and won't stop until the goal is met.
How to Enable It
/goal is currently disabled by default and must be turned on manually.
In the Codex CLI config file config.toml, add the following setting:
[features]
goals = trueOnce enabled, type /goal in the Codex CLI to start using it.
Core Usage
Basic Usage: Give a One-Line Intent
Skip the detailed task list and just state your high-level intent:
/goal Implement a complete user authentication system, including sign-up, login, and password reset, with JWT and OAuth supportCodex will automatically decompose this into multiple subtasks and generate a corresponding /goal for each one.
Advanced Usage: Let Codex Write the /goal Itself
Schirano's approach is more radical: he doesn't write the /goal — he has Codex generate it. The concrete steps:
- Give Codex a vague high-level intent
- Codex first writes itself a detailed /goal (how to split tasks, what runs in parallel, how to merge results)
- Codex generates its own /goal for each sub-agent
- The sub-agents execute their tasks automatically
Templating: The Build [THING] Framework
Developer Pablo Stanley turned this playbook into a template whose core structure is:
Build [THING]
- Feature 1
- Feature 2
- Feature 3
Style: [description]Codex follows this framework to generate the goal automatically, then hatches the corresponding sub-agents.
A Real Case: 18 Hours Unattended
One developer put it to the test: give Codex the high-level goal — deliver all 18 features in BACKLOG.md — and then leave.
About 18 hours later they came back:
- Codex had autonomously implemented 14 of the features
- Every change passed the tests
- Everything merged automatically in CI
- Not a single human intervention the whole way
- Total cost of about $4.20
Three Products, Same Direction
It's not just Codex — all three mainstream coding agents are pushing "let the AI decompose tasks itself":
| Product | Feature | Launch Date | Notes |
|---|---|---|---|
| OpenAI Codex | /goal | Late April 2025 | Free-form parallel spawning with automatic hierarchy |
| Anthropic Claude | Multi-agent orchestration | May 6, 2025 | Up to 20 subagents, capped at 1 layer deep |
| Cursor | /orchestrate | May 7, 2025 | Deeply integrated with the Cursor editor |
The community has pointed out that Claude's coordinator deliberately limits itself to one layer of depth, while Codex's free-parallel approach reflects a different design philosophy.
Open-Source Tool Pick: Infinite Skills
A developer known as RTK packaged the /goal best practices into an open-source skill called Infinite Skills.
Its goal skill interviews you in reverse before you actually fire off /goal, interrogating a vague goal into a specific, verifiable contract.
Caveats
Massive Token Consumption
Andrew Chen of a16z ran a real project overnight and pointed out: automatically spawning agents can multiply token usage ten-thousand-fold.
A session where you manually prompt 20 times and watch each response tops out at a few hundred thousand tokens; a session running 14 hours with no human in the loop is on a completely different order of magnitude.
Recommendation: add a token budget limit at the end of the /goal, such as "budget no more than $5".
Goal Drift
When the AI writes its own goals, things can drift off course mid-run. The main issues reported by the community:
- Goal drift: the agent gradually veers away from the original intent during execution
- Laziness: the agent may gravitate toward whatever shortcut is easiest
- Vague acceptance criteria: if the goal contains hollow phrases like "optimize a bit" or "polish it up," the agent struggles to judge whether it's finished
Recommendations
- Get the project to a working prototype first, then use /goal for iteration
- Phrase the goal so Codex can judge whether it is "done or not"
- Avoid vague wording like "optimize a bit" or "polish it up"
- Set a token budget cap
Toolin Editorial Team
Categories
Related articles

Hermes Desktop: The Open-Source Agent Moves onto the Desktop
Nous Research launches Hermes Desktop, an open-source desktop agent covering macOS/Windows/Linux that reuses the CLI agent's full skills and memory — usable with just mouse clicks.

Kimi Work: A Local AI Agent for Knowledge Workers
Moonshot AI launches a desktop general-purpose Agent with Agent clusters, browser control, and financial data sources, letting office workers handle their daily work with AI.

OpenClaw 2026.6.1: Native Windows Support at Last
The world's largest open-source AI Agent project ships a major update: native Windows support, a Skill Workshop that lets Agents self-evolve, and multi-Agent Workboard collaboration — 1.6 billion PCs become compute nodes.

Step 3.7 Flash: The Agent Efficiency Model at 409 tok/s
StepFun's new model hits 409 tokens/s output speed, costs 1/9 of Claude Opus 4.6 per task while matching 97% of its coding ability, and is designed for high-frequency Agent call scenarios.

OpenSquilla 3.0: Auto-Orchestrating AI Skill Flows with MetaSkill
The open-source AI Agent framework OpenSquilla 3.0 introduces MetaSkill, which synthesizes multi-step workflows from natural language, paired with intelligent model routing to cut usage costs.

JoyAI-Echo: JD Open-Sources a 5-Minute Long-Video Generation Framework
JD open-sources JoyAI-Echo, its first long audio-video generation framework, attacking the three big problems of character consistency, voice stability, and generation speed head-on, leading on multiple metrics.