Skip to main content

Local session-history browser, token/cost analytics, and productivity insights for Claude Code.

Project description

◆ claude-code-insights

Turn your Claude Code session history into a browsable dashboard — with token, cost, and productivity analytics. 100% local.

PyPI Python License: MIT Runs 100% local


claude-code-insights reads the .jsonl transcripts Claude Code already keeps under ~/.claude/projects/, builds a single self-contained claude_insights.html you open in any browser, and prints a quick summary to your terminal. No server, no upload, no account.

Claude Insights — 128 sessions · 14 projects
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Est. tokens:     678K input · 388K output
Est. cost:       ~$13.08  (Opus pricing)
Top tool:        Bash (621 calls)
Busiest day:     2026-06-23 (52 prompts)
Longest session: Refactor auth flow (4h 12m)

Three views

View What you get
🗂️ History Search and filter every session, read full conversations, and export one or all of them to Markdown, CSV, JSON, HTML, or plain text.
📊 Analytics Estimated token usage and cost, cost-by-project and tool-usage charts, input/output token ratio, your most expensive sessions, and automatic insights (cost spikes, tool-heavy or very long sessions, streaks).
🔥 Productivity Prompts-per-day trend, an hour-by-day activity heatmap, current/longest streaks, busiest projects, prompt-length distribution, session durations, and clustering of repeated prompt patterns.

Install

pipx install claude-code-insights        # recommended
# or
uvx claude-code-insights                 # run without installing
# or
pip install claude-code-insights         # into the current environment

For more accurate token counts (uses tiktoken):

pipx install "claude-code-insights[tokens]"

Usage

claude-insights              # write claude_insights.html + print a summary
claude-insights --open       # also open the report in your browser
claude-insights --cli-only   # terminal summary only, skip the HTML
claude-insights --dir PATH   # use a custom projects directory
claude-insights --out FILE   # custom HTML output filename
claude-insights --version

You can also run it as a module: python3 -m claude_insights --open.

Privacy

Everything runs on your machine — nothing is uploaded anywhere. The generated HTML embeds your prompts and responses, which may contain file paths, code, and secrets. Review the file before sharing it with anyone.

A note on cost figures

Cost numbers are estimates, not real API charges. They multiply estimated token counts by Claude Opus pricing ($5 / $25 per 1M input / output tokens) — your actual model and rates may differ. Treat them as a relative signal, not a bill.

Development

git clone https://github.com/pragnesh12/claude-code-insights
cd claude-code-insights
pip install -e ".[tokens]"
claude-insights --help

License

MIT · An unofficial tool — not affiliated with or endorsed by Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_insights-0.1.0.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_code_insights-0.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_code_insights-0.1.0.tar.gz.

File metadata

  • Download URL: claude_code_insights-0.1.0.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_code_insights-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c53be541c8042754cb5c8208f95b3b3b8de7588e3a0515849e1ee58219ceee5
MD5 8c558eeadffa9618a9617621f2c9b2db
BLAKE2b-256 fb89337151d3e488084ada28c7ecf57f28483bcf529281509281a25fbad4d602

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_insights-0.1.0.tar.gz:

Publisher: publish.yml on pragnesh12/claude-code-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_insights-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_insights-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a29389a342db70d21782d4288b235f99b09bc14aa8fee602c1788c86fedf0071
MD5 eebe8311ac61ab7e3f37996f60808433
BLAKE2b-256 35b2b0f08424d32848d907233783eff4ceb96ee9af903fefb24516a63e1fe33f

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_insights-0.1.0-py3-none-any.whl:

Publisher: publish.yml on pragnesh12/claude-code-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page