⬢github TypeScript · 72 ★ +67 since we first saw it · pushed 6 h ago · MIT
rbartoli/agent-usage-guard
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, and asks in Claude Code's own dialog.
agent-usage-guard is a Claude Code plugin (mod) that prevents runaway usage spend before it happens. It monitors your plan's 5-hour and weekly usage windows, caps subagent fan-out and heavy-context prompts across all sessions, and asks for confirmation in Claude Code's native dialog—or refuses with an explanation when no one is around. It stores only counts and coarse buckets, never prompt text, and fails open if broken.
Why now: Shared on Show HN and tied to a widely shared pain point: aggressive multi-agent runs (like the author's 394-subagent, 84M-token incident) can burn entire usage windows in minutes, with similar reports across Reddit and GitHub.
Who it is for: Claude Code users on metered plans who want guardrails against agents spawning excessive parallel subagents or burning through rate-limit windows.
ai-agentsclaude-codeclaude-code-modclaude-code-plugindeveloper-toolsguardrailsrate-limitingsubagentstypescriptusage-limits
Stars over our 145 snapshots: 5 to 72, since 3 d ago.
Where people talked about it
API: https://socialmediatrends-api.osmike.com/v1/repos/rbartoli/agent-usage-guard