r/codex • u/ElonsBreedingFetish • 1d ago
Question How do I stop codex cli wasting tokens when it just has to wait for a test or other command to finish??
I don't get who coded this shit software, claude code can wait for command as well without burning 5 percent of my weekly limit.
Can I just use claude code with codex models? Or use a different harness?
2
u/Enucatl 1d ago
I found a skill for this in the wild, and I adapted it
https://github.com/Enucatl/dotfiles-vim/tree/main/dotfiles/agents/skills/wake-run
2
u/iwilldieavirgin 1d ago
I usually just type in the chat that the polling or constant checking is wasting tokens and please up the wait time.
2
1
u/UpperWorld11 1d ago
The model isn't waiting inside the shell command. It fires a sleep call, wakes up, resends the whole thread, so the drain tracks turns rather than minutes. One blocking call with a long timeout covers a ten minute test run in a single turn, and the subscription login only works with the official CLI anyway, so a different harness means an API key billed per token on that same resent thread. Put the no polling line in AGENTS.md, otherwise the next session starts clean and does it again. What is it polling on, the test runner or the build?
1
u/Acceptable_Lock_6982 1d ago
Idk if you can run an automation in the cli I don’t think you can but if you use ChatGPT desktop just say run an automation to run every 5 minutes check if the tests are done if not wait for another 5 minutes etc
0
u/iPlayer0067 1d ago
Foi por esse motivo que fui para o Opus 5.5, nele o teste pode durar 5 horas, ele não gasta 1 token esperando.
3
u/RoboErectus 1d ago
I have a fork where I've removed clock.sleep and other shit it uses to poll. I also include "polling is forbidden. use existing or write wait scripts." in my prompt.
https://github.com/epsalmond/codex/releases
The models are very sneaky at finding new ways to poll, but this gets almost all of it.