Repository navigation
Ultra accounts (formerly Max 20x) no longer have a 5-hour limit, and Claude Code stops sending five_hour for them. 1.2 read that as an API plan and showed notional dollars. 1.3 works out the plan from the windows that are present and makes the weekly window the main bar when 5h is missing.
Status line
- Weekly first on Ultra:
7dbar with pace, a daily allowance (today 4/14%) and a run-out projection (out Tue 00:25) when you're on track to hit the limit before reset. - Per-prompt weekly delta.
used_percentageis a whole number, so cc-budget learns a $-per-1% ratio from your sessions and estimates the delta from cost. - On Pro and Max the 5h window stays primary. The 7d bar joins it once weekly usage passes 50% or a run-out is projected.
- Fable 5.1:
fabletag and the per-model weekly cap bar from/usage. Fast mode and xhigh/max effort get their own tags. - The
coldtag now comes from Claude Code'sprompt_cachefield (2.1.251+). An expired cache shows the re-cache size (cold 153k) and a cache about to expire showscache 8m. Older versions fall back to the 5-minute idle check. - Gateway spend limits (
rate_limits.spend_limit) get their own bar. - Reset times past 24h read as days (
3d05h).
Hook warnings
- Run-out warning once per weekly window from 50% usage: "At this pace the weekly limit runs out Tue 00:25, 1d19h before it resets."
- Expensive-prompt alert on the weekly window for Ultra (
expensive_delta_7d, default 1%), once per day. - The Fable cap warning says what happens past the cap (usage credits).
- Warnings re-arm when their window resets.
warned.jsonmoved to a new format, so each warning can fire once more after upgrading.
Fixes
- Several sessions running at once no longer overwrite each other's deltas, cost or model. Each session keeps its own entry and snapshot file.
- Subscriber sessions no longer land in the API cost ledger.
VS Code extension 0.3.0
cc-budget-0.3.0.vsix is attached. Install with code --install-extension cc-budget-0.3.0.vsix and reload the window. Ultra accounts get the weekly window as the status bar segment, and gateway spend shows next to session cost.
Upgrading
Re-run ./install.sh. It adds statusLine.refreshInterval: 30 so the cache countdown and reset times stay current while you're idle. Your state.json is migrated in place.
Config
{
"thresholds": { "expensive_delta_7d": 1 }
}Tests: node --test test.cjs (40 tests, no dependencies).