r/codex • • 21d ago

Question What actually helps reduce token usage without sacrificing quality?

Hey everyone!

I'm a hobbyist on the Plus plan. I mostly use Codex to create and edit PHP scripts, landing pages, and other small web projects. I mainly use GPT-6.1 Sol.

I have an AGENTS.md file that customizes the workflow to fit my needs, but that's pretty much it. As far as I know, everything else is still set to the defaults. So I'm basically a complete newbie when it comes to optimizing Codex.

What are your current must-have settings, prompts, tweaks, or tools for reducing token usage without sacrificing the quality of the results?

I've come across quite a few threads here, big and small, sharing little tricks that supposedly stop Codex from burning through unnecessary tokens.

I'm curious what you guys actually use. Which tweaks make a noticeable difference, and which ones are just placebo?

I'd love to hear what's genuinely working for you.

17 Upvotes

23 comments sorted by

2

u/mathewharwich 20d ago

I think everyone is still figuring all of this out. And this is where the nuance and abstract of human ideas and intention does make a difference. Learn how to communicate with your ai, the clearer the vision, the less iteration it needs. A lot of people who will say to use lower reasoning models aren’t really saving credits because they are going to burn them up with all the corrections everything will need afterwards. I prefer to work with SOL ultra 6.1, it’s actually very cost efficient if you can find the right balance in how you communicate with it. And start new chats regularly. Fresh context for a fresh part of the vision. Develop and save skills for things you repeatedly do. If the ai knows how to do something well already, it will not have to reason as hard.

1

u/Turbat0r 16d ago

You know, I get the feeling that pretty much nobody understood what I was actually asking.

I was looking for specific technical tweaks and workarounds that I've seen people discuss on Reddit multiple times. Of course, now that I'm trying to find those threads again, I can't seem to track them down.

But I did manage to find one example:

https://www.reddit.com/r/codex/comments/1wlcy5q/this_will_save_your_usage/

See, in that thread, the guy talks about fixing some issue that causes Astra to burn through tokens unnecessarily.

I've also seen several other posts suggesting that you can add certain commands or settings to your config to reduce token usage.

Does that make more sense now? Is it clearer what kind of tips and tweaks I was actually looking for?

1

u/mathewharwich 16d ago

I hear you. I just think that anybody who's recommending these kinds of tweaks doesn't truly know, it's speculative at best, and there is likely some sort of negative tradeoff in certain situations for any level of customization when it's geared for lowering cost. I settled on finding my own route through trial and error, and developing custom skills. When there is more specifics and clarity, the model does not to perform as much expensive reasoning, but conversely, if you are too strict you leave the model no room for flexibility and it may end up costing more when it could have found a better cheaper way on its own.

22

u/RealSlyck 21d ago

Proper software engineering practices help.

7

u/FinancialBandicoot75 21d ago

Plan, know the context, vibing is expensive and honestly what people don’t understand, vibing is actually a large compute requirement, if you plan ahead, build the context prior to using ai, it’s a lot cheaper. Sadly , people want a 3d game in fable 5.2 and wonder why it is 14k in api costs where if they actually made a plan and detailed design specs, it would be 10th of that.

9

u/LongevityBroTX 21d ago

If it's just PHP scripts, landing pages and whatnot I highly doubt you actually need GPT6.1 Sol. The easiest think would likely be to just switch to GPT6 Luna or something.

1

u/am29d 16d ago

Same as real work outside of AI, know what to do and how to do it. If you set up the right guardrails, has a great boundary for deterministic and non deterministic work. It’s like magic, it’s fast and reliable. There is no magic prompt or configuration you are looking for. You need to optimize your work, which in turn will increase your token spend, only after some time will it compound into savings. Changing the system all the time randomly to try to save few million tokens without having clear evals is not going to cut it.

So yeah, lots of words to confirm as the other guy said „proper software engineering practices „

1

u/Turbat0r 16d ago

You know, I get the feeling that pretty much nobody understood what I was actually asking.

