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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c53be541c8042754cb5c8208f95b3b3b8de7588e3a0515849e1ee58219ceee5
|
|
| MD5 |
8c558eeadffa9618a9617621f2c9b2db
|
|
| BLAKE2b-256 |
fb89337151d3e488084ada28c7ecf57f28483bcf529281509281a25fbad4d602
|
Provenance
The following attestation bundles were made for claude_code_insights-0.1.0.tar.gz:
Publisher:
publish.yml on pragnesh12/claude-code-insights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_insights-0.1.0.tar.gz -
Subject digest:
9c53be541c8042754cb5c8208f95b3b3b8de7588e3a0515849e1ee58219ceee5 - Sigstore transparency entry: 1966218582
- Sigstore integration time:
-
Permalink:
pragnesh12/claude-code-insights@d66bd5228c0c8ee15ad4abf33f7bf60ae64640cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/pragnesh12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d66bd5228c0c8ee15ad4abf33f7bf60ae64640cb -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_code_insights-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_code_insights-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29389a342db70d21782d4288b235f99b09bc14aa8fee602c1788c86fedf0071
|
|
| MD5 |
eebe8311ac61ab7e3f37996f60808433
|
|
| BLAKE2b-256 |
35b2b0f08424d32848d907233783eff4ceb96ee9af903fefb24516a63e1fe33f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_insights-0.1.0-py3-none-any.whl -
Subject digest:
a29389a342db70d21782d4288b235f99b09bc14aa8fee602c1788c86fedf0071 - Sigstore transparency entry: 1966218655
- Sigstore integration time:
-
Permalink:
pragnesh12/claude-code-insights@d66bd5228c0c8ee15ad4abf33f7bf60ae64640cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/pragnesh12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d66bd5228c0c8ee15ad4abf33f7bf60ae64640cb -
Trigger Event:
release
-
Statement type: