cost-burn

Tracks production spend burn-rate trends and alerts on acceleration over configurable thresholds.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill cost-burn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-burn
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-cost-tracker/skills/cost-burn
Command: npx skills add https://github.com/ruvnet/claude-flow --skill cost-burn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Teams running AI agent workloads often discover runaway API spend only after a budget alarm fires. This Skill detects when daily production spend is accelerating relative to its historical baseline, catching cost spikes (like a hot loop burning 10x normal) before budgets are breached.

Core Features & Use Cases

  • Burn-Rate Trending: Bins session spend from the cost-tracking namespace into configurable time buckets (e.g., 1d over 14d) and computes window-over-window deltas.
  • Drift Alert Exit Codes: Exits 1 when the latest bucket exceeds the prior mean by a configurable percentage, enabling CI/CD gating.
  • Cold-Start Safety: Skips alerts gracefully when there is no prior baseline, avoiding spurious notifications on sparse history.
  • Use Case: Add cost burn --bucket 1d --lookback 7d --alert-on-acceleration-pct 100 to a CI pipeline to fail the build and page on-call when today's spend doubles versus the weekly mean.

Quick Start

Run the cost burn command with a 1-day bucket and 7-day lookback to check whether today's production spend has accelerated more than 100 percent over the prior weekly average.

Frequently Asked Questions about cost-burn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect runaway AI API spend before hitting budget limits?

Use burn-rate trend analysis that bins session spend into daily buckets and compares the latest bucket against the prior mean. Set an acceleration threshold (e.g., --alert-on-acceleration-pct 100) so the command exits 1 when spend accelerates abnormally, independent of total budget.

How to fail a CI build when cloud or API costs spike?

Run cost burn with a bucket and lookback window plus an acceleration threshold in your pipeline, for example --bucket 1d --lookback 7d --alert-on-acceleration-pct 100. The command exits 1 on threshold breach, so you can chain it with an alerting step to page on-call.

What is the difference between cost-burn and cost-trend?

cost-burn reads production session records from the cost-tracking namespace to answer whether real spend is accelerating. cost-trend reads benchmark run files to detect drift in win rate or latency. They operate on different data sources and answer different questions.

Why does the burn alert not fire on a new deployment?

Alerts are intentionally skipped when there are no prior non-empty buckets, since there is no baseline to compare against. The command exits 0 with a reason string, preventing spurious alerts during cold-start periods.

What happens when prior spend buckets are all zero?

If prior buckets total $0 but the latest bucket has spend, the delta is reported as Infinity or null in JSON and marked new in the table. No alert fires because there is no meaningful baseline for comparison.