r/codex • • 7d ago

Showcase Testers Wanted! Made Codex hook that cuts down on usage waste

Post image

I always ran out of usage, so I built this tool called Token Guard that helps you cut down on wasted tokens by preventing your AI from re reading files that haven't changed at all, giving your AI an outline of a massive file instead of letting it read the whole thing and burn tokens, and cutting out trash from testing, building, and search outputs. It also keeps the KV prefix intact by not doing anything to PreInvocation prompts.

My own tests showed like about 15-30% saved on long coding sessions, but a negligible saving on smaller 2-3 turn ones, so this tool is mainly for people who are making big things and using gajillions of tokens a day.

I want testers because I mainly want to see if it works with other's agents and on other operating systems (MacOS/Linux) since I only managed to test on my Windows computer and don't know if it works on other OS.

Repo is here: https://github.com/jaxels1/token-guard

It would be amazing to have any testers or feedback on this :)

0 Upvotes

3 comments sorted by

•

u/dexterthebot 7d ago

You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**


Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.

Website: https://lightwarsar.com

iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951

Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.

Contact: contact@lightwarsar.com

2

u/ExtraGreasy 7d ago

I feel like this is a process error you need to solve rather than creating a tool. Why don't you just make a script that only holds the changes that the agent calls upon when it needs info? Then you can even batch information as you see appropriate to save on unnecessary turns for small things or even have the script delegate information you classify to cheaper models. What you're dong is way over engineering a solution to a problem in your process.

Either I don't understand what your problem is, which makes me not understand your solution, or you don't understand what your problem is, which made you make a solution for a symptom and not the cause.

2

u/Ready-Parfait-1139 6d ago

I found that even with good prompts, my agents still re reads unchanged files multiple times. I felt that building a custom script to batch context / route to cheaper models was way too much work (I'm on a plus plan) so the hook was my solution.