whereismyai
Agent Usage Guard
Agent Usage Guard is a Claude Code mod that holds subagent fan-out and heavy-context prompts before usage limits are reached.
Agent Usage Guard is a Claude Code mod that runs inside Claude Code and holds runaway spend before it happens. It reads plan-level live usage and caps subagent fan-out, heavy-context churn, and retry loops. The tool acts before agent starts, prompt sends, or tool calls run, maintaining limits across every Claude Code session on the machine. When interactive, it asks the user via Claude Code's question dialog, or refuses and notifies Claude when nobody can answer. It is local, privacy-minimal, stores coarse counts instead of prompt text, and fails open so broken hooks never break user sessions.
Agent Usage Guard at a glance
Key features
- Reads live 5-hour and weekly plan usage percentages
- Caps subagent fan-out and heavy context
- Asks for approval in Claude Code's dialog
- Refuses identical failing retry loops
- Stores coarse counts and never prompt text
- Fails open if hooks fail
- Provides status reports via /agent-guard
Use it for
- Preventing sudden Claude Code usage limit lockouts
- Capping parallel subagent spawns and heavy context churn
- Blocking infinite identical tool call retry loops
- Managing token consumption across multiple local sessions
Companions
Tools that articles about Agent Usage Guard recommend using with it, each with its job.
- Claude Code — Built to work with Claude Code.
- Context7 — Provides up-to-date documentation for AI agents and code editors.
- Playwright MCP — Enables LLMs to interact with web pages using structured accessibility snapshots.
- GitHub MCP Server — Reads pull requests, issues and code search on GitHub.
- Superpowers — Brainstorm, plan and execute skills for bigger tasks.
- gstack — Skill bundle for planning, review and shipping.
Alternatives to Agent Usage Guard
- Claude Code Usage Monitor — Tracks token usage, message counts, and session costs with local history and alerts.
- Claude Code mods — Add live lines above the prompt, command guards, panes, and games to Claude Code.
- Agent Archive — Hand off coding sessions between Claude Code, Codex, and Cursor across machines.
- Reviewer Agent — It uses a separate AI model to review code and prevent premature agent stopping.
- Repo Guards — It prevents AI agents from performing destructive actions across multiple repositories.
- AgentGuard — Get a security and quality assessment of AI skills in seconds without an account.
- Stop That Shit — Enforces task boundaries to stop unnecessary AI agent actions.
- Runway — Control Claude Code and Codex sessions on local or cloud machines from any phone.
- Claude Super Sidebar — It brings agent relationships, execution states, and task flows into one panel.
- Claude Code Harness — Enforces a disciplined delivery loop with verification gates and safety checks.
- Flash Agents — Offloads reading and typing to cheap workers while keeping Claude for review
- Airlock: coding agents, kept contained — Isolates coding agents in a virtual machine and lets users review file diffs before applying changes.
All Agent Usage Guard alternatives