What problem does it solve?
Teams running AI agent swarms accumulate API costs across sessions without any automated gate enforcing budget limits, risking unexpected overspend. This Skill reads accumulated cost-tracking records, compares total spend against a configured budget, and enforces a four-tier alert ladder so overspending is caught before it happens.
Core Features & Use Cases
- Utilization Computation: Sums
total_cost_usd across all session-* cost records and calculates percentage utilization against the configured budget.
- Four-Tier Alert Ladder: Emits INFO at 50%, WARNING at 75%, CRITICAL at 90%, and HARD_STOP at 100% with recommended actions per level.
- Fail-Closed Guard: Exits with code 1 at 100% utilization, enabling
budget.mjs check && spawn guards that block non-essential agent spawns.
- Use Case: Before spawning a new agent swarm, run the budget check; if utilization is at or above 90%, escalate to cost optimization instead of launching more spend.
Quick Start
Ask the AI to check current API spend against the configured budget and report the utilization percentage and alert level.