← All writing
Writing

Using GPT-5.6 Luna at Max in Codex

AI & Agents

Update, August 2026: OpenAI's current Codex documentation lists GPT-5.6 Luna as a native subagent model and includes Luna in custom-agent examples. The Codex CLI 0.147.0 changelog also records support for leaf models in multi-agent v2. The earlier version of this article routed Luna work to a separate top-level task because native routing was not reliable at the time. That split is no longer a documented requirement when your client exposes and correctly routes Luna.

The useful pattern has three responsibility levels, but it does not require three model families. Sol can fill the whole team at different reasoning efforts. Luna and Terra are optional routes when cost, speed, or task shape justify another model.

For a multi-model team, the mapping looks like this:

  • Sol: ambiguous, difficult, high-value work that needs judgment and polish.
  • Terra: balanced implementation and supporting work that needs more context or judgment.
  • Luna: fast, narrowly scoped, repeatable, or high-volume work with known success criteria.

Reasoning effort controls how much work Luna spends on its packet. XHigh favors lower token use, cost, and latency. Max gives a hard packet more room to reason, with higher time and usage costs.

The decision isn't “Which model is best?” It is “Which model fits this packet, at which reasoning effort?”

Choose XHigh or Max

Choose XHigh when efficiency matters. Choose Max when the task warrants deeper effort and the extra latency and quota use are acceptable. Fast mode can offset some of that delay.

Start with XHigh for routine bounded work. Escalate to Max when the packet is difficult, when the result misses explicit acceptance criteria, or when deeper reasoning can materially change the answer.

One reasonable alternative is to pin Luna at Max for implementation packets that are already fully specified. Luna remains the lowest-cost model in the GPT-5.6 family, so Max can still be economical compared with a stronger model. This is a routing choice, not an OpenAI requirement.

GPT-5.6 intelligence comparison

Why Luna works as a native subagent

A long Codex task usually contains several kinds of thinking.

Some decisions shape everything that follows: architecture, product tradeoffs, scope, and final synthesis. Those decisions belong with Sol.

Other tasks are hard but bounded. The inputs are known, the output has a defined shape, and the agent can verify whether it finished. Those are good Luna subagent packets. Codex can spawn them inside the current task, collect their results, and return the useful evidence to Sol.

Examples include:

  • Scan several independent parts of a codebase and report findings against a fixed checklist.
  • Triage a test failure with named files, reproduction steps, and required evidence.
  • Compare two documents and produce a structured list of differences.
  • Extract or classify records using a supplied schema.
  • Transform source material into a required format without changing its meaning.
  • Implement a settled change inside an exact file boundary and run named checks.
  • Analyze logs for a specific failure signature and return supporting lines.

The assignment needs a boundary. “Investigate the repository” is too open. “Inspect the authentication tests, identify why these three cases fail, and return the smallest supported fix with verification” gives Luna something it can finish.

Max is useful when the packet is both bounded and genuinely hard. Easy extraction or routine transformation usually belongs at medium, high, or XHigh. Paying for Max on every Luna subagent adds time and usage unless the work benefits from it.

What DeepSWE says about bounded coding work

Luna Max gets more interesting when the packet involves serious coding work. DeepSWE broadens the case beyond extraction: its live leaderboard, updated August 13, 2026, reports 113 original long-horizon coding tasks across 91 repositories and 5 languages through the same mini-swe-agent setup.

Model and reasoning effort

Resolved

Average cost per trial

GPT-5.6 Sol Max

73% ± 3%

$8.39

GPT-5.6 Luna Max

67% ± 4%

$0.61

GPT-5.5 XHigh

67% ± 6%

$7.23

Luna Max matched GPT-5.5 XHigh's point estimate and finished 6 points behind Sol Max. Its reported average cost was $0.61, compared with $8.39 for Sol Max, or about 13.75 times lower. That is strong price and performance for a hard packet whose scope and acceptance criteria are already settled. Sol should still own architecture, conflict resolution, verification, and final synthesis.

Read the result narrowly. DeepSWE is a third-party benchmark, not an OpenAI evaluation, and the confidence intervals overlap. The small score gaps do not establish definitive rank differences. It used a standardized mini-swe-agent setup rather than Codex's native custom-agent orchestration. Its open-source tasks may not represent your codebase. DeepSWE also reports average cost per trial, so real Codex usage and plan economics may differ.

Route by task shape, not by thread type

The old rule was “Terra for subagents, Luna for separate tasks.” Current OpenAI documentation supports both Terra and Luna as native subagents. Choose between them by the work, then confirm that the spawned role reports the model and effort you requested.

Use Luna when the packet is narrow, repeatable, high-volume, or fully specified. Use Terra when the worker needs more context, judgment, or flexibility. Keep Sol in the primary task when the work needs architecture, conflict resolution, product decisions, or final acceptance.

