Setting Up Luna Max as a Sub-Agent in Codex

Explore how to set up Luna Max as a sub-agent in Codex to enhance performance and reduce task execution costs.
Setting Up Luna Max as a Sub-Agent in Codex
In the benchmark DeepSWE, Luna Max scored 67% compared to 73% for Sol Max. Meanwhile, the average cost of executing a single task was nearly 14 times lower: $0.61 versus $8.39. Therefore, it makes sense to delegate specific well-defined tasks to Luna.
Prompt:
Create a custom agent luna_worker in the file ~/.codex/agents/luna-worker.toml.
Use the following settings:
model = "gpt-5.6-luna"
model_reasoning_effort = "max"
Add a description and instructions for performing clearly defined delegated tasks. Do not change the rest of the configuration. Check compatibility with the version of Codex I have installed, show the diff, and then use luna_worker for sub-agent tasks.
Alternative Option
Another option is to do without the custom agent file. Keep Sol in the main thread and ask her to launch a separate Luna Max thread for each task.
In Codex, a thread is a separate dialogue with its own context. Multiple threads can run in parallel, and Sol collects their results in the main thread.
Why it matters
AnalysisThis is important as setting up sub-agents in Codex can significantly enhance operational efficiency and reduce task execution costs.
Discuss in community
Share your questions and insights with developers
Related in Ecosystem
Practical guides, core terminology, and agent skills
Migrating from Claude Code to Codex: How to Move CLAUDE.md, MCP, Skills, Slash Commands, and Settings
Complete engineering guide on migrating from Claude Code to OpenAI Codex CLI: porting CLAUDE.md to AGENTS.md, configuring MCP, sandboxing, hooks, and retaining Claude models.
Codex Skills for Beginners: Automating AI Agent Workflows
A comprehensive hands-on guide to building and executing Codex Skills: SKILL.md anatomy, explicit vs. auto-triggering, skills vs. scripts vs. tools, Skills API, and safety boundaries.
Binance publishes investigation into $6.3 billion theft
Binance’s investigation links the theft to a modified Homebrew download, a fake interview and abuse of an internal AI tool.
Reddit user explains why Claude Code weekly limits are burning almost 4x faster
A Reddit user compared token usage across two weeks and found that each 1% of Claude Code's weekly limit now yields far fewer output tokens, pointing to subagents, reasoning time, and UI refresh requests as likely causes.