/claude-token-analyzer:cta-anomaly-huntfrom claude-token-analyzer
Detects statistical anomalies in Claude Code usage (cost, cache, tokens, tool use) with severity scoring and automatic drill-down into suspicious sessions.
Ships in claude-token-analyzer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Scan for anomalies, triage by severity, and drill into suspicious sessions for root cause diagnosis.
Execute mcp__token-analyzer__sync_db. Skip if already called in this conversation.
Execute mcp__token-analyzer__anomaly_scan with:
stddev_threshold: 2.0 (default), user can adjust (1.5 sensitive / 3.0 conservative)min_tokens_for_cache_check: 10000 (default), adjustableproject_path: optionalIMPORTANT: anomaly_scan output can exceed 370K characters. Write raw output to ${TMPDIR:-/tmp}/cta-anomaly-report.json before parsing.
Sort and present anomalies in this priority order:
Anomalies with severity scores sort before those without.
For the highest-severity anomalies, execute mcp__token-analyzer__analyze_session with each session_id to obtain the 10-dimension analysis.
Limit automatic drill-down to 5 sessions maximum to avoid excessive token consumption.
For each analyzed session, output a diagnostic card:
### 🔴 Session a1b2c3d4 — CostInefficient (severity: 8.5)
- **成本**:$X.XX(超出平均 X.Xσ)
- **Cache 命中率**:X.X%(平均 XX.X%)
- **模型**:claude-opus-4-6
- **Tool 排名**:Read(35), Bash(12), Edit(8)
- **壓縮事件**:2 次(turn 8, turn 15)
- **可能原因**:上下文頻繁壓縮導致 cache 失效,大量重讀檔案
- **建議**:考慮分拆任務以減少壓縮頻率
Infer "possible cause" and "suggestion" from the 10-dimension analysis data:
${TMPDIR:-/tmp}/cta-anomaly-report.json first.stddev_threshold (1.5=sensitive, 2.0=balanced, 3.0=conservative).min_tokens_for_cache_check to filter short sessions from cache analysis.$X.XX USD.For MCP tool parameter details and anomaly type definitions: ${CLAUDE_PLUGIN_ROOT}/skills/cta/references/tool-reference.md
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub li195111/claude-token-analyzer --plugin claude-token-analyzer7 skills in this plugin
/ctaThis skill should be used when the user asks to "analyze token usage", "check costs",
"how much did I spend", "token analysis", "session analysis", "cta", or mentions
Claude Code usage efficiency, token spending, or cost optimization.
Routes to 6 workflow sub-skills: cta-health-check, cta-cost-audit, cta-anomaly-hunt,
cta-project-review, cta-trend-watch, cta-usage-pattern. Also handles ambiguous intent with a quick overview.
Do NOT trigger for: building token-related features, tokenizer/NLP work, or non-Claude cost analysis.
/cta-cost-auditThis skill should be used when the user asks about "monthly costs", "cost report",
"這個月花多少", "成本報告", "月度審計", "預算", or needs to understand cost
distribution by project, model, or time period. Supports cross-month comparison
and model cost optimization suggestions. Can also be routed from the main cta skill.
/cta-health-checkThis skill should be used when the user asks for a "quick check", "overview",
"how much did I spend", "看看狀況", "總覽", or wants a fast one-page summary
of Claude Code token usage and costs. The lightest CTA workflow, completes in
under 3 minutes. Can also be routed from the main cta skill.
/cta-project-reviewThis skill should be used when the user asks to "analyze this project", "project health check",
"分析這個專案", "專案健檢", "subagent efficiency", "tool usage analysis", "工具使用",
or needs detailed analysis of a specific project's token usage patterns. Provides four-dimension
analysis: cost, efficiency, tools, and architecture. Can also be routed from the main cta skill.
/cta-trend-watchThis skill should be used when the user asks about "trends", "usage trends",
"趨勢", "用量在漲嗎", "預測", "燃率", "burn rate", or wants to understand
whether Claude Code usage is increasing or decreasing over time. Supports
daily/weekly/monthly granularity with simple forecasting. Can also be routed
from the main cta skill.
/cta-usage-patternThis skill should be used when the user asks about "使用模式", "pattern 分析",
"harness 優化", "工作流建議", "ASCII 圖", or wants to understand how a Claude Code
session behaved and what to improve next. Uses classify_session_pattern as the hard-signal
source and turns it into actionable workflow guidance.
Other plugins' skills for the same job