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 pokutunav0.5.0MITIn 1 marketplace
Stop model requests before you exhaust your Claude usage. A mod that reads the 5h/7d usage % and the session cost from Claude Code itself and stops every request, subagents included, once a threshold is reached (use cost on plans with no usage quota). Needs a Claude Code build with mods.
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 writes files; reads environment variables (HOME, XDG_STATE_HOME).
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
rate-limit, usage, quota, mod
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Stop model requests before you exhaust your Claude usage.
Set a threshold and once it is reached, the plugin stops every model request, subagents included, so you don't burn through your usage. Two kinds of threshold:
5h / 7d) — for plans that have a usage quota (Pro / Max / Team / Enterprise).5h/7d aren't reported, i.e. a plan with no usage quota.Both figures come from Claude Code itself, so measuring costs zero extra quota — no claude -p, no OAuth token, no API calls, no statusLine setup. It fails open: with no data, no threshold, or an internal error, requests go through normally.
Requires a Claude Code build with mods (function hooks, early access). On a build without them the plugin does not work: it stops nothing, and the build may report a plugin load error.
costis per-session. Each session'scostlimit tracks only that session's own spend.5h/7dare account-wide, and a reading from one session also guards the others.
claude plugin marketplace add pokutuna/claude-plugins
claude plugin install limit-usage@pokutuna-plugins --scope user
Note: We recommend
--scope user(default). See Recommendation.
/limit-usage 5h=80 # stop when the 5h window is 80% used (this session)
/limit-usage 5h=80 7d=90 # set both windows in one go
/limit-usage cost=$5 # stop once this session reaches ~$5 (cost=5 / $5 also work)
/limit-usage 7d=90 --global # apply to all sessions (5h/7d only)
/limit-usage clear # remove this session's thresholds (global ones stay)
/limit-usage clear --global # remove this session's and the global thresholds
/limit-usage status # thresholds + current usage
For 5h/7d the number is the used percentage (0–100): 80 means "80% used / 20% left". A session threshold overrides the global one for the same window. For cost it's an approximate USD amount Claude Code estimates, so treat it as a rough cap. It is per-session only: cost with --global is set for the current session.
While a request is being stopped, the plugin's status line under the prompt shows why and how to lift it, e.g. Blocked: 5h 81.0% >= 80% · resets 18:10 · /limit-usage clear. When the threshold behind the block was set with --global, the line names /limit-usage clear --global instead. The command itself never sends a model request, so it works while blocked.
5h/7d figures appear after the first API response of any session. If status never shows them, your plan has no usage quota — use a cost limit instead.
flowchart LR
CC[Claude Code] -->|"session.measure: rate limits"| P["limit-usage"]
P -->|"latest readings"| ST[("plugin store")]
P -->|"snapshot"| SNAP[("cc-limit-usage.json")]
SET["/limit-usage"] -->|thresholds| ST
STEP["each model step<br>(main and subagents)"] --> G{{"turn.step:<br>used% / cost ≥ threshold?"}}
ST -.-> G
G -- Yes --> STOP["No request sent"]
G -- No / no data --> SEND["Request sent"]
turn.step hook compares current usage against the thresholds. When one is reached it answers the step itself, so no request is sent.--global thresholds and shared readings live in the plugin store Claude Code manages. The plugin keeps no state file of its own.Each time the rate limits change, the plugin writes ${XDG_STATE_HOME:-~/.local/state}/cc-limit-usage.json:
{"schema":1,"epoch":1794250515,"rateLimits":[{"kind":"five_hour","percentUsed":25,"resetsAt":"2026-11-09T21:10:00.000Z"}]}
It is for display tools only; the guard never reads it. Treat unparsable content or an unknown schema as no value.
0.4.x captured usage by wrapping your statusLine. After updating:
statusLine.command in ~/.claude/settings.json back to your original command (the part 0.4.x passed to statusline-wrapper.sh).${XDG_STATE_HOME:-~/.local/state}/cc-limit-usage.conf and ~/.claude/plugins/data/limit-usage-pokutuna-plugins/.Thresholds are not carried over; set them again with /limit-usage.
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 pokutuna/claude-plugins --plugin limit-usage