I previously shared building a money-saving dashboard for AI. Back then, I was mostly looking at “how much money I spent.” Using it now, I realized what really hurts isn’t the money, it’s the quota: Claude Code’s subscription has 5-hour and 7-day rolling windows. Hit the limit, and it just stops dead in its tracks.

In this post, I’ll share the open-source little tool we made for this: claude-pacer (github.com/drpwchen/claude-pacer).

Why build this?

It started with getting cut off in the middle of the night a few times.

I often throw a long task to Claude before bed: batch organizing lecture transcripts, running a paper radar, or scanning textbooks to turn into notes. I figure I’ll wake up to collect the results, only to have it hit the 5-hour limit at 2 AM and get abruptly stopped. I wake up the next day to a half-finished mess, and I still have to clean up after it.

AI doesn’t know fatigue when working, but it has zero concept of “quota is running low, I’d better save my work."

There are also a few other daily annoyances when multitasking:

  • Opening four or five windows and forgetting which one is doing what: Every terminal looks exactly the same. You switch over and have to scroll the conversation a bit just to remember.
  • Not knowing how much is left to run: If I dispatch a batch of agents right now, will they all get cut off halfway through?
  • Forgetting which model is selected: I open Opus in the morning to handle a hard problem, then use it for chores in the afternoon, and the quota just evaporates.

Aren’t there already plenty of status line tools out there?

Yes, and they’re all great! ccusage, ccstatusline, and CCometixLine are all very mature works, and using them is totally fine. You can also find auto-resume scripts, but their approach is to stare at the screen waiting for the “hit the limit” message to appear, and then automatically click continue for you. The task breaks exactly where it dies; if a file is half-edited, it breaks right there.

But I wanted a bit more: a status line is made for humans to see, and humans sleep in the middle of the night; the one that really needs to see the alert is the AI that’s still running. Before hitting the wall, its behavior should change first: starting at 85%, no opening new large projects; at 93%, clean up the current steps and stop, then set up a scheduled job to resume from the same conversation after the quota recovers. So claude-pacer is a three-layer design:

Layer one: a status line, for humans

See all statuses in one line:

Session Topic │ 5h ▓▓▓┃░░ 42%·2h13m left │ 7d ▓▓▓▓┃▓░ 71% │ Ctx ▓▓░░░░ 34% │ Fable 5·high
  • Session topic: The session title generated by Claude Code itself. Open multiple windows, and each has a name tag.
  • A time marker overlaid on the usage bar: If the solid bar passes the marker, you’re burning faster than the clock, and it’s time to stop. If it hasn’t reached the marker, you can safely keep dispatching work.
  • Ctx: The context window fullness. You have an idea before it gets compacted.
  • Model + reasoning effort hanging on the far right. You’ll see it before you forget to switch back.

The width is adaptive. If the terminal gets narrow, it automatically switches to a compact version, so it won’t break the layout when viewed on a phone.

Layer two: budget-guard, for AI

This layer is the original motivation for the whole tool

When the quota burns to 85%, the hook automatically injects a “start wrapping up” instruction into Claude’s context: finish the work at hand, don’t start any new large projects. At 93%, it’s a hard alert: cleanly wrap up the current steps, set up a scheduled job for a few minutes after the quota resets to automatically resume (continuing directly in the same conversation), report to the user, and end the turn.

So the ending of hitting the limit in the middle of the night changed: I wake up to a progress update left by the AI, and a scheduled job that automatically resumes once the quota recovers.

Layer three: usage_verdict, for agents

This layer was forced out of me by the AI’s own math 🤣. With the reset arithmetic of rolling windows, the AI calculates it wrong almost every time it reads the raw numbers. The window has actually already reset, but it sees a residual 92% in the file and gets too scared to move. Or the 7-day window shows 95%, but it actually resets earlier than the 5-hour window, so it’s not a limitation at all.

Rather than letting it reason through it every time, it’s better to hardcode the rules into a single-line verdict:

$ python usage_verdict.py
GO — 5h at 42%, 133 min left, projected ~61% at reset — headroom available

GO/PACE/STOP — the agent just follows these three words, no need to calculate it itself.

If you want to use it

It’s MIT open source, runs on Windows/macOS/Linux, and has zero dependencies outside of Node.js and Python:

github.com/drpwchen/claude-pacer (complete Traditional Chinese documentation available)

The three layers can be used separately: if you just want the status line, install the status line; the alert hook is optional. To emphasize again, using someone else’s tool for the status line is also great. The focus of this set is the latter two layers: pushing the defense line from “humans staring at it” to “AI knowing it itself”.

My other AI tools are organized in this toolbox post, and this set will be added there later. If you have any questions or suggestions, feel free to leave a comment to discuss!