Skip to content
Conduit

skill

claude-usage-analytics

Local-first token usage & imputed-cost analytics for Claude Code: incremental parser, SQLite, live dashboard, SDLC-stage cost breakdowns, and efficiency scoring.

krishnesh7/claude-usage-analyticscommunitylistedunreviewed

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/krishnesh7/claude-usage-analytics itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Oct 26, 2026

claude-usage-analytics

Local-first token usage & imputed-cost analytics for Claude Code. Parses your ~/.claude/projects session transcripts into SQLite and surfaces them through a live dashboard, static HTML reports, slash commands, and an in-project CLAUDE_USAGE.md. Everything runs offline on your machine — no data leaves it, and there's near-zero LLM overhead (the parser is pure code).

What it tracks

  • Token usage and imputed API-equivalent $ cost per project, SDLC stage, and model
  • Cost modes — toggle between API (pay-per-token), Conservative (blended cache estimate), and Subscription (flat-plan imputed) pricing, with auto-detected default based on your plan
  • Efficiency scoring — per-project efficiency across 4 axes (Cache Hygiene, Cache Payback, Model Fit, Cost Economy) with percentile ranks and actionable recommendations
  • Session-kind split (user vs subagent vs tracker) so totals aren't double-counted
  • Cache-hit rate per project / stage / model
  • Per-day stacked trend chart (user vs subagent)
  • Cleaned session labels, secret redaction on every display surface

Prerequisites

The plugin auto-creates its Python venv and installs its own dependencies on first run, but it assumes these are already on your machine:

ToolRequiredUsed for
Python ≥ 3.10yesthe cu CLI + dashboard
Node.jsyesthe transcript parser (parse.mjs)
Internet (first run only)yesone-time pip install of deps
jq, sqlite3optionalhook conveniences; degrade gracefully if absent

Without Node, the database never populates and reports show zeros. cu parse prints a warning to stderr if node is missing.

Install

/plugin marketplace add krishnesh7/claude-usage-analytics
/plugin install claude-usage-analytics

Then just start a Claude Code session. The SessionStart hook runs bin/cu, which on first use:

  1. creates a private venv under the plugin and pip installs the package,
  2. creates the SQLite DB + seeds config defaults,
  3. migrates any existing ~/.claude/usage history,
  4. begins parsing your sessions in the background.

No manual setup.

Slash commands

CommandDoes
/usageToken + cost summary for this project (last 7 days)
/usage-reportSelf-contained interactive HTML report
/usage-docWrite/refresh docs/usage/CLAUDE_USAGE.md
/usage-parseForce a re-parse
/stageSet this session's SDLC stage
/project-initRegister the current directory as a project
/project-listList registered projects with totals
/project-confirmVerify/correct this session's project tag
/usage-guideGetting-started guide
/usage-compareCompare vs the official session-report plugin

Live dashboard

cu serve            # http://localhost:7777, auto-refreshes every 30s

While serving, a background loop re-parses every 60s so in-flight sessions appear without a manual refresh. The dashboard has time + kind filters, sortable tables, an efficiency panel with per-project scores and recommendations, project → stage → session drill-down navigation with breadcrumbs, hover tooltips on key metrics, and session search.

Configuration

Env varDefaultPurpose
CU_DATA_DIR${CLAUDE_PLUGIN_ROOT}/data (else ~/.claude/usage)Where the DB + config live
CU_REDACT_PROMPTSmaskSecret redaction mode: mask / hash / off
CU_SERVE_AUTO_PARSE_SEC60Dashboard background re-parse interval (0 disables)

Pricing lives in <data dir>/prices.json (USD per 1M tokens). The DB stores raw token counts, so editing prices reprices all history retroactively.

Privacy

  • All data stays in your local SQLite DB; nothing is transmitted.
  • Prompt content is redacted (9 secret patterns) before it reaches the dashboard, static report, or CLAUDE_USAGE.md.
  • The data dir (DB, history) is git-ignored and never committed.

Development

git clone https://github.com/krishnesh7/claude-usage-analytics
cd claude-usage-analytics
python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/cu --help

Run from a checkout and cu resolves the parser at ./parser/parse.mjs and the data dir at ~/.claude/usage (no CLAUDE_PLUGIN_ROOT).

License

MIT

↑↓ navigate openesc close