Home / Claude Code mods / Security / agent-usage-guard

agent-usage-guard

agent-usage-guard is a Claude Code mod by rbartoli that a Claude Code mod that holds subagent fan-out, heavy-context prompts and retry loops before they spend your usage window. It reads your plan's usage, counts agents across every session,.

Updated 2026-11-19

What is agent-usage-guard?

agent-usage-guard is a Claude Code mod by rbartoli that a Claude Code mod that holds subagent fan-out, heavy-context prompts and retry loops before they spend your usage window. It reads your plan's usage, counts agents across every session,. It is listed under Security and has 103 GitHub stars.

TypeClaude code mod
Authorrbartoli
Repositoryrbartoli/agent-usage-guard
Popularity103 GitHub stars
CategorySecurity
SecurityReview before installing (68/100)
Rank#292 of 9,397 Claude Code mods; #45 in Security
LicenseMIT
Last commit2026-11-19
Hooks16 events
Seesclassic hooks, every prompt, every tool call, subagent spawns
Draws onAbovePrompt

Is agent-usage-guard safe to install?

agent-usage-guard scores 68/100 on the MCPMods security check: Review before installing. Things to review: reads environment variables; watches every prompt or event. It passed 4 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts no processesPass
Writes no files or configPass
Reads environment variablesReview
Watches every prompt or eventReview
Drives Claude (model calls, prompts)Note
Validator reported problemsNote
Has an open-source licensePass

API calls in its code

CallWhat it means
$.clock.after
$.clock.now
$.command.register
$.env.getreads env vars
$.fs.readreads files
$.prompt.fillwrites the prompt box
$.prompt.read
$.prompt.submitdrives Claude
$.session.compactdrives Claude
$.session.id
$.session.messagesreads the transcript
$.session.usage
$.state.get
$.state.set
$.store.deletekeeps its own state
$.store.getkeeps its own state
$.store.keyskeeps its own state
$.store.setkeeps its own state
$.ui.askdraws interface
$.ui.logdraws interface
$.ui.resolvedraws interface
$.ui.statusdraws interface

How do I install agent-usage-guard?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/rbartoli/agent-usage-guard
    claude plugin validate ./agent-usage-guard/.
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add rbartoli/agent-usage-guard && claude plugin install agent-usage-guard@agent-usage-guard

Or ask Claude to set it up

Paste this into Claude Code and it installs agent-usage-guard for you:

Install the "agent-usage-guard" Claude Code mod from https://github.com/rbartoli/agent-usage-guard. Run claude plugin validate on it first and show me what it can access before you enable it.