Skip to main content

◆ 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.

Metadata

Release files for claude-code-insights 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-code-insights 0.1.0
File Size Uploaded
claude_code_insights-0.1.0.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-code-insights 0.1.0
File Interpreter ABI Platform
claude_code_insights-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.8 kB

Release files / claude_code_insights-0.1.0.tar.gz

Download URL claude_code_insights-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9c53be541c8042754cb5c8208f95b3b3b8de7588e3a0515849e1ee58219ceee5
BLAKE2b-256 checksum
How to use checksums
fb89337151d3e488084ada28c7ecf57f28483bcf529281509281a25fbad4d602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.

Transparency log

Release files / claude_code_insights-0.1.0-py3-none-any.whl

Download URL claude_code_insights-0.1.0-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a29389a342db70d21782d4288b235f99b09bc14aa8fee602c1788c86fedf0071
BLAKE2b-256 checksum
How to use checksums
35b2b0f08424d32848d907233783eff4ceb96ee9af903fefb24516a63e1fe33f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page