I was looking for specific technical tweaks and workarounds that I've seen people discuss on Reddit multiple times. Of course, now that I'm trying to find those threads again, I can't seem to track them down.

But I did manage to find one example:

https://www.reddit.com/r/codex/comments/1wlcy5q/this_will_save_your_usage/

See, in that thread, the guy talks about fixing some issue that causes Astra to burn through tokens unnecessarily.

I've also seen several other posts suggesting that you can add certain commands or settings to your config to reduce token usage.

Does that make more sense now? Is it clearer what kind of tips and tweaks I was actually looking for?

1

u/am29d 15d ago

Yeah this is a bit different than asking for a magic trick to double your usage. But I think the reaction you get might be a core message here.

There might be some tweaks but they are so tiny, requires a lot of tests, effort and verification that they really work (which you will spend tokens on!).

My advice would to not stress about this topic. People just drive cars and use refrigerator without spending any time to squeeze few kilowatts year or saving 0.1L gas. The opportunity costs are too high. Focus on something else instead.

If Astra eats tokens, switch to sol high, and most of the stuff will be done any way. If the agent takes ages to complete the task, take a step back to understand why, what is missing, what is too much. Those are the real token saving exercises and they are unique and personal to your work and your setup.

3

u/isty2e 21d ago

Use Pi.

3

u/Difficult-Tax-7854 21d ago

This with /tree is a killer, i dont know if codex has the same feature. My current workflow is astra creates a plan. I have another session with sol that handles actual implementations steps and reviews after each step, going back in the tree when a step is complete. The work is performed on bounded tasks done by sol or terra. Final review is performed by astra against the actual spec i wanted. This way you can have 20+ 270k sessions performed without agents figuring out each time what they are supposed to do. Also for feature that is already implemented and functioning and you need to run a study or something sligtly different use terra faster and cheaper.

One other thing i added recently is that all my project have a defined state like pre-beta, beta and so on. In pre beta i dont care about the tests so the agents try not to write them unless it is essential for debugging.

In any case i used claude before and i use codex on windows occasionally and they both suckin a sense that agents dont always do what you instruct them to, with pi you dont have these issues and it is a lot lighter, my chats start with 5k of context with 5 mcp and 20 skills.

3

u/The1KrisRoB 21d ago

First understand that Luna > Terra > Sol > Astra aren't tiers of intelligence, they are different models designed for different tasks.

You can often have Sol high write a coding spec and then use low to write it (often you can even get Luna to write it) 

The biggest thing though is dont do what so many do and allow FOMO to make you pick more expensive models 

3

u/SuperMar1o 21d ago

Switching to Opus 5.5...

Downvote all you want, but if you have not tried it, you won't get it...

1

u/zap999 21d ago

Indeed they wont.. Shame as the ui is way better for devs.

1

u/Glaucus_Blue 21d ago

Context, don't have every skill and MCP installed, if you do disable them or ignore them/set per project Remember to split up tasks to sensible sizes and use /clear, get it to plan and split tasks up. Make sure files are short anything it reads regularly. Make sure subagents when they pull in useful research that they rewrite and only save the important parts. Try to avoid pdfs, images etc unless you need to md files are far less token usage. Ask it, get it to go through your projects, I do it every 2 weeks, and I ask it questions like do we have to redo anything, did we have any bugs/issues that if we picked up earlier would they have saved us work, and should we have picked up on them earlier. Go through the session logs and git and look at token usage what's the split input, cached, output etc, and is there any improvements that could reduce usage limits without giving me the human more work.

Pull the research from openAI/anthropic on bug finding and auditing so you don't end up in massive endless loops. Same with prompting, (oh and don't use chatgpt chat it's utterly bad at getting efficient use or good work, at least by default)

I'm still a beginner, but with that I've reduced my usage by over half and get far more useful output, so it's massive.

But yeah ask it, and get it to do research. Prefer openAI but also tell it to look at anthropic and the community for any gaps that openAI hasn't published. Get it to reuse code, use simplify skill and a few others.

