anomaly-detection-time-series

anomaly-detection-time-series is a skill for Claude Code from clamp-sh/analytics-skills. It costs 182 tokens per session (5,405 once invoked), scanned A, original, MIT.

A collection of formal methods for finding unusual changes in time-series data, which is data recorded over time. It supplements quick pattern matching when several explanations fit or the change date is uncertain.

In plain words
What is it for?
Use it to investigate ambiguous traffic or metric changes, contested change dates, and possible anomalies. It applies methods including seasonal decomposition, changepoint detection, and forecasting.
Why use it?
It helps distinguish a real shift from normal seasonal movement, noise, or an incorrectly chosen change date. It provides a stronger baseline when a simple visual pattern is not enough.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the analytics-skills plugin — 13 skills shipped together

Good fit Use it to investigate ambiguous traffic or metric changes, contested change dates, and possible anomalies. It applies methods including seasonal decomposition, changepoint detection, and forecasting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clamp-sh/analytics-skills/anomaly-detection-time-series
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 clamp-sh/analytics-skills --skill anomaly-detection-time-series
Clone the repo
git clone --depth 1 https://github.com/clamp-sh/analytics-skills

Made for: Claude Code.

Or install analytics-skills, the plugin that ships this one along with the rest of its 13 skills.

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 anomaly-detection-time-series

README.md
[![agentmods](https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/anomaly-detection-time-series/github.svg)](https://agentmods.dev/skills/clamp-sh/analytics-skills/anomaly-detection-time-series)
Your own site
<a href="https://agentmods.dev/skills/clamp-sh/analytics-skills/anomaly-detection-time-series"><img src="https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/anomaly-detection-time-series/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 anomaly-detection-time-series

Your own site · 80×15
<a href="https://agentmods.dev/skills/clamp-sh/analytics-skills/anomaly-detection-time-series"><img src="https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/anomaly-detection-time-series.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 182 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,405 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.00182 $0.05405
Opus 5 $0.00091 $0.02703
Sonnet 5 $0.00036 $0.01081
Haiku 4.5 $0.00018 $0.00541

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

Security

Grade A, and why

anomaly-detection-time-series 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 11d 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.

skills/anomaly-detection-time-series/SKILL.md · 256 lines

How it starts

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

Anomaly detection for time series

The fingerprint library in traffic-change-diagnosis is a fast first pass: it pattern-matches the shape of a drop against twelve common causes. It is right most of the time and wrong when it matters most — when two fingerprints fit the same shape, when the user's eyeballed change date is off by a day, or when a counterfactual baseline is needed instead of a slope match. This skill adds six formal methods that resolve those cases. None of them replace the fingerprints; they adjudicate when fingerprints conflict.

When NOT to use this

  • The fingerprint match is unambiguous (single hypothesis, >0.7 confidence in the diagnosis worksheet). Running STL or BOCD on a clean tracking-regression drop is ceremony.
  • The series is shorter than 14 days. STL needs at least two full seasonal cycles; BOCD's posterior is noisy with less than ~30 observations; Prophet needs more history than that to fit changepoints. For short series, stick to analytics-diagnostic-method's denominator + sample-size discipline.
  • The user wants a real-time alert on a single metric and hasn't already decided what "anomalous" means. That's a monitoring-design conversation, not a detection method; load sequential-monitoring instead.
  • The metric is count-based with most days at zero (e.g. a niche conversion event). STL and Prophet assume continuous-ish residuals; you'll get nonsense decompositions. Use Poisson-tail tests instead.

Pick one method per question

Do not run all six on every series. Each method answers a different question. Pick by question shape:

Question Method Output
Is the change date the user gave actually the change date? BOCD Posterior P(changepoint = day t) for every t
Is today's number real, or is Tuesday always like this? STL decomposition Residual z-score against seasonal baseline
Where would the series be without the drop? Prophet Forecast interval treating pre-drop as baseline
Is this hour anomalous, given the usual hour-of-day spread? Quantile regression P10/P50/P90 bands per hour
Should the alert fire now or wait for more data? SPRT Log-likelihood ratio crossing a Wald boundary
X and Y both happened this week — did X precede Y predictively? Granger causality F-test on lagged regressors

Read the full file on GitHub · 256 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. 11d ago First seen · 256 lines · 182 tokens per session scan A a4b008c4b490

Subscribe to this mod's changes

anomaly-detection-time-series is a skill published in the GitHub repository clamp-sh/analytics-skills (8 stars, last pushed 3mo ago), licensed MIT. It adds 182 tokens to every session and 5,405 once invoked, about $0.0009 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-08-31.