Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Aethrylv0.2.0MITIn 1 marketplace
Pause tool use once weekly Claude plan usage reaches a cap; /usage-cap sets, enables or disables it.
Code that runs inside Claude Code on every session, as you, unsandboxed.
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A weekly usage cap for Claude Code. Stops your agents from spending the rest of the week's Claude plan while you're not watching.
You leave three agents running overnight. In the morning the week's limit is gone and it's only Tuesday. usage-guard puts a ceiling on that: once your weekly plan usage reaches the cap you set, every tool call is refused with a clear message, so sessions stall instead of burning the rest of the week.
● Bash(cargo build)
⎿ Weekly Claude usage is at 85% (cap 84%). Tool use is paused until the weekly limit
resets (Mon 02 Nov, 13:00). Raise the cap with /usage-cap <percent>, or turn the
guard off with /usage-cap off.
/usage-cap is a slash command, not a tool call, so you can raise
the cap or switch it off from a blocked session without restarting.seven_day rate-limit window Claude Code itself
reports, the one the status line shows. No API keys, no scraping.At the prompt of a Claude Code session:
/plugin install usage-guard --marketplace Aethryl/claude-usage-guard
Answer y to add the marketplace and pick the user scope. The default cap is 84 %, active
right away.
| Command | What it does |
|---|---|
/usage-cap | Show the cap, on/off, current weekly usage and exempt projects |
/usage-cap 95 | Set the cap to 95 % (any 1–100) and turn the guard on |
/usage-cap off | Turn the guard off |
/usage-cap on | Turn it back on |
/usage-cap reset | Back to the default cap (84 %) and on |
/usage-cap exempt | Never block the current project (its root and everything under it) |
/usage-cap unexempt | Remove the current project's exemption |
> /usage-cap
usage-guard on: cap 84%, weekly usage 61%, resets Mon 02 Nov, 13:00; this project is not exempt.
tool call ──▶ guard on? ──no──▶ run
│yes
▼
project exempt? ──yes──▶ run
│no
▼
weekly usage ≥ cap? ──no──▶ run
│yes
▼
refuse, with the usage, the cap and the reset time
The plugin is a single hooks module (hooks/register.ts, about 100 lines) on
Claude Code's tool.call event. Its only state is the cap, the on/off switch and the exempt list,
kept in the plugin's own store.
Does it count tokens or call any API? No. It asks Claude Code for the usage figure it already has.
What about the 5-hour window? Out of scope. Claude Code already stops at that limit, and it resets within hours. The weekly one is the one that hurts.
Does --dangerously-skip-permissions bypass it?
No. That flag skips permission prompts, not plugin hooks. Use /usage-cap off instead.
Can I set different caps per project? Not yet: there is one cap per machine, plus the exempt list.
claude plugin validate . # manifest and module checks
claude plugin test . # run the test suite
claude --plugin-dir . # try it in a session without installing
Built and tested on Claude Code 2.1.310. Issues and PRs welcome.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub aethryl/claude-usage-guard --plugin usage-guard