Per-prompt cost & token analytics for Claude Code — built with Streamlit (CLI + dashboard, fully local)

I built a Streamlit dashboard to analyze every prompt I send to Claude Code — directly from local JSONL logs. No API key, no data leaves the machine.

It combines a CLI + interactive dashboard (using Apache ECharts via streamlit-echarts) with:

  • cost and token tracking per prompt and per project
  • session-level aggregation
  • auto-categorization of prompts by type
  • and more (usage patterns, cost insights, etc.)

Live demo (fake data, no login): https://prompt-analytics-demo.streamlit.app

Run it locally on your real Claude usage in 3 commands:

uv tool install “prompt-analytics-for-claude-code[dashboard]”
prompt-analytics run --categorize
prompt-analytics dashboard

Streamlit note: streamlit-echarts only registers properly via a real streamlit run (AppTest shows an empty registry), and cross-filtering relies on chart selection events.

Feedback very welcome — still early (0.x).

Nice app! Should be super useful.