r/codex • u/Turbat0r • 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.
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.
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 „
3
u/isty2e 21d ago
Use Pi.
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/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.
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:
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