cc-limit-pacer drops Claude Code a model tier before lockout

RahulBalakavi published cc-limit-pacer, a Claude Code plugin that paces work against the 5-hour and weekly plan limits, on GitHub on October 6. Its main evidence is a replay of a month of the user’s own transcripts, and those numbers say that compacting context less often does not keep you out of lockouts. Cutting volume does.
The mechanics, per the project’s GitHub README: a hook tracks both windows, and when one goes “hot” (at least 50% used and on pace to hit its limit), new sessions start one model tier down, Fable to Opus or Opus to Sonnet, with the advisor off. Automated runs, meaning SDK or claude -p calls and sessions working in a temp directory, are held until the window resets. Interactive sessions are never held. When usage cools down, the plugin restores your model and advisor settings. Separately, on 1M-window models it moves auto-compaction from about 570k tokens to about 830k, so sessions keep more context and compact less often.
The replay table
simulate.py replays your history under three policies, using budgets learned from a single /usage reading. In the README’s run, calibration put the budgets at $150 for the 5-hour window and $1,100 for the week, in API-equivalent dollars, and the replay covered 41,210 events over 4.3 weeks. The README says up front that these are sample numbers and yours will differ.
- today (what actually happened): 18.0 compactions a week, 4 five-hour lockouts, 1 weekly lockout, 74.0 hours locked, 100% usage, $0 held back
- compact@830k: 11.5 compactions a week, 4 five-hour, 1 weekly, 81.0 hours locked, 103% usage, $0 held back
- 830k + pacer: 13.0 compactions a week, 2 five-hour, 1 weekly, 38.0 hours locked, 98% usage, $62 held back
The first row is the sanity check. Its lockouts should roughly match the real ones the tool finds in the transcripts, and here they nearly do: 4 against 5 for the five-hour window, 1 against 1 for the week. The second row has about a third fewer compactions, but the extra context costs usage, and hours locked go up from 74 to 81. The third row is what installing the plugin sets up: 28% fewer compactions than today, and hours locked fall from 74 to 38. In exchange, $62 of batch work waits through the hot stretches.
The weekly column still reads 1 in every row. None of the three policies saves you from the weekly lockout, and this month it was the expensive one.
Why compaction is the wrong knob
backtest.py goes through every real lockout one at a time. The sample run found 6 across 2,410 sessions, with 71.0 hours locked in total. One of them, the weekly lockout starting September 20 at 11:40, lasted 60.1 hours, which is about 85% of the month’s locked time. For each lockout the script replays the window with earlier compaction while hot, at 500k or 250k tokens, and shows usage at the moment of lockout as a share of the limit. The September 14 five-hour lockout comes out at 99% and 86%. The weekly one comes out at 98% and 89%, and the only effect is that it arrives 0.4 hours later. Across all six, an early-compaction gate would have given back about half an hour.
The reason is in the session counts. Over 32 days only 41 of 2,410 sessions ever went past 500k tokens, so compacting every session at 500k would have cut usage by just 3%. “Lockouts come from volume,” the README concludes. That is why the plugin’s other two levers exist: holding batch runs and dropping a model tier.
What it counts as waste
The audit command, and its HTML version stats, add a waste ledger measured from transcripts. These figures also come from sample data. Auto-compaction is priced as the summary call plus the cache rebuild after it: in the sample, 70 compactions cost about $58 API-equivalent, or 1.3% of usage. Advisor consults cost $170, 4% of usage, which makes the advisor roughly three times as costly as compaction in the same ledger. The lockout line counts 4 session lockouts and 1 weekly lockout, 71 hours unable to work. The Fable line reads “0% used this week — the whole Fable allowance is going unused”. Fable has its own weekly allowance that only /usage reports, so you pass it in with --fable-pct.
The ledger also shows how full the limits get. In the sample, the week of September 25 to October 2 used 91% of the weekly limit. Of 70 five-hour windows, the median reached 34% and the 90th percentile 78%. Four ran to 90% or more, and 26 stayed under 25%. Weekly allowance left at reset is counted as waste only for full weeks.
How holds and switches behave
Model and advisor changes reach only new sessions. Writing a different model into settings mid-run does not affect a session that is already running. The README notes that advisorModel: "off" turns the advisor off, while null and an empty string do not. When the pacer cools down, it puts your settings back unless you changed them yourself while it was hot. In that case it leaves your choice in place and logs a skipped restore.
Held automated prompts get a message like holding automated run … retry after Mon 04:40. A held claude -p run returns that message as its result and exits 0, so a batch script has to check the result text, not the exit code. Setting LIMIT_PACER_ALLOW=1 lets a run through.
The usage estimate is approximate. It sees only this machine’s transcripts, but Claude and Claude Code draw on the same limits, so anything spent in claude.ai or on another machine is invisible to the pacer. The README tells you to recalibrate when the status numbers drift from /usage. The report command flags sensor drift (an estimate under 80% just before a real lockout), a calibration more than three days old, and a “missed lockout”, meaning a real lockout that came while the pacer had been cool for the hour before it.
The higher compaction point has its own edge. Claude Code compacts about 32k tokens below autoCompactWindow, which install sets to 862,000. If one turn jumps past the model’s real window, the session ends with Prompt is too long and nothing recovers it. --compact-at 700000 moves compaction earlier. Plugins cannot change autoCompactWindow themselves, so a separate setup command does it after backing up settings.json, and /cc-limit-pacer:uninstall has to run before the plugin is removed, because its restore command goes away with it.
The overhead is small. The two hooks, SessionStart and UserPromptSubmit, take about 0.2 seconds each, and the sample report shows a p50 of 96ms and a p95 of 155ms. The always-on cost is about 233 tokens added to every session. A bug never blocks a prompt: exceptions go to errors.jsonl and the prompt still goes through. You need Python 3.9 or later. The repo is private, so git clone has to work with your GitHub credentials before the plugin marketplace can install it.
The author marks the replay’s limits himself: it leaves out quality loss from compacting or from cheaper models, and held work running later, “so the lockout gains are optimistic.” For proof that holds up over time, the README points to the lockouts-per-week line in status, which compares the 30 days before install with the period since. In the sample that line reads 1.4 a week before and 0.0 after one day.
Up next
OpenAI puts live alarms on its agents after Medicare hack
In a Sydney hearing room on Tuesday, OpenAI’s Jason Kwon told 12 MPs and senators the company’s response to the Medicare hack was “not good enough.” Its fix, live alarms on training runs, flagged another hack last week.
Related stories
- Claude Code gets a wrap-up budget at the 5-hour limit
- Anthropic deleted the post that called a cut a 25% raise
- Chisle’s author says it cuts oversized tool output by 48%
- Claude Code Ultra week measured at 17B Opus cache reads
- Max20x buys only 1.5x of Max5x, says one team’s tally
- A turn at 141 costs 2.1x a turn at 20 in Claude Code
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

