What problem does it solve?
Aggregate cost trends can hide individual rogue sessions that burn through budget. This Skill pinpoints exactly which specific sessions are statistical outliers in spend, so you can investigate runaway loops, stuck expensive tiers, or crashed sessions instead of guessing.
Core Features & Use Cases
- Robust Outlier Detection: Computes median and MAD (median absolute deviation) across session costs, then flags sessions with modified z-scores above a configurable threshold (default 3.5, per Iglewicz-Hoaglin 1993).
- CI Gate Integration: The --alert-on-outliers flag returns a non-zero exit code when outlier counts exceed a limit, enabling automated build failures on anomalous spend.
- Direction Labeling: Classifies outliers as high (runaway spend) or low (crashed/dropped sessions) so operators interpret results correctly.
- Use Case: Run a weekly check with --since 7d --alert-on-outliers 1 in CI to fail the pipeline whenever any session that week is a >3.5σ spending outlier, then investigate with cost report.
Quick Start
Ask the AI to run cost anomaly detection over the last 7 days of sessions and alert if any individual session is a spending outlier.