spend-circuit-breaker

Installation
SKILL.md

spend-circuit-breaker

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:

  1. Read ~/.openclaw/skill-state/spend-circuit-breaker/state.yaml — load monthly_budget_usd and spend_this_month_usd
  2. Parse OpenClaw session logs from ~/.openclaw/sessions/ to estimate new spend since last_checked_at (model × token counts × price table)
Related skills
Installs
15
GitHub Stars
61
First Seen
Mar 21, 2026