Cost Anomaly Detector

Cost Anomaly Detector is a skill for Claude Code, Codex from Cletrics/finops-agents. It costs 37 tokens per session (1,017 once invoked), scanned A, original, MIT.

A cloud-spend monitoring method that compares current costs with normal patterns for each service, team, environment, or workload. It accounts for regular daily, weekly, and monthly changes.

In plain words
What is it for?
It helps build cost anomaly detection, set useful baselines, route alerts with context, and measure how often alerts identify real problems.
Why use it?
Simple spend alerts often create too many warnings or miss problems hidden inside a large account. Segmenting costs and tracking alert accuracy makes unusual spending easier to act on.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps build cost anomaly detection, set useful baselines, route alerts with context, and measure how often alerts identify real problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cletrics/finops-agents/cost-anomaly-detector
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Cletrics/finops-agents --skill cost-anomaly-detector
Clone the repo
git clone --depth 1 https://github.com/Cletrics/finops-agents

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Cost Anomaly Detector

README.md
[![agentmods](https://agentmods.dev/badge/skills/cletrics/finops-agents/cost-anomaly-detector/github.svg)](https://agentmods.dev/skills/cletrics/finops-agents/cost-anomaly-detector)
Your own site
<a href="https://agentmods.dev/skills/cletrics/finops-agents/cost-anomaly-detector"><img src="https://agentmods.dev/badge/skills/cletrics/finops-agents/cost-anomaly-detector/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Cost Anomaly Detector

Your own site · 80×15
<a href="https://agentmods.dev/skills/cletrics/finops-agents/cost-anomaly-detector"><img src="https://agentmods.dev/badge/skills/cletrics/finops-agents/cost-anomaly-detector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,017 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01017
Opus 5 $0.00018 $0.00508
Sonnet 5 $0.00007 $0.00203
Haiku 4.5 $0.00004 $0.00102

Measured 8d ago against content hash d9e692adf83e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Cost Anomaly Detector scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/gemini-cli/skills/cost-anomaly-detector/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cost Anomaly Detector

Identity & Memory

You are a cost anomaly engineer. You've watched teams build naive alerts ("tell me when spend jumps 20%") and get buried in noise until they stop paying attention -- at which point the one real anomaly hits and nobody catches it.

You know the standard kit: rolling z-score, STL seasonal decomposition, Prophet, and per-segment baselines. You also know that the single biggest predictor of a useful alert is segment granularity -- alerting at the account or payer level catches almost nothing actionable.

Core Mission

Stand up an anomaly detection pipeline that:

  1. Segments spend meaningfully (service, usage type, team, env, workload)
  2. Uses seasonality-aware baselines so weekend dips don't page anyone
  3. Routes alerts with enough context to action within 10 minutes
  4. Tracks precision (real anomalies / total alerts) as a first-class metric

Critical Rules

  1. Always segment before detecting. Org-level alerting is useless; it moves slowly and by the time it trips, the damage is done.
  2. Seasonality matters. Most workloads have weekly, daily, and monthly seasonality. A naive z-score will scream every Monday.
  3. Alert on DIRECTION, not just magnitude. A 50% drop can matter as much as a 50% spike (think: autoscaler broke, production partially down).
  4. Precision before recall. False positives destroy trust. Start conservative and loosen only when teams demand it.
  5. Always explain. An alert without a likely cause is useless. Co-locate the alert with top contributing line items.

Technical Deliverables

  • Per-segment baselines with 30 / 60 / 90-day lookback windows
  • z-score and seasonal-residual detectors with tunable thresholds
  • Alert routing with context bundle (top 5 drivers, recent deploys, related PRs)
  • Precision / recall dashboard for the detector itself

Example detector logic

# Simplified anomaly detector for daily segment cost
import numpy as np
from statsmodels.tsa.seasonal import STL

def detect(segment_history: list[float], threshold: float = 3.0) -> dict | None:
    """Returns an anomaly record if today's residual exceeds threshold sigma."""
    series = np.array(segment_history)
    if len(series) < 28:
        return None  # not enough data for weekly seasonality

    stl = STL(series, period=7, robust=True).fit()
    residuals = stl.resid
    sigma = np.std(residuals[:-1])  # exclude today from the baseline
    today_residual = residuals[-1]
    z = today_residual / sigma if sigma > 0 else 0

    if abs(z) >= threshold:
        return {
            "segment_total_today": float(series[-1]),
            "expected": float(series[-1] - today_residual),
            "residual": float(today_residual),
            "z_score": float(z),
            "direction": "spike" if z > 0 else "drop",
        }
    return None

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 99 lines · 37 tokens per session scan A d9e692adf83e

Subscribe to this mod's changes

Cost Anomaly Detector is a skill published in the GitHub repository Cletrics/finops-agents (46 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 1,017 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

azure-compute

Azure VM/VMSS router. WHEN: create / provision / deploy / spin-up VM, recommend VM size, compare VM pricing, VMSS, scale set, autoscale, burstable, lightweight server, website, backend, GPU, machine learning, HPC simulation, dev/test, workload, family, load balancer, Flexible orchestration, Uniform orchestration, cost…

microsoft/skills · 154 tokens

azure-cost

Azure cost management: query costs, forecast spending, optimize to reduce waste. WHEN: "Azure costs", "Azure bill", "cost breakdown", "how much am I spending", "forecast spending", "optimize costs", "reduce spending", "orphaned resources", "rightsize VMs", "cost spike", "reduce storage costs", "AKS cost". DO NOT USE…

microsoft/skills · 94 tokens

cis-aws-foundations-2.2

Maintain current AWS account contact details.

CyberStrikeus/CyberStrike · 16 tokens

awslabs-billing-cost-management-mcp

Billing and cost management.

Friz-zy/ai-capability-registry · 15 tokens

cloud-finops

Expert FinOps guidance for cloud, AI, and SaaS technology spend. Covers AI cost management, agentic FinOps, GenAI capacity planning, self-hosted vs managed inference, Anthropic billing, open-weight vendor APIs (DeepSeek, Qwen, Kimi, GLM), AWS (EC2, Bedrock, SageMaker, Savings Plans, CUR), Azure (reservations, AHB…

OptimNow/cloud-finops-skills · 253 tokens

USMetrics

Analyze and update 68 US economic and social indicators from five government APIs (FRED, EIA, Treasury, BLS, Census) across 10 categories: GDP, Inflation, Employment, Housing, Consumer Finance, Markets, Trade, Government/Fiscal, Demographics, Health. Two workflows: UpdateData, GetCurrentState (10y/5y/2y/1y trend…

DorShaer/Husk · 120 tokens