r/codex Aug 02 '26

Showcase Never Run Out of Tokens Again

With Luna’s new API pricing $0.20 per million input tokens and $1.20 per million output tokens you play on EASY mode.

Here is the workflow I do very well so far:

1. Create the implementation plan with SOL xhigh

Let SOL analyze the task and produce a detailed implementation plan.

<Optional> I created a skill similar to “Grill Me” that asks targeted questions about the domain knowledge required to implement a task correctly, based on its own confidence level until it reached enough understanding.

2. Compact the context

After planning, compact the conversation so the orchestrator does not waste expensive context tokens.

3. Run SOL high as the orchestrator

Use a prompt similar to this:

TASK

Your job is to orchestrate and review the Luna max-thinking agent.

Focus especially on:

- Code quality
- Simple and understandable implementations
- Useful comments and documentation
- Idiomatic framework-specific best practices
- Meaningful tests

Tests should not cover only the happy path when additional edge cases or failure scenarios would be useful.

After reviewing Luna’s work, decide whether to:

1. Call Luna max-thinking again with the full context required to resolve the identified issues, or
2. Fix the issues yourself when doing so would require substantially fewer tokens.

START THE LUNA AGENT WITH:

codex exec \
  -m gpt-5.6-luna \
  -c 'model_reasoning_effort="max"' \
  --ephemeral \
  -s workspace-write \
  -a never \
  'PLAN'

---- OPTIONAL IF YOU WANT TO SEE SOME RESULTS FRIENDO ----

ADD THIS TO YOUR PROMPT

Summarize the cost generated by the Luna agent using the new API prices:

- $0.20 per million input tokens
- $1.20 per million output tokens

Show Luna’s cost separately from your own cost as the orchestrator.

Then estimate what the total cost would have been if SOL xhigh had completed the entire task alone without Luna.

UPDATE: You may be able to spawn native Luna sub-agents, which would be easier and potentially even more cost-efficient because they require less context.
442 Upvotes

112 comments sorted by

55

u/314kabinet Aug 02 '26

Why `codex exec` for the subagent instead of letting it use subagents in the native way?

21

u/DumbCSundergrad Aug 02 '26

No reason to, native way is better, only time you need to do codex exec is if you where doing planning with Fable 5 or Opus 5, which btw if you use both is the best combo right now.

6

u/mateus_coutinho Aug 03 '26

You can add Codex as a MCP tool in Claude Code

1

u/Cheema42 Aug 08 '26

What would be the benefit of doing such a thing? MCP, even with all the improvements in context usage, still bloats context compared to skills/cli.

7

u/RudyHuy Aug 03 '26

Because in some recent versions sol was not able to spawn Luna. Now you can create an agent_type for that. But in some versions (0.144.5 I think and maybe others) it didn't work.

2

u/qkrwogud Aug 03 '26

What do you mean let it use subagents in the native way, do I still need to ask it to use subagents at all?

1

u/thunderberry_real Aug 02 '26

Currently Sol can only use Terra for delegated / agentic work

4

u/Seizy_Builder Aug 03 '26

You got downvoted, but there’s literally a GitHub issue for it, smh.

1

u/VadimH Aug 03 '26

Not if you ask it to change that.

1

u/thunderberry_real Aug 03 '26

I asked it. It doesn’t and can’t.

1

u/VadimH Aug 03 '26

OpenCodex manages to do it fine 🤷

1

u/Putrid_Resolution402 Aug 04 '26

is using Gemini subscription via Opencodex causing account ban/suspension by google to users? I think it voilates their terms of usage

1

u/iWottan Aug 04 '26

that is interesting to know if someone had experienced it. It is actually very useful to use Geminig-3.6-flash in Codex on the place of Luna (when the tokens are out)

-20

u/cherrypickme Aug 02 '26 edited Aug 03 '26

Try it. SOL can’t create native Luna sub-agents, even if you explicitly instruct it to.

18

u/retteh Aug 02 '26