This removes a fragile manual handoff when Luna routing is available. A Luna subagent returns its result directly to the parent task. Codex handles spawning, follow-up routing, waiting, and closing subagent threads. A separate top-level task remains useful for an older or restricted client, an independent history, stronger lifecycle isolation, or an account that does not expose Luna as a leaf subagent.

Start simple with one model family

Codex DX engineer Eric Provencher recommends a simpler baseline in Practical multi-agent orchestration in Codex. Keep the team on GPT-5.6 Sol and vary only reasoning effort:

  • Scout, Sol Low: narrow read-only questions, file discovery, code-path tracing, and test location.
  • Worker, Sol Medium: scoped implementation and routine checks.
  • Smart worker, Sol High: difficult implementation, ambiguity, and coordination.

His open-source `orchestrate` skill reduces the policy to a few rules: keep the coordinator available to the user, send fresh read-only scouts in parallel, give each agent distinct ownership, stop leaf workers from delegating, and keep approvals with the user.

This is a strong starting point when you are still learning whether delegation helps. One model family removes a routing variable. You can judge packet quality, context inheritance, ownership boundaries, and coordination overhead before you optimize model cost.

The timing matters. Provencher published the guide on July 24, 2026. Codex CLI 0.147.0 added leaf-model support to multi-agent v2 on August 7. His Sol-only baseline remains valid, but it does not mean Luna must stay outside the native subagent graph. Current OpenAI documentation now lists Luna for fast, narrowly scoped agents.

A practical sequence is:

  1. Start with Sol Low, Medium, and High roles.
  2. Measure latency, usage, correction rate, and routing reliability.
  3. Move clear, repeatable, high-volume leaf packets to Luna.
  4. Use Terra when a lower-cost balanced worker needs more flexibility than Luna.
  5. Keep Sol responsible for architecture, verification, and acceptance.

Luna Max is an optimization inside that operating model, not the prerequisite for multi-agent work.

Configure a Luna custom agent

Current Codex releases enable subagent workflows by default. Use Codex CLI 0.147.0 or a desktop or IDE build with equivalent leaf-model support. For predictable routing, define a project custom agent and pin its model and effort.

Start with a safe read-only role at .codex/agents/luna-reader.toml:

name = "luna_reader"
description = "Read-only worker for clear, bounded, and repeatable investigations."
model = "gpt-5.6-luna"
model_reasoning_effort = "max"
sandbox_mode = "read-only"

developer_instructions = """
Work only inside the supplied scope. Stop on material ambiguity instead of changing
the architecture. Run the requested checks and return exact evidence, gaps, and
judgment calls. Do not modify files.
"""

Then cap concurrency in .codex/config.toml:

[agents]
enabled = true
max_concurrent_threads_per_session = 4

Start a fresh Codex task after you add or change a custom-agent file so the client discovers the role. Spawn the named role, then inspect the reported role, model, and effort. Stop instead of accepting a silent fallback or inherited model.

Create a separate implementation role when the packet needs writes. Give it only the permission and sandbox policy that the work requires. A file-ownership instruction is a behavioral boundary, not enforced file-level isolation.

If nearly every subagent should use Luna, you can set global defaults instead:

[agents]
default_subagent_model = "gpt-5.6-luna"
default_subagent_reasoning_effort = "max"

A custom agent file is safer for a mixed fleet because it does not turn every worker, explorer, and reviewer into Luna. Settings pinned in the selected custom-agent file take precedence. If the file omits a model or effort, Codex checks an explicit spawn value, then the [agents] default, then the parent value. OpenAI's Luna model page lists Max support. If your client does not expose or accept Max, use XHigh and update the client before relying on a Max route.

Teach Codex the routing policy

Put the durable boundary in the project's AGENTS.md:

## Model routing

- Keep Sol in the primary task for planning, architecture, judgment, conflict resolution, verification, and final synthesis.
- Use Luna subagents for clear, bounded, repeatable, or high-volume packets with explicit success criteria.
- Use Terra subagents when implementation needs more context, judgment, or risk management.
- Start Luna at XHigh for efficiency. Use Max for difficult or fully specified implementation packets that benefit from deeper work.
- Give every worker explicit scope, constraints, expected output, and done evidence.
- Keep the coordinator available to the user while substantive work runs elsewhere.
- Tell leaf workers to complete their assignment directly and not spawn more agents.
- Keep product, permission, release, and other material approvals with the user.
- Keep one writer per file set. Use fresh, read-only agents for independent review.

Model guidance changes. Keep the policy short enough to revise when Codex routing changes again.

Delegate Luna inside the current task

After starting a fresh task, ask Codex to use the pinned role and state the coordination contract:

Use the luna_reader agent for this packet and wait for its result before you continue.

OBJECTIVE
Identify the cause of the duplicate-event failure in the payment webhook tests.

FILES AND OWNERSHIP
Read only the webhook handler, its tests, and directly called helpers. Do not edit files.

CONSTRAINTS
Do not redesign the payment flow. Report missing context instead of guessing.

VERIFICATION
Name the failing path, cite the relevant files and behavior, propose the smallest supported fix, and list the verification command.

RETURN
Return exact evidence, unresolved gaps, and any judgment call that should stay with the parent.

For parallel work, give each Luna subagent an independent packet. Ask Codex to wait for all workers, compare their evidence, and let Sol synthesize the result. Do not give several workers overlapping write ownership.

A working pattern in Sol Advisor

Daniel McAteer's open-source Sol Advisor is a useful implementation of this routing model. Its normal path is Sol at High for planning, Luna at Max for bounded routine implementation, parent verification, and a fresh Sol at High for review. Terra at High is the escalation path when the work is judgment-heavy, high-risk, or wider in scope.

The repository does several things well:

  • Pins model and reasoning effort in named custom-agent TOML files.
  • Uses fresh worker and reviewer contexts instead of relying on inherited conversation history.
  • Requires an exact packet with objective, ownership, interfaces, constraints, and verification.
  • Treats worker reports as claims, then makes the parent inspect the full diff and rerun checks.
  • Requires a new review after any fix invalidates the previous verdict.
  • Uses a fail-closed installer that does not overwrite modified custom-agent files.

Its repository verifier passes against the published 0.5.1 files and checks the role pins, installer safety cases, synthetic runtime-inspector fixtures, and documentation contracts. This shows that the tested files satisfy the repository's declared checks. It does not launch a real Luna subagent, measure model quality, or prove that every Codex account, client version, or policy profile will expose the same models or enforce the requested sandbox. Sol Advisor handles that gap with task-scoped preflight and runtime checks.

Its Luna Max default is also an opinionated choice. It fits fully specified implementation work, but it does not make Max the right default for every extraction, scan, or simple transformation. Measure your own latency, quota use, and correction rate.

When Luna XHigh or Max is the right choice

Use a Luna subagent when all of these are true, then select XHigh or Max based on difficulty:

  • The scope fits inside one clear packet.
  • You can state success before the worker starts.
  • The required evidence can be named.
  • The work does not require the worker to settle architecture or product intent.
  • The result can be checked by the parent.

Good candidates include test-failure triage, document comparison, structured transformations, independent codebase scans, and implementation inside settled interfaces.

It also fits repeatable delegated work. If you keep writing the same brief, turn the stable parts into a custom agent or skill. For parallel work, start with read-heavy packets. Each worker should remove a real bottleneck or protect the parent from a large body of detail.

When not to use Luna, or when not to use Max

Skip Luna when the packet needs Sol's judgment or Terra's broader implementation context. For routine bounded work, medium, high, or XHigh may be enough. Move to Max only when deeper reasoning can materially change the result or when your workflow deliberately trades more Luna reasoning for fewer escalations.

Keep Sol in charge of ambiguous architecture, product judgment, final editorial polish, and high-stakes synthesis. Luna can gather evidence and implement settled decisions, but Sol should make and verify the decisions.

Avoid parallel subagents when each step depends tightly on the previous result. Coordination overhead can exceed the time saved.

Be careful with writes. Multiple agents editing the same files can produce conflicts or incompatible fixes. Prefer read-only investigation workers, isolated worktrees, or one named owner for each file set.

Do not delegate a task with no explicit scope or clear evidence of completion. More reasoning time cannot repair a vague assignment.

Practical guardrails

A good Luna packet answers five questions before the worker starts:

  1. What exact task should this agent finish?
  2. Which files, documents, or systems are in scope?
  3. What must it avoid changing?
  4. What evidence proves completion?
  5. Which missing decision should make it stop?

Subagents inherit the parent task's permission and sandbox policy unless a custom agent overrides supported settings. Keep a worker read-only when its packet only requires inspection. If hard isolation matters, verify the policy that the runtime actually applied instead of trusting the requested configuration. Current evidence supports Luna as a leaf worker. It does not establish Luna as a nested subagent orchestrator.

Separate investigation from implementation when conflicts are possible. Several agents can inspect independent areas in parallel. The parent can then choose one implementation path and assign one writer.

Require verification. A useful worker report names what it inspected, what it found, what it changed, how it checked the result, and what remains uncertain.

Finally, make Sol review the output. Delegation moves work. It does not move accountability.

The operating model

Sol orchestrates and accepts. Luna executes bounded work inside the same task. Terra handles work that needs more implementation judgment or risk control.

Use Luna at XHigh or Max for self-contained packets with clear evidence. Use Terra when the packet is less mechanical or reveals wider complexity. Run independent read-heavy packets in parallel, keep writes controlled, and define done before any worker starts.

The important correction is simple: a separate top-level Luna task is no longer a documented requirement. When your client exposes Luna and the spawned role reports the expected model and effort, Codex can use Luna as a native leaf subagent.

Sources

Keep your team informed

Practical AI ideas, delivered where you already are.

Get occasional field notes on choosing models, building useful AI workflows, and making better decisions with the tools.

Prefer a messaging app?

Telegram and WhatsApp are broadcast-only and carry the same posts. Pick the app you prefer.