spend-circuit-breaker
SkillDev toolsTracks cumulative API spend against a monthly budget and pauses non-essential automations when thresholds are crossed
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the spend-circuit-breaker skill
What this skill tells your AI
The instructions your AI receives, as published by archieindian/openclaw-superpowers in skills/openclaw-native/spend-circuit-breaker/SKILL.md and read by ahel’s review.
OpenClaw has no built-in hard spending cap. This skill monitors session logs to estimate cumulative API cost, alerts at configurable thresholds, and automatically pauses non-essential cron automations when the monthly budget ceiling is hit.
Setup (first run)
Before the skill is useful, record your monthly budget in state:
python3 check.py --set-budget 50 # $50/month hard cap
python3 check.py --set-alert 0.5 0.75 # Alert at 50% and 75%
Cron Wakeup Behaviour
Runs every 4 hours (cron: "0 */4 * * *"). On each wakeup:
- Read
~/.openclaw/skill-state/spend-circuit-breaker/state.yaml— loadmonthly_budget_usdandspend_this_month_usd - Parse OpenClaw session logs from
~/.openclaw/sessions/to estimate new spend sincelast_checked_at(model × token counts × price table) - Update
spend_this_month_usdandlast_checked_atin state - Apply threshold logic (see below)
- Reset spend to 0 on the 1st of each month
Threshold logic
| Spend % | Action |
|---|---|
| < 50% | Log silently — nothing to surface |
| ≥ 50% | Notify user: "You've used ~50% of your $X budget this month" |
| ≥ 75% | Notify user + suggest which cron skills to pause |
| ≥ 100% | Notify user + automatically pause all cron-scheduled skills except daily-review, morning-briefing, and spend-circuit-breaker itself |
At 100%, write circuit_open: true to state. install.sh checks this flag before registering new cron jobs — new installs are allowed, new cron triggers are not.
Circuit reset
To restore automations after a budget reset or manual override:
python3 check.py --reset-circuit
This sets circuit_open: false and re-registers all paused cron jobs.
Model price table
The script ships with a price table for common models (claude-3-5-sonnet, gpt-4o, etc.). To add a custom model:
python3 check.py --add-model my-model-name --input-cost 3.00 --output-cost 15.00
Prices are per million tokens.
Signals
- GitHub stars
- 72
- Forks
- 14
- Last commit
- May 2026
Advanced
- Item type
- skill
- Key
spend-circuit-breaker- Source
- github.com/archieindian/openclaw-superpowers
github.com/archieindian/openclaw-superpowers