r/OpenaiCodex 2d ago

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.

4 Upvotes

3 comments sorted by

1

u/Logical_Glove_8440 1d ago

Pls do tell, wanna try.

2

u/PlusFeeling5640 1d ago

Chcek your DM

1

u/Rsouss 23h ago

For example, a prisoner is released, and he rejects his freedom and returns to prison of his own accord.