How it works
Pacing headless Claude Code against the weekly limit
Published · 8 min read· Anton Shubin

In short
- Pace is two shares side by side: how much of the weekly quota you used, and how much of the week has gone.
- Ahead of an even pace, push work that can wait. Behind it, run more: what is left at the reset is gone.
- My old rule stopped everything at 90% of the weekly quota and once kept my engine idle for about 4.7 days. I removed it.
- Now pace only ranks work. A daily dollar limit caps the spend, and on quota only Anthropic's own refusal stops a run.
To avoid hitting the Claude Code weekly limit too early, compare two shares: how much of the weekly quota you have used, and how much of the week has gone. If you used more than the week allows so far, push the work that can wait. If you used less, run more, because what is left at the reset is simply gone. My engine for unattended Claude Code does this, and it only ranks work. It used to stop at 90% of the quota instead, and that stop once kept it idle for about 4.7 days.
That was the most careful employee I ever had: so afraid of spending the quota that it spent none of it for most of a week.
Why did my engine sit idle for most of a week?
Issuemill runs Claude Code headless on GitHub issues in 11 of my projects, on my own machine, signed in to my own Claude subscriptions. In November it had two rules about the weekly quota. The first held every new run once the week's usage reached 95%. On 14 and 17 November it did that for a few hours, with usage reading between 95% and 100%.
The second rule paused everything at 90% and kept it paused until the weekly reset. On 20 November at 03:01 UTC usage reached 90%, and the engine stopped. It woke up on 24 November at 18:58 UTC, about 4.7 days later. In between it checked its queue 665 times and said the same sentence every time: paused, weekly usage at 90%.
Then my daily dollar limit, which stood at $0, kept it still until 27 November. Not one run started from 21 to 26 November. The engine's run time fell from 214.9 hours in the week of 16 November to 71.7 hours in the week of 23 November.
The quota did not run out. My rule ran out of patience before the quota did.
How do Anthropic's weekly limits work?
Anthropic's help page puts it in one line: "Pro and Max plans have a five-hour session limit and a weekly limit" (Anthropic support, checked 2026-12-01). Chat in Claude and work in Claude Code count against the same limits, and the week starts again at a fixed time that Anthropic assigns to each account (Max plan page, checked 2026-12-01).
Anthropic publishes no token or hour figures for the weekly limit. The pricing page compares plans only against each other: Max at $100 a month gives 5x Pro usage, Ultra at $200 gives 10x (claude.com/pricing, checked 2026-12-01). So you cannot plan a week in tokens. You can only watch a percentage.
Headless Claude Code tells you that percentage. With --output-format stream-json, the stream of
a claude -p run carries rate_limit_event lines: for the five-hour and the seven-day window, how
much is used and when it resets. My engine saves the latest reading for each account, and the
percentages below come from those readings.
What is pace?
Pace compares the share of the quota you used with the share of the week that has gone. An even pace means the two match: 50% used at the halfway point, 25% after a day and three quarters.
If you are ahead of that line, the week runs out before the reset. If you are behind, you will reach the reset with quota you never used. Both cost you. Being ahead costs idle days at the end of the week, and being behind wastes quota you already paid for.
My engine turns pace into one number: the share of the quota an account must use per hour to spend the rest before its reset. This is the real function, from my engine's code:
export function weeklyPace(weekly: number, resetsAt: Date | null, now: Date): number {
if (resetsAt === null || !Number.isFinite(weekly)) return 0
const left = resetsAt.getTime() - now.getTime()
if (!(left > 0) || left > WEEK_MS) return 0
const used = Math.min(100, Math.max(0, weekly))
const expected = (1 - left / WEEK_MS) * 100
return used < expected ? (100 - used) / (left / HOUR_MS) : 0
}
An account behind the even line gets a positive number: the further behind, and the closer the reset, the bigger it is. An account on or ahead of the line gets 0.
What does my rule do when I am ahead of pace?
Nothing dramatic. It ranks; it never stops a run.
The engine picks the next issue in code. Roughly, the project that has had the least run time over the last day goes first. When two projects are close to a tie, the one whose Claude account is further behind its week goes first. An account ahead of pace scores 0, so its projects simply lose that head start. Their runs still start, and pace never stops a run that is already going.
Try it. The figure starts at the morning my engine stopped: 90% used with 4.7 days left.
Interactive
Ahead of the week, or behind it?
Set how much of the weekly quota is used and how many days are left until it resets.
90% of the weekly quota used. An even pace would have used 33% by now.
That is 57 points ahead of an even pace. My rule gives this account's projects no head start, and no run stops.
The same numbers for five sample points:
| Quota used | Days left | Even pace by now | Where you stand | What my rule does |
|---|---|---|---|---|
| 90% | 4.7 | 33% | 57 points ahead | No head start; nothing stops |
| 50% | 3.5 | 50% | On pace | No head start; nothing stops |
| 20% | 2 | 71% | 51 points behind | Needs 1.7% an hour: its projects go first |
| 70% | 1 | 86% | 16 points behind | Needs 1.3% an hour: its projects go first |
| 100% | 0.5 | 93% | 7 points ahead | No head start; Anthropic refuses new runs |
With one Claude account the tie-break has nothing to compare, so the ranking part does nothing. The comparison is still the useful part. If you run one account, look at the two shares before you start a long job, and keep the long job for when you are behind.
Why did I remove the hard stop?
I removed the 90% and 95% stops on 28 November, for three reasons.
First, it wasted the end of the week. The pause held from 90% until the reset. That week the engine never used its last tenth of the quota, and it gave me 4.7 days of nothing to read in the morning.
Second, it overruled a limit I had chosen. I set what the engine may spend per day in dollars. The percentage stop sat on top and stopped work that my own dollar limit allowed. Two limits that disagree are one limit too many.
Third, Anthropic already enforces the real limit. When an account hits its limit, Anthropic refuses the run. My engine reads the refusal and holds only that account's projects until the reset it names. The other accounts go on.
Both of my accounts hit that wall on 1 December. The first read 100% at 16:50 UTC, two hours before its reset at 19:00. At 17:05 Anthropic refused one small read-only run, which cost $0. The engine held that account until 19:00. By then a second hold was on: too many CI jobs were waiting on the machine, and at times the CPU was busy, so no new run started at all. The account's next run started at 20:57. A quota used up two hours before the reset is close to perfect pacing.
The second account was less elegant. Anthropic refused two of its runs at 20:46 UTC, about 14 hours before its own reset, and the engine held it until then while the first account's projects carried on. Pace did not save it, and it was never meant to: the ranking moves work around, it does not slow anything down. Slowing down is the job of the next limit.
What is the daily dollar limit for, then?
The daily limit decides how much runs. Each group of projects has a limit in whole dollars per day. At the limit, no new run starts until the next day, and a run already going finishes. A limit of $0 starts nothing.
Pace decides which work runs first. The daily limit decides how much runs at all. Anthropic decides when the week is over. Each has one job, and none of them guesses at another's.
The dollar limit is also the one I got wrong most often. Between 8 and 18 November I changed it 22 times, anywhere from $0 to $1,000, and from 12 to 27 November it held the engine 1,150 times. A number I change twice a day is a number I do not understand yet. How the limits look in the panel is on the limits page.
What changed, week by week?
Here is the honest part: not much data yet. I removed the percentage stops on 28 November, the ranking by pace shipped on 30 November, and the panel has shown each account's pace since 1 December. These are the weeks before, Monday to Sunday in UTC, the first one only three days long:
| Week | Run time | Merged PRs | Quota rule that held it |
|---|---|---|---|
| 6 to 8 November | 63.3 hours | 79 | None |
| 9 to 15 November | 254.9 hours | 344 | The 95% stop, for a few hours on 14 November |
| 16 to 22 November | 214.9 hours | 304 | The 95% stop on 17 November, then the 90% pause from 20 November |
| 23 to 29 November | 71.7 hours | 99 | The 90% pause until 24 November |
| 30 November to 1 December, 17:20 UTC | 13.4 hours | 33 | None; ranking by pace from 30 November |
The week of 23 November shows what the pause and the $0 limit cost together: a third of the run time of the week before.
The next thing I check is whether the weeks after pacing look better than these, with the same numbers side by side.
Until then, the rule of thumb works without any engine: if you used more of the quota than the week has gone, the job that can wait starts tomorrow.


