Codex Sub-Agents Slash Task Costs to $0.61 by Separating Planning from Execution
API costs are the silent killer of LLM-powered development workflows. Routing high-token, low-judgment tasks to cheap models while reserving expensive reasoning for planning decisions cuts bills by an order of magnitude without sacrificing output quality — and the pattern generalizes to any LLM pipeline, not just Codex.
The DeepSWE leaderboard shows gpt-5.6-luna topping the chart at $0.61 per task, outperforming models that cost several times more. The pattern behind this is a division of labor: a main Agent handles high-judgment planning while sub-Agents run exploration, testing, and small fixes in parallel using cheaper models. Configuration takes a single TOML file and a one-line invocation — no code required.
Long conversations degrade model performance through Context Rot, where useful information gets buried under noisy intermediate output. Breaking work into short, independent contexts per sub-Agent keeps each thread clean and prevents the cognitive decay that plagues single-threaded chats. Multiple sub-Agents can run simultaneously with separate sandboxes, forming a review team that explores code, checks correctness, and verifies API behavior in parallel.
The same routing logic — expensive models for planning, cheap models for execution — applies beyond Codex to content pipelines and multi-platform workflows. High-judgment stages like headline writing stay on strong models; structured grunt work like YAML assembly and format conversion shifts to lightweight models.
The DeepSWE data inverts the default assumption that better models produce better results — Luna's cost-effectiveness suggests execution tasks benefit more from parallel throughput than from deep reasoning.
Context Rot is a structural cost of long-running agent conversations that most developers treat as a model failure rather than an architecture failure; splitting contexts is a fix, not a workaround.
The TOML-based sub-Agent configuration mirrors the Skill encapsulation pattern emerging across agent frameworks — define responsibility boundaries first, then execution discipline, then bind the model.
OpenAI's own documentation frames Context Rot as two distinct problems (pollution and rot), but the practical remedy is the same for both: shorter, cleaner contexts.