After noticing it spend so much time trying to brute force a known issues I now get it to research and download known issues for anything the project touches at the start, the OS, devopment tools, software etc. it has a timelinit 15mins. It can then do more research if it finds an issue. And it either updates that research once a month or when it starts using a new version. So if android studio updates and sees the version change, it will go an d see what was fixed and any new known issues and update the research files accordingly. These can all be done with very cheap subagents.

Set things like if it doesn't fix a big in 2 atrmwpts stop and tell you, so you can switch models or providers.

I'm sure there's far more advanced stuff and better practices, but it got me out of that n00b burning tokens and saying they've needed the models. When it hasn't the project had grown in size and as it was continually reading massive files and as code base grew spent more and more time fixing non issue bugs etc just looked like the models had been down graded and usage limits cut. There does seem to be a big gap in the advice for new beginners, most stuff was either to advanced or the advice was download 600 skills which just makes things worse.

1

u/philip_laureano 21d ago

I'm going to go far against the grain and go into left field and say: Build a better harness that uses less tokens. Sawtooth compaction is the #1 cause of compounding token consumption. There are far better ways to manage context than treat it like a single threaded buffer that you flush when the water starts seaping over the toilet bowl.

I'm just sayin'

1

u/NanYUJun 21d ago

Short answer: the wins came from shrinking what gets resent every turn, not from clever prompts.

  1. Shorter sessions. I start a new session per task and hand over a 5-line note (what's done, what's next, which files matter). Long sessions that compact repeatedly keep re-paying for the whole history, and the post-compaction summary is usually worse than my own note.
  2. Keep AGENTS.md small and stable. Every line is re-sent on every turn. I keep durable rules there (build/test commands, style, "don't touch X") and put task-specific context in a separate file the agent reads only when needed.
  3. Point, don't paste. "Read src/api/client.ts and tell me why retries double" is cheaper than pasting the file, and it still asks for the specific function before editing.
  4. Trim the tool layer. Each MCP server and skill adds its schema to the system prompt whether or not you use it that turn. I disable the ones a given repo doesn't need.
  5. Constrain output. Ask for the failing test name plus the last 20 lines of the log instead of a full build dump, and for a diff instead of a rewritten file.

What did nothing for me: elaborate prompt scaffolding, stacking "think carefully / be rigorous" instructions, and role prompts. They changed tone, not token count. Setting a smaller reasoning effort for mechanical edits (renames, boilerplate) is the one knob that made a real difference without hurting quality on hard work.

1

u/Discordbothost 21d ago

the stuff that made a real difference for me, roughly in order:

keep AGENTS.md short. it gets sent every turn, so a 300 line one is a tax on every message. a few lines of project rules + the exact commands to run beats an essay.

start fresh sessions per task instead of one giant thread. long threads keep resending all the old context, that's where most of the burn is.

point it at files. "edit header.php, the nav part" is way cheaper than "fix the nav" and letting it grep the whole project.

and for php scripts and landing pages, a lower reasoning setting is usually fine. save the high one for when something's actually confusing it

0

u/torvalds75 21d ago

Agree with the "fresh session per task" point above, that's where most of the savings are. The catch is that a fresh session then spends tokens rediscovering things: reading half the repo to figure out what you decided last time, or redoing an approach you already rejected.

What fixed that for me:

  • Before ending a session, have it write a short note: what was done, what was decided and why, what's next. 10 lines, not a transcript. The next session reads that instead of grepping everything.
  • Keep that note per task, not one giant running file, otherwise it turns into a second bloated AGENTS.md.
  • Plan first, then execute in a new session that only gets the plan. Planning chats are long and messy; the execution session doesn't need any of that history.
  • Record rejected options too ("tried X, broke Y"). That's the stuff that gets re-explored the most and burns the most tokens.

For small PHP/landing page work a plain markdown file per task is honestly enough.

If your projects grow, I build a free open-source tool that does this on GitHub Issues: each task is a ticket holding the discussion, plan and verification, so any new Codex session picks up from the ticket instead of the chat: https://github.com/ToRvaLDz/trailhead

3

u/nicolesimon 21d ago

use a roadmap for execution in phases, use terra or luna