OpenAI Codex's /goal Feature: Letting the AI Decompose Tasks and Dispatch Agents on Its Own

·Toolin Editorial Team

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

"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:

  1. Generate a detailed /goal for itself automatically
  2. Write a separate goal for each sub-agent
  3. Decompose tasks and schedule parallel execution autonomously
  4. Self-check against the goal after each round until it's done

Pietro Schirano demonstrates Codex automatically creating sub-agents

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 = true

Once 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 support

Codex 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:

  1. Give Codex a vague high-level intent
  2. Codex first writes itself a detailed /goal (how to split tasks, what runs in parallel, how to merge results)
  3. Codex generates its own /goal for each sub-agent
  4. 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":

ProductFeatureLaunch DateNotes
OpenAI Codex/goalLate April 2025Free-form parallel spawning with automatic hierarchy
Anthropic ClaudeMulti-agent orchestrationMay 6, 2025Up to 20 subagents, capped at 1 layer deep
Cursor/orchestrateMay 7, 2025Deeply 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

  1. Get the project to a working prototype first, then use /goal for iteration
  2. Phrase the goal so Codex can judge whether it is "done or not"
  3. Avoid vague wording like "optimize a bit" or "polish it up"
  4. Set a token budget cap

Related articles

Hermes Desktop: The Open-Source Agent Moves onto the Desktop
AI Products

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.

Toolin Editorial Team
Kimi Work: A Local AI Agent for Knowledge Workers
AI Products

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.

Toolin Editorial Team
OpenClaw 2026.6.1: Native Windows Support at Last
AI Products

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.

Toolin Editorial Team
Step 3.7 Flash: The Agent Efficiency Model at 409 tok/s
AI Products

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.

Toolin Editorial Team
OpenSquilla 3.0: Auto-Orchestrating AI Skill Flows with MetaSkill
AI Products

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.

Toolin Editorial Team
JoyAI-Echo: JD Open-Sources a 5-Minute Long-Video Generation Framework
AI Products

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.

Toolin Editorial Team