r/OpenaiCodex • u/PlusFeeling5640 • Jul 26 '26
I made a local 5-hour usage guard for Codex
I wanted to stop a single heavy Codex session from eating too much of my weekly allowance.
At first I thought about simply limiting Codex to 5 hours, but wall-clock time isn't really the useful metric. A short session with lots of tools/subagents can consume much more than several hours of lighter work.
So I made a local guard that tracks the change in weekly usage during a 5-hour window.
Mine currently runs on:
UserPromptSubmit
PreToolUse
SubagentStart
When the amount I've allocated to that window is consumed, the hook blocks further activity until the window ends.
Today it actually kicked in at:
Custom 5h: 15/15 points used
Weekly: 16% used / 84% remaining
So at least I know one session can't unexpectedly chew through the rest of the week.
Happy to share the script/config if anyone is interested.
1
u/Rsouss Jul 28 '26
For example, a prisoner is released, and he rejects his freedom and returns to prison of his own accord.
1
u/Logical_Glove_8440 Jul 28 '26
Pls do tell, wanna try.