Labsco
MCP SERVER

Claude Token Analyzer

by li195111

Find out where your Claude Code tokens went, and what to fix first.

Model Routing, Multi-Model Consultation & Cost Control
Summary
Severity scores, so you fix the expensive thing first.

A list of anomalies without ranking is a list of things to worry about; ranking them turns it into one thing to change. Low cache hit rate is usually the one worth reading first, because it inflates cost without showing up as unusual usage.

What it is

A local Rust server that parses the JSONL session logs under ~/.claude into SQLite and reports on them. The logs are never modified and nothing leaves the machine.

What you get
  • Session logs parsed, de-duplicated and written into the local database — sync_db
  • One session scored across ten dimensions — analyze_session
  • Project-level aggregation with sorting, and a cross-project view — analyze_project, analyze_global
  • A monthly cost report, with daily granularity available — cost_report
  • Six anomaly types detected and scored by severity — HighCost, LowCacheHitRate, CostInefficient, ExcessiveToolUse, HighTokenUsage and UnusualModelMix — anomaly_scan
  • Daily, weekly and monthly usage trends with burn-rate projection — trend_report
  • Six skills that route a plain question to the right report, in English or Chinese
Requirements

Install as a Claude Code plugin with claude plugin install claude-token-analyzer — the binary downloads itself, so no Rust toolchain is needed. Every environment variable is optional: CTA_DB_PATH, CTA_PROJECTS_DIR, CTA_ARCHIVE_DIR, CTA_PRICING_PATH and CLAUDE_CONFIG_DIR override the default paths.

Setup effort

One command — claude plugin install claude-token-analyzer