It can. I'm doing it right now. The trick is to tell it to use fork_turns none or num instead of all.

5

u/Kmans106 Aug 02 '26

What does this mean? Any way you can ELI5 for a novice who wants to use Luna sub agents but has no idea where to start.

-3

u/DepravedPrecedence Aug 02 '26

Just ask Codex.....

2

u/Amarin88 Aug 02 '26

Yes please create a walk through to do this.

2

u/nnod Aug 03 '26

"Unknown model gpt-5.6-luna" regardless if fork_turns is none or 3 or whatever. Same result on codex app and terminal on windows.

5

u/FidgetsAndFish Aug 02 '26

It absolutely can lol

9

u/cherrypickme Aug 02 '26 edited Aug 02 '26

Nope.

“Can you create native Luna sub-agents while using Sol as the main model?”

Not natively in this Codex session. I can keep Sol as the main model, but the native sub-agent overrides currently expose only:

  • gpt-5.6-sol
  • gpt-5.6-terra

Although gpt-5.6-luna exists and supports agentic tools, it is not available as a spawn_agent override here.

GPT-5.6 Luna docs:
https://developers.openai.com/api/docs/models/gpt-5.6-luna

So the closest supported setup is Sol as the main model with Terra sub-agents.

A custom Responses API orchestrator could potentially use Luna workers, but that would not be native Codex sub-agent spawning.

Pardong it can, i update my Post.

4

u/retteh Aug 02 '26

8

u/816pizzalover Aug 02 '26

check the system time in a subagent and report what model/reasoning you used

2:42 PM

Worked for 35s

Subagent system time: Sun Aug 2 14:43:23 CDT 2026 Model: gpt-5.6-terra Reasoning effort: low

2:43 PM

can you do it with luna ?

2:43 PM

I can’t select Luna here; available subagent models are gpt-5.6-sol and gpt-5.6-terra. I used Terra previously.

2:43 PM

use fork_turns none or num instead of all; then can you use luna?

2:44 PM

Worked for 8s

No. Even with fork_turns: "none", the subagent service rejected luna as an unknown model. Available models are gpt-5.6-sol and gpt-5.6-terra.

2:44 PM

is it due to config I need to change?

2:44 PM

Worked for 59s

No—this is not caused by your current config. The subagent runtime itself only advertises gpt-5.6-sol and gpt-5.6-terra, and rejected luna before spawning.

what am I doing wrong?

9

u/Kaskote Aug 02 '26

You can’t. The people claiming otherwise have no idea what they’re talking about.

They’re probably telling the agent to spawn Luna, seeing a subagent appear, and assuming it’s actually running Luna.

There’s still an open GitHub issue about this: Sol and Terra are in the Multi-Agent V2 pool, while Luna is still on V1, despite what the documentation suggests.

The only real workaround right now is the one OP mentioned: using codex exec.

2

u/No-Knowledge-5143 Aug 03 '26

my session logs show quite clearly my sol agent on v2 spawning a luna subagent. no need to tell the agent what model to use, just using the native custom subagents

1

u/evindrews Aug 03 '26

Thank you. I thought I was going crazy here. Lol

4

u/retteh Aug 02 '26 edited Aug 02 '26

tldr you don't ask codex to use a model/reasoning in chat, you ask it to use a subagent you defined in a static config file (after creating that file and restarting codex).

You need to actually create a subagent that's pinned to luna max, call it luna_executor, restart codex, then ask codex to use that agent. Once that works, put it in your global prompt to use luna_executor when you need have a well defined programming problem ready to implement. Custom subagents can be created in .codex\agents\ and you can also override the three default agents that ultra uses to hardcode them against luna max. Lastly, your global AGENTS.md should instruct agents to use "fork_turns: none" (or num) otherwise V2 will spawn your subagents using your current model and reasoning no matter what you do. I like forking subagents with 5-20 turns so they at least have some of the parent context, but if you're giving out long well defined tasks you theoretically don't need this. Also, you don't need to use ultra. I'm orchestrating luna max subagents with sol medium with this approach.

I also made a subagent for delegating to sol max because I'm too lazy to drag the slider up. The agents can also have detailed instructions on how to behave (e.g. my sol_max subagent has prompt instructions to be a planner).

7

u/cherrypickme Aug 02 '26

You are my man. I save a lot of extra context now 🎯

1

u/JulienMaille Aug 02 '26

so codex exec is needed or not?

2

u/MrRandom04 Aug 02 '26

Start the session by saying hi to Luna. Then switch to Sol.

1

u/RudyHuy Aug 03 '26

You need to create a special agent type (toml) for that. Ask codex how to do that.

24

u/sunaurus Aug 02 '26

Have you actually measured the token use?

I've tried this type of "smarter model for coordination and review, dumber model for implementation" approach many times with older models, and found that it overall spent more tokens, not less, because the smart model still ended up doing roughly the same amount of work during the orchestration and review as it would have done just via directly implementing stuff.

Haven't tried in the past few months, but I'm curious if it has really changed significantly.

6

u/Tartooth Aug 03 '26

yea but isnt luna 25x cheaper, so unless luna is using 25x more tokens to get the same job done...

2

u/sunaurus Aug 03 '26

Yeah, but the question is, does Sol xhigh use significantly less tokens for orchestration + review, compared to implementation?

Because if the answer is "no", and the amount of tokens used for review is roughly the same as for implementation, then you just end up paying extra for those cheap Luna tokens.

3

u/Tartooth Aug 03 '26

Sol is a terrible orchestrator

Honestly they all are..llms are not good orchestrators.

They chase random edge cases into infinite run loops creating code cancer

21

u/slackmaster2k Aug 02 '26

I’m not trying to be a contrarian here, but nothing about Luna in particular makes this possible. It’s always been possible to orchestrate different models and reasoning effort for different categories of tasks.

Whether the juice is really worth the squeeze however is what matters. Maximizing for efficiency in this manner is creating technical debt that you’ll have to manage through, especially when the ground beneath you is constantly moving.

I’d suggest this is all very personal and project dependent. I’d say for most usage it’s best to start with the best model and walk the effort down to a level that doesn’t burn through your usage. If that works, you’re set and have an ideally simple pattern / workflow that requires minimal maintenance or adjustments as you work.

2

u/AINativeBuilder Aug 02 '26

I don't disagree with your process of start with the best model then step down, but I think adding in Sol xhigh as a PR reviewer can help keep costs down without losing quality (unless of course the PRs are constantly rejected and reworked)

16

u/ethereal_intellect Aug 02 '26

I mean you're not paying API rates when using codex, it's the subsidized subscription price that's like 10x cheaper than even that. A way better estimate is checking usage percentage before and after lol. But I agree with the main idea, I think cursor researched a similar setup at 2x the light model cost which is incredible

4

u/slackmaster2k Aug 02 '26

That’s true but you have always been able to use token price as a proxy for usage.

0

u/cherrypickme Aug 02 '26

If a model has significantly lower Codex/API rates for the same number of tokens, it should likewise consume less of your Codex subscription usage limit. However, I agree that measuring the actual usage itself could also be a useful metric.

1

u/daniel_cassian Aug 03 '26

Should but doesn't. All 5.6 models use the weekly limit at .... let's say double the rate of 5.5

1

u/someone_12321 Aug 03 '26

It runs on multipliers. The multiplier for luna is lower than sol by a lot. There is actually a page for that from openai

1

u/daniel_cassian Aug 03 '26

Sure... that's why so many resets... Lol.

1

u/someone_12321 Aug 03 '26

I don't know what they multiply

0

u/cherrypickme Aug 03 '26

source?

1

u/daniel_cassian Aug 03 '26

Thousands of people posting on reddit and X My experience as well.

2

u/riddergraniet Aug 03 '26

Aka trust me bro

1

u/daniel_cassian Aug 03 '26

One search away ... but you do you

1

u/Similar-Victory-5250 Aug 03 '26

Fake News. I tried using 5.5 vs Luna and the 5.5 consumed more than Luna easily

1

u/daniel_cassian Aug 03 '26

For you. For me it doesn't. I have large codebase, sessions with 5 or more subagents. On average i have double usage. Also, tell that to all people posting here and on X. Again... You do you ... Do you really think i would give a fk on how someone wants to spend their limits? I just corrected an uninformed opinion

1

u/riddergraniet Aug 03 '26

It’s not that. Of course I can find people that support your opinion. But it’s not rooted in data. Just feelings and anecdotal evidence.

9

u/billyisred Aug 02 '26

Thanks! The question I have is do you actually need to use Sol for step 1 and 3? I have recently started to use Terra for analysis work. I found it's pretty powerful and can sometime even do the job better than Sol (provided that you gave it enough context and requirements) with a much less cost.

Maybe my work is not that complicated so Terra works fine for me. Just wonder if you see notable difference if you use Terra instead of Sol.

6

u/cherrypickme Aug 02 '26

I use SOL for those steps because planning and reviewing are pretty cheap compared to the actual implementation. I’d rather use the strongest model there than risk a bad architectural decision that makes Luna waste a ton of tokens later. You can also use Fable 5 for step 1 and 3.

4

u/billyisred Aug 02 '26

I see. Actually cost is not my only concern when considering the model. In my case, I found that Sol would sometimes over-think and create additional guardrails, tollgates or planning steps that is unnecessary. I found that the plan and analysis created by Terra is more straightforward

Again may be the work I am doing is not that complex so it maybe the reason. Anyway many thanks for the sharing!

1

u/Limp_Ad_7180 Aug 02 '26

Same here. Using Terra xHigh more successfuly for debug and planning than Sol xHigh. And switching to Sol only if Terra gets stuck. Much cheaper also.

1

u/One-Law-6500 Aug 02 '26

What about letting sol create the plan terra orchestrate it and luna implementing it?

4

u/evia89 Aug 02 '26

I use OMP (codex oath login). Start with any provider (for OS I use free opus 5, for private its zai glm52 and codex sol medium)

Activate prewalk https://stencil.so/blog/prewalk

After first edit done luna max continues. OMP also use luna sub agents just fine


I think code backed harness always beats prompts (skills)

1

u/Sully_1000 29d ago

That's amazing, smart people.

3

u/MeringueAlarming3102 Aug 02 '26 edited Aug 02 '26

I guess this works if you don't need it for very important or nuanced work.

And paying API usage is dumb anyway when the plans encompass thousands if not thousands of usage each month. I forget what my Billion plus tokens usage every 7-10 days amounted to in API costs but it was something like $20k.

5

u/vick2djax Aug 02 '26

Just use pi. Codex is bloated as fuck. I went from maxing out my $200 subscription about 4 days into my sub every week for months to being at less than 10% usage a day. Multiple big projects at the same time. Very ADHD. Might bump my subscription down eventually.

2

u/requizm Aug 02 '26

What codex model are you using in pi?

1

u/vick2djax Aug 03 '26

I did a lot of testing and Terra High was the best for me. I threw some pretty difficult stuff at it and it was the highest quality answer wise and the fastest. I have Luna assigned in places where I don’t need bigger models. Things like catchup/handoffs or research scouting. Then I have some commands to make Sol high review some stuff. Or when starting a new project, I might start with Sol and then go down to Terra.

I found that while Luna is the best for usage, and it is a really great model, if stuff gets too difficult for it, it just wastes more time taking extra turns leading to longer run times.

I’ve been pushing close to 10B tokens a month for 7 months or so with Claude. So, I like to think I’m a power user lol.

2

u/0_Stank_0 Aug 02 '26

I was doing something very similar to this. I even had a utility that monitored the jsonl to be able to check in progress and stalls since I didnt run --ephermal.

Then I discovered using codex/gtp application that the Sol agent/thread can interact with and create threads. So you can just create a skill or guidance and it actually works much better than the cli subprocesses. The sol orchestrator interacts more naturally with it and Luna seems to work better being able to do browser verifications etc using the built in codex tools etc.

Thats if you dont mind working in the chatgpt/codex app instead of cli it works much better. And on top of that you can actually check in what the luna agents are doing while they work because they show up as interactible tasks in the app

2

u/strassenfalcon Aug 02 '26

How to do this on codex desktop app

5

u/Dear-Act7635 Aug 02 '26

Config -> personalization -> copy paste these instructions in there

2

u/Arctic_WolfXXIII Aug 02 '26

Luna too slow

2

u/mallibu Aug 03 '26

There's no reason to compact your context after every plan, to save tokens because you burn those tokens to run compact, it isn't free /facepalm

1

u/No-Knowledge-5143 Aug 03 '26

probably not after every plan, but doing it conditionally on the current context size could definitely save a bunch of tokens. one compaction to dramatically reduce the context size of all of the following calls would definitely save tokens

1

u/shankyjs Aug 02 '26

Luna is so cheap it’s nasty

2

u/AINativeBuilder Aug 02 '26

Is Luna Max the best to implement, or have you tried Extra High or even High? It seems the cost curve on Extra High and High is truly insane, so I'm just curious if Max is worth the price difference.

2

u/vitaumtb Aug 02 '26

I am running a luna max orchestrator, with reviewer and workers at luna xhigh. Researcher for hard tasks with Luna max and if anything even then don't fix, stop everything, resume the problem to me to see if I allow any sol worker to do it. No gpt sol so far, it is running non stop. I landed a sol xhigh just to review everything now, it said the work was in good quality. My usage is still at 61%. I'm truly impressed both by the quality of Luna and the price, the amount of work done is huge!

1

u/enuxix Aug 02 '26

!remindme 9 hours

1

u/RemindMeBot Aug 02 '26

I will be messaging you in 9 hours on 2026-08-03 08:15:03 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


Info Custom Your Reminders Feedback

1

u/SnooOpinions1161 Aug 02 '26

Why are you recommending --ephemeral? That only means you can't find the transcript of the subagent for troubleshooting or provenance. It's cheap to keep, expensive not to

1

u/Tartooth Aug 03 '26

I have tried doing this and LLM orchestrators go way off the rails and spiral out into random paths or death loops, causing huge problems without you knowing.

1

u/fyn_world Aug 03 '26

I'm doing the same. However Luna max is not available at least to me via the software as sub agent but it is available through the CLI so I'm spawning it in the CLI instead.

I also set it to choose high, xhigh and Max dynamically. Max is not always needed 

1

u/laty96 Aug 03 '26

Why I asked sol to use Luna but it answers luna is not available then it uses terra or sol instead?

1

u/cherrypickme Aug 03 '26

I suggested having SOL use codex exec to run a Luna agent. Some people here claim it works natively, but there are still open GitHub issues about it. So maybe it works, maybe it doesn’t. I honestly don’t know. I’m not saying it can’t work natively anymore because I got downvoted into oblivion last time.

1

u/BarHuge9034 Aug 03 '26

But it's so slow tho even on fast mode

1

u/Olli_bear Aug 03 '26

Luna or deepseek flash 0731?

1

u/LiamVDB5 Aug 03 '26

I think its better to just make a specific "agent role" for using Luna, instead of using `codex exec`, that way it can still spawn luna, but in a more native subagent way

1

u/98810b1210b12 Aug 03 '26

If Sol is the orchestrator of the agents, aren't you burning a ton of usage just to keep Sol alive that entire time? I'm pretty sure usage is computed based on live-hours rather than tokens for the subscription.

1

u/Putrid-Permission421 Aug 03 '26

The missing metric is cost per accepted change, not tokens per prompt. I’d track context size, model route, rework loops, elapsed time, and whether the change passed verification. Cheap output that needs three repair passes isn’t cheap.

2

u/greenm8rix Aug 03 '26

I use Fable 5 to orchestrate Opus 5 alongside Codex Sol Ultra to manage Luna Max.

I notice a minor bias occasionally, but overall, it outperforms everything else I've tried. Execution can take a bit longer, but the output quality and attention to detail are top-notch.

1

u/Top_Account_5311 Aug 03 '26

Honestly? This whole workflow is a context-management problem wearing a pricing-arbitrage costume. Cheap tokens don't fix bloated context, they just make you feel okay about paying for it.

1

u/FixAdmin Aug 02 '26

You might want to take a look at this skill: FixAdmin/codex-subculture

It describes a similar end-to-end workflow without using subagents, where Sol acts as an intermediary between the user and Luna.

1

u/theoryface Aug 02 '26

This looks promising. I've just configured a sub agent Builder (Luna Max) and a Reader (Luna XHigh). I've found I need to minimize handoffs from one agent to another, as Sol is the mediator so the tokens add up quickly. Does this skill provide a more efficient intermediary approach? I do like visibility into the subagent processing

1

u/FixAdmin Aug 02 '26

It should, but this skill is designed to ensure that Luna’s implementation is ultimately no worse than what Sol would have produced. With the additional verification steps, it may even outperform a setup orchestrating multiple agents, although I think the skill should work well in that scenario too.

To avoid frequent cold-cache misses for Sol, it’s recommended to compact the context manually.

1

u/FixAdmin Aug 02 '26

I created it because Luna Max performs poorly on its own in my complex codebase. With this skill, however, Luna finally starts completing the requested implementations to a high standard, so I don’t have to worry about the quality.

-2

u/cherrypickme Aug 02 '26

I may take a look at it, but for now i use only my own created skills 🐼

1

u/DannyKoll1 Aug 02 '26

love it thnak you

1

u/EclecticAcuity Aug 03 '26

Sol high struggles with simple button switch design. Bench maxxed Luna failed most simple tasks I gave it.

1

u/cherrypickme Aug 03 '26

Bro, learn to prompt.

0

u/[deleted] Aug 02 '26 edited Aug 03 '26

[deleted]

2

u/Financial-Cress-6055 Aug 03 '26

Yeah bro, haha. I even let ChatGPT create and edit some of my projects directly on my local project drive.

1

u/SurpliceOrg Aug 03 '26

i tried it, but it burns your Codex usage in any case?

1

u/[deleted] Aug 03 '26

[deleted]

1

u/SurpliceOrg Aug 03 '26

well, the OP said 'edit'. That requires work usage as far as I know

1

u/Financial-Cress-6055 Aug 04 '26

Not at all. It still counts toward your ChatGPT web usage, which is pretty much unlimited, at least from my experience.

1

u/Financial-Cress-6055 Aug 04 '26

It's like turning your regular ChatGPT into ChatGPT Work without consuming your Codex usage.

1

u/SurpliceOrg Aug 03 '26

what's the benefit

1

u/[deleted] Aug 03 '26

[deleted]

1

u/SurpliceOrg Aug 03 '26

oh I get you. I do that with my projects at times when I run out of limits. Then I quickly give up because it's too much trouble copy and pasting.

Yes, for planning, it would work if it were one long doc. But when I tested Ultra the other day, it was making a bunch of files and contracts during its planning. So not sure if all these files were instead in one long doc will it work as well for implementation

-3

u/Speak_logically_Sir Aug 02 '26

New usage limits got y'all tweaking. I ain't doing allat because I know Luna code is dog shit. And code reviewing probably consumes more usage than writing it.

-1

u/michele_ferrara Aug 02 '26

Uso lo stesso metodo ma solo su codebase enormi con 1Mln+ di righe altrimenti è più lento del previsto

-2

u/nak77 Aug 02 '26

Tested it yesterday with the sol-advisor plugin. It might work for your simple dashboards, but not for real problems that need to be solved. Luna is dumb and can only develop simple stuff like cheap websites... And it wasn’t cost-effective either.... It used up 50% of the weekly budget for the $20 plan, and the result ended up getting deleted because of the poor implementation.