analyze_sessionLABSCO 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
Follow the published steps
USE CASES
Working out what this month actually cost
Sync the logs, then read a monthly breakdown with the model split — daily granularity is there when a single spike needs explaining.
Finding the sessions that are burning tokens
Scan for the six statistical anomaly types and read them back ordered by severity, rather than scrolling through every session.
Comparing projects against each other
Aggregate at project level with sorting, then step up to the cross-project view to see which one is out of line with the rest.
Projecting where the month is heading
Daily, weekly and monthly trends come with a burn-rate projection, so the question becomes a number instead of a guess.
8 tools
Listed in project docs. Your client may show a different list.
analyze_projectanalyze_globalcost_reportanomaly_scantrend_reportsync_dbclassify_session_patternBEFORE YOU INSTALL
What to know first
Tools you get
8 tools named in the project's documentation. classify_session_pattern is the eighth tool, missing from the main tools table. The six cta skills call these tools and are not tools themselves.
INSTALLATION
Connect your client
Server setup
Setup
git clone https://github.com/li195111/claude-token-analyzer.git
cd claude-token-analyzer
bash scripts/build.sh
claude --plugin-dir .Or install the published package
Claude Code
claude plugin install claude-token-analyzer