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.
| Type | Claude code mod |
|---|---|
| Author | rbartoli |
| Repository | rbartoli/agent-usage-guard |
| Popularity | 103 GitHub stars |
| Category | Security |
| Security | Review before installing (68/100) |
| Rank | #292 of 9,397 Claude Code mods; #45 in Security |
| License | MIT |
| Last commit | 2026-11-19 |
| Hooks | 16 events |
| Sees | classic hooks, every prompt, every tool call, subagent spawns |
| Draws on | AbovePrompt |
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.
| Check | Result |
|---|---|
| No network access | Pass |
| Starts no processes | Pass |
| Writes no files or config | Pass |
| Reads environment variables | Review |
| Watches every prompt or event | Review |
| Drives Claude (model calls, prompts) | Note |
| Validator reported problems | Note |
| Has an open-source license | Pass |
API calls in its code
| Call | What it means |
|---|---|
$.clock.after | |
$.clock.now | |
$.command.register | |
$.env.get | reads env vars |
$.fs.read | reads files |
$.prompt.fill | writes the prompt box |
$.prompt.read | |
$.prompt.submit | drives Claude |
$.session.compact | drives Claude |
$.session.id | |
$.session.messages | reads the transcript |
$.session.usage | |
$.state.get | |
$.state.set | |
$.store.delete | keeps its own state |
$.store.get | keeps its own state |
$.store.keys | keeps its own state |
$.store.set | keeps its own state |
$.ui.ask | draws interface |
$.ui.log | draws interface |
$.ui.resolve | draws interface |
$.ui.status | draws interface |
How do I install agent-usage-guard?
- Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
claude --version
- 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/.
- 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.