Token budget guard
A hook that stops a runaway loop before it burns through your plan or your API bill.
How to build it
- 1On every PreToolUse event, sum the session's token use from its log.
- 2Exit with code 2 and a clear message once the session passes its budget.
- 3Sell shared budgets and Slack alerts to teams.
The Reddit threads