/claude-token-analyzer:ctafrom claude-token-analyzer
Routes Claude Code token and cost analysis to workflow sub-skills. Handles ambiguous intent with an overview, and routes to health checks, audits, anomaly hunts, project reviews, trends, and usage patterns.
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.
Read when SKILL.md points to them.
Route token analysis requests to the appropriate workflow skill, or provide a quick overview for ambiguous intent.
mcp__token-analyzer__sync_db before workflows that read SQLite-backed aggregates (analyze_global, analyze_project, cost_report, anomaly_scan, trend_report) when the user asks for latest data. Historical classify_session_pattern lookups can run directly against JSONL without waiting for sync_db.| User Intent | Keywords | Route to |
|---|---|---|
| Quick status | 「看看」「總覽」「花了多少」「現在狀況」 | cta-health-check |
| Monthly cost | 「這個月」「成本報告」「月度」「預算」 | cta-cost-audit |
| Find anomalies | 「異常」「有問題嗎」「診斷」「排查」 | cta-anomaly-hunt |
| Project analysis | 「分析專案」「專案健檢」「subagent」「工具使用」 | cta-project-review |
| Trend forecast | 「趨勢」「在漲嗎」「預測」「燃率」 | cta-trend-watch |
| Usage pattern | 「使用模式」「pattern 分析」「harness 優化」「工作流建議」「sparkline」 | cta-usage-pattern |
| Element | Format |
|---|---|
| Currency | $X.XX USD |
| Percentage | One decimal (85.3%) |
| session_id | First 8 chars (a1b2c3d4) |
| Token count | Thousands separator (125,000) |
| Large output (>50K chars) | Write to ${TMPDIR:-/tmp}/cta-*.md, report path |
| Cache hit rate <70% | Mark with warning |
| Subagent ratio >20% | Mark with notice |
## CTA Overview
| Metric | Value |
|--------|-------|
| Total Sessions | X |
| Total Projects | X |
| Total Cost | $X.XX USD |
| Avg Cache Hit Rate | X.X% |
| Subagent Token Ratio | X.X% |
### Top 3 Projects (by cost)
1. project-name — $X.XX (N sessions)
### Top 3 Sessions (by cost)
1. a1b2c3d4 — $X.XX (project-name)
Follow with: 「要深入哪個方向?成本 / 異常 / 專案 / 趨勢」
For complete MCP tool parameters, return types, and known caveats:
references/tool-reference.md — 8 MCP tool quick reference with parameter defaults, advanced tuning, and known pitfallsSub-skills reference this file at the absolute path ${CLAUDE_PLUGIN_ROOT}/skills/cta/references/tool-reference.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
token-analysis, cost-audit, usage-patterns, claude-code-usage
npx claudepluginhub li195111/claude-token-analyzer --plugin claude-token-analyzer7 skills in this plugin
/cta-anomaly-huntThis skill should be used when the user asks about "anomalies", "problems", "有異常嗎",
"哪些會話有問題", "排查", "診斷", or suspects waste or efficiency issues in Claude Code
usage. Scans for 6 types of statistical anomalies with severity scoring and automatic
drill-down into suspicious sessions. Can also be routed from the main cta skill.
/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