agentleFS
koteitankoteitan/my-skills/skills/check-usage/SKILL.md

check-usage

Skill1 starsChanged 3 months agoMITView on GitHub

Report the Claude Code 5-hour and weekly (Max plan) rate-limit state — percent used, reset time, and the exhaustion forecast at the current pace. Use when the user asks how much of the limit is left or when it resets, and before committing to a large workflow fanout that could die mid-run.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the script and report its output:

    line 8
  2. Distinctive:

    Run this before committing to a large fanout, and again between phases.

    line 28
  3. Distinctive:

    Read the forecast asymmetrically: If it names a time, believe it and don't start the fanout.

    line 32
  4. Distinctive:

    Never make disk discipline conditional on this reading (1 agent = 1 file, draft early, no in-memory accumulation).

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

check-usage

Run the script and report its output:

python3 ~/.claude/skills/check-usage/scripts/check-usage.py

It prints, for both windows:

5 hours limit:  90% used, will reset at 07/17 08:00, limited at 07/17 07:12 in the current pace
weekly limit :  51% used, will reset at 07/18 05:00, not projected to hit the limit before the reset

Pacing a workflow

A rate-limit death mid-fanout destroys every in-flight subagent's context: the agent() call is journaled as {"type":"result","value":null}, and a resumeFromRunId restarts it from the bare prompt. Only files on disk survive. So:

  • Run this before committing to a large fanout, and again between phases. Prefer several smaller workflows in sequence, checking here in the main loop between them — a workflow script cannot read the log itself (no filesystem access), so self-pacing inside a script costs a sentinel agent per round.
  • Read the forecast asymmetrically. If it names a time, believe it and don't start the fanout. If it doesn't, that is not proof of headroom: the slope is extrapolated from past pace, and a fanout is precisely what breaks that pace.
  • To size a fanout, read ~/.claude/statusline-usage.log directly: how much the percentage moved during the last comparable wave is a better cost estimate than the forecast.
  • Weekly and 5-hour are asymmetric — burning the weekly costs days, the 5-hour at most five hours. Degrade harder when the weekly is thin.
  • Never make disk discipline conditional on this reading (1 agent = 1 file, draft early, no in-memory accumulation). Context is also lost to API errors, compaction and interrupts, and the forecast is least reliable exactly when it says you are fine.

Notes

  • Data comes from ~/.claude/statusline-usage.log, which statusline-command.sh appends from the server-side rate_limits fields Claude Code feeds the statusline. This is authoritative — do not reconstruct windows from local JSONL (e.g. ccusage blocks infers boundaries and drifts from the real reset).
  • The forecast is a wall-clock slope extrapolation over the current window's samples, so idle time counts. It is only shown when 100% would be reached before the reset; otherwise the reset wins and there is nothing to warn about.
  • Early in a window the percentage may not have moved yet (1% resolution), so no forecast appears — which is also when plenty remains.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.