/am-insights:anomalies [threshold]from am-insights
Lists cost and token outlier sessions from the Agent Monitor dashboard using z-score analysis. Optionally accepts a threshold argument (default 2.0).
Ships in am-insights. Installing the plugin adds it to Claude Code.
What the command file sets; muted values are Claude Code's defaults
List the current cost/token outlier sessions from the Agent Monitor dashboard using a z-score test. $ARGUMENTS optionally sets the z-score threshold (default 2.0; lower = stricter).
Fetch the population:
curl -s "http://localhost:4820/api/sessions?limit=200" → a session list; each item has id, status, model, cwd, started_at, cost, and metadata.Compute the baseline over all returned sessions:
cost.curl -s http://localhost:4820/api/pricing/cost/<id> and sum input_tokens + output_tokens + cache_read_tokens + cache_write_tokens; compute mean and stddev of total tokens too.Flag outliers: any session whose z = (value − mean) / stddev exceeds the threshold (default 2.0) on cost (primary) or tokens (secondary). Skip the calc gracefully if stddev is 0.
Print the flagged sessions, sorted by descending cost z-score:
Output rules: a Markdown table of flagged sessions only; currency in USD to 4 decimals; z-scores to 2 decimals; if nothing exceeds the threshold, say "No cost/token outliers above z=" and report the top session by cost for context. Cite only API values — never fabricate. If the dashboard is unreachable at http://localhost:4820, tell the user to start it with npm start from the repo root.
7-day visitors to each command page
3 commands in this plugin
5 plugins ship this exact command · first indexed Aug 10, 2026
npx claudepluginhub tanvoid0/agent-monitor --plugin am-insightsOther plugins' commands for the same job