“You've hit your limit”: predicting when your Claude quota runs out
"You've hit your limit. Resets at 3:10 PM." The message is not the problem; the surprise is. If you knew an hour earlier that your pace would run out at 2:30, you could switch to a smaller model, finish the current step, or plan a break. Bumeter tells you that, and it is careful about when it does not know.
Where the numbers come from
Claude Pro and Max plans have two rolling limits: a 5-hour window and a 7-day window. Claude Code reports how much of each you have used, and when each resets, in the JSON it sends to your status line on every refresh. Bumeter's status line hook stores every reading (the status line post explains how). A forecast is a line drawn through those readings.
The question it answers is simple: at the pace you are going now, do you hit 100% before the window resets? If yes, the window is "at risk" and Bumeter shows when.
The 5-hour window: the last 30 minutes
Over five hours your pace changes a lot. You read code for a while, then ask for a big refactor. So for this window Bumeter only looks at the last 30 minutes of the current window and fits a straight line through those readings (a least-squares slope). That line is the burn rate, in percent per hour.
// The limit at this pace: now + what is left / the rate.
let hits_at = now + (100.0 - last_pct) / rate_per_sec;
let at_risk = hits_at < resets_at;
A forecast built on too little would cry wolf, so there are minimums. Bumeter makes no 5-hour forecast unless it has:
- at least 3 readings,
- spread over at least 10 minutes,
- with the percentage up by at least 2 points.
Readings from an older window are ignored, and if the percentage ever goes down in the series (the window was reset early, for example), everything before the drop is thrown away. A line through a reset would be meaningless.
The 7-day window: the average since it started
The same method fails for a week. A slope from your busiest hour, stretched over seven days, would predict you run out by Wednesday every Monday morning. So for the weekly window Bumeter uses the average pace since the window started: what you have used divided by the time elapsed, projected to the reset.
Early in the week that average is still noise, so there is no weekly forecast during the first 12 hours of a window. Kiro's monthly credits use the same "average since the period started" approach, with no forecast for the first 2 days of the month.
Once a limit is actually reached, there is no forecast at all: Bumeter shows that you are limited and when it resets, which is the only thing that matters then.
Where you see it
A forecast only appears when the window is at risk. When it is, the same "out ~time" shows up everywhere:
The dot turns yellow even below your warning threshold, because being on track to run out is the warning. Bum, the tray mascot, looks worried for the same reason. For the weekly window the time is a date instead.
One notification, at the right time
Bumeter can also send a desktop notification, "Limit ahead", and it tries hard to send it once:
- For the 5-hour window, it fires when the forecast limit is 30 minutes away or less. You can change that lead time in Settings.
- For the weekly window, it fires when the limit is a day away or less.
- Each window notifies once per cycle: the notification is remembered with the window's reset time, so the forecast moving back and forth does not send another one.
Separate notifications cover crossing your percentage thresholds (70% and 90% by default) and being blocked. "Pause notifications for 1 hour" in the tray silences all of them while you present or focus; the numbers keep updating.
Why not something smarter?
A model of your working hours, or of how long your sessions usually last, could predict further ahead. It would also be wrong in ways that are hard to explain. A straight line over the last half hour is easy to reason about: if you slow down, the forecast moves out within minutes; if you speed up, it moves in. And when there is not enough data, Bumeter says nothing rather than guess. A forecast you trust is worth more than one that is right a little more often.
Bumeter is free and open source (GPL-3.0), and everything stays on your machine. The source is at github.com/chieund/bumeter. The maths is crates/bum-core/src/forecast.rs; the notifications are in alerts.rs.