claude-code-insights 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes to PyPI when you create a GitHub Release.
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API tokens to store.
5
+ # One-time setup: on pypi.org, add a trusted publisher for this repo with
6
+ # workflow "publish.yml" and environment "pypi".
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ jobs:
13
+ build-and-publish:
14
+ runs-on: ubuntu-latest
15
+ environment: pypi
16
+ permissions:
17
+ id-token: write # required for trusted publishing
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Build distributions
26
+ run: |
27
+ python -m pip install --upgrade build
28
+ python -m build
29
+
30
+ - name: Publish to PyPI
31
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,27 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ wheelhouse/
9
+
10
+ # Virtual environments
11
+ .venv/
12
+ venv/
13
+ env/
14
+
15
+ # Tooling caches
16
+ .pytest_cache/
17
+ .mypy_cache/
18
+ .ruff_cache/
19
+
20
+ # Generated output
21
+ claude_insights.html
22
+ *.local.html
23
+
24
+ # OS / editor
25
+ .DS_Store
26
+ .idea/
27
+ .vscode/
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.1.0] - 2026-06-25
8
+
9
+ ### Added
10
+ - Initial public release.
11
+ - History tab: searchable, filterable session browser with per-session and
12
+ bulk export (Markdown, CSV, JSON, HTML, plain text).
13
+ - Analytics tab: estimated token usage and cost, cost-by-project and tool-usage
14
+ charts, token-ratio donut, top expensive sessions, and dismissable insights.
15
+ - Productivity tab: prompts-per-day chart, activity heatmap, streaks, busiest
16
+ projects, prompt-length distribution, session duration stats, and repeated
17
+ prompt-pattern clustering.
18
+ - CLI summary output and `--version` flag.
19
+ - Optional `tiktoken` extra (`pip install "claude-code-insights[tokens]"`) for
20
+ more accurate token counts.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pragnesh Rana
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: claude-code-insights
3
+ Version: 0.1.0
4
+ Summary: Local session-history browser, token/cost analytics, and productivity insights for Claude Code.
5
+ Project-URL: Homepage, https://github.com/pragnesh12/claude-code-insights
6
+ Project-URL: Repository, https://github.com/pragnesh12/claude-code-insights
7
+ Project-URL: Issues, https://github.com/pragnesh12/claude-code-insights/issues
8
+ Author-email: Pragnesh Rana <pragnesh.rana@nyusoft.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: analytics,claude,claude-code,cli,productivity,tokens
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.9
24
+ Provides-Extra: tokens
25
+ Requires-Dist: tiktoken>=0.5; extra == 'tokens'
26
+ Description-Content-Type: text/markdown
27
+
28
+ <div align="center">
29
+
30
+ # ◆ claude-code-insights
31
+
32
+ **Turn your Claude Code session history into a browsable dashboard — with token, cost, and productivity analytics. 100% local.**
33
+
34
+ [![PyPI](https://img.shields.io/pypi/v/claude-code-insights?color=d97757&label=pypi)](https://pypi.org/project/claude-code-insights/)
35
+ [![Python](https://img.shields.io/badge/python-3.9%2B-6E97D6)](https://pypi.org/project/claude-code-insights/)
36
+ [![License: MIT](https://img.shields.io/badge/license-MIT-5FB389)](LICENSE)
37
+ [![Runs 100% local](https://img.shields.io/badge/runs-100%25%20local-d97757)](#privacy)
38
+
39
+ </div>
40
+
41
+ ---
42
+
43
+ `claude-code-insights` reads the `.jsonl` transcripts Claude Code already keeps under
44
+ `~/.claude/projects/`, builds a single self-contained `claude_insights.html` you open in any
45
+ browser, and prints a quick summary to your terminal. No server, no upload, no account.
46
+
47
+ ```text
48
+ Claude Insights — 128 sessions · 14 projects
49
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
+ Est. tokens: 678K input · 388K output
51
+ Est. cost: ~$13.08 (Opus pricing)
52
+ Top tool: Bash (621 calls)
53
+ Busiest day: 2026-06-23 (52 prompts)
54
+ Longest session: Refactor auth flow (4h 12m)
55
+ ```
56
+
57
+ <!--
58
+ 📸 Add a screenshot to make this shine: save a PNG of the dashboard to docs/screenshot.png,
59
+ then uncomment the block below.
60
+
61
+ <div align="center">
62
+ <img src="docs/screenshot.png" alt="claude-code-insights dashboard" width="820">
63
+ </div>
64
+ -->
65
+
66
+ ## Three views
67
+
68
+ | View | What you get |
69
+ |------|--------------|
70
+ | 🗂️ **History** | Search and filter every session, read full conversations, and export one or all of them to Markdown, CSV, JSON, HTML, or plain text. |
71
+ | 📊 **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). |
72
+ | 🔥 **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. |
73
+
74
+ ## Install
75
+
76
+ ```bash
77
+ pipx install claude-code-insights # recommended
78
+ # or
79
+ uvx claude-code-insights # run without installing
80
+ # or
81
+ pip install claude-code-insights # into the current environment
82
+ ```
83
+
84
+ For more accurate token counts (uses `tiktoken`):
85
+
86
+ ```bash
87
+ pipx install "claude-code-insights[tokens]"
88
+ ```
89
+
90
+ ## Usage
91
+
92
+ ```bash
93
+ claude-insights # write claude_insights.html + print a summary
94
+ claude-insights --open # also open the report in your browser
95
+ claude-insights --cli-only # terminal summary only, skip the HTML
96
+ claude-insights --dir PATH # use a custom projects directory
97
+ claude-insights --out FILE # custom HTML output filename
98
+ claude-insights --version
99
+ ```
100
+
101
+ You can also run it as a module: `python3 -m claude_insights --open`.
102
+
103
+ ## Privacy
104
+
105
+ Everything runs on your machine — nothing is uploaded anywhere. The generated HTML embeds your
106
+ prompts and responses, which may contain file paths, code, and secrets. **Review the file before
107
+ sharing it with anyone.**
108
+
109
+ ## A note on cost figures
110
+
111
+ Cost numbers are **estimates**, not real API charges. They multiply estimated token counts by
112
+ Claude **Opus** pricing ($5 / $25 per 1M input / output tokens) — your actual model and rates may
113
+ differ. Treat them as a relative signal, not a bill.
114
+
115
+ ## Development
116
+
117
+ ```bash
118
+ git clone https://github.com/pragnesh12/claude-code-insights
119
+ cd claude-code-insights
120
+ pip install -e ".[tokens]"
121
+ claude-insights --help
122
+ ```
123
+
124
+ ## License
125
+
126
+ [MIT](LICENSE) · An unofficial tool — not affiliated with or endorsed by Anthropic. "Claude" and
127
+ "Claude Code" are trademarks of Anthropic.
@@ -0,0 +1,100 @@
1
+ <div align="center">
2
+
3
+ # ◆ claude-code-insights
4
+
5
+ **Turn your Claude Code session history into a browsable dashboard — with token, cost, and productivity analytics. 100% local.**
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/claude-code-insights?color=d97757&label=pypi)](https://pypi.org/project/claude-code-insights/)
8
+ [![Python](https://img.shields.io/badge/python-3.9%2B-6E97D6)](https://pypi.org/project/claude-code-insights/)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-5FB389)](LICENSE)
10
+ [![Runs 100% local](https://img.shields.io/badge/runs-100%25%20local-d97757)](#privacy)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ `claude-code-insights` reads the `.jsonl` transcripts Claude Code already keeps under
17
+ `~/.claude/projects/`, builds a single self-contained `claude_insights.html` you open in any
18
+ browser, and prints a quick summary to your terminal. No server, no upload, no account.
19
+
20
+ ```text
21
+ Claude Insights — 128 sessions · 14 projects
22
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
23
+ Est. tokens: 678K input · 388K output
24
+ Est. cost: ~$13.08 (Opus pricing)
25
+ Top tool: Bash (621 calls)
26
+ Busiest day: 2026-06-23 (52 prompts)
27
+ Longest session: Refactor auth flow (4h 12m)
28
+ ```
29
+
30
+ <!--
31
+ 📸 Add a screenshot to make this shine: save a PNG of the dashboard to docs/screenshot.png,
32
+ then uncomment the block below.
33
+
34
+ <div align="center">
35
+ <img src="docs/screenshot.png" alt="claude-code-insights dashboard" width="820">
36
+ </div>
37
+ -->
38
+
39
+ ## Three views
40
+
41
+ | View | What you get |
42
+ |------|--------------|
43
+ | 🗂️ **History** | Search and filter every session, read full conversations, and export one or all of them to Markdown, CSV, JSON, HTML, or plain text. |
44
+ | 📊 **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). |
45
+ | 🔥 **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. |
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pipx install claude-code-insights # recommended
51
+ # or
52
+ uvx claude-code-insights # run without installing
53
+ # or
54
+ pip install claude-code-insights # into the current environment
55
+ ```
56
+
57
+ For more accurate token counts (uses `tiktoken`):
58
+
59
+ ```bash
60
+ pipx install "claude-code-insights[tokens]"
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ ```bash
66
+ claude-insights # write claude_insights.html + print a summary
67
+ claude-insights --open # also open the report in your browser
68
+ claude-insights --cli-only # terminal summary only, skip the HTML
69
+ claude-insights --dir PATH # use a custom projects directory
70
+ claude-insights --out FILE # custom HTML output filename
71
+ claude-insights --version
72
+ ```
73
+
74
+ You can also run it as a module: `python3 -m claude_insights --open`.
75
+
76
+ ## Privacy
77
+
78
+ Everything runs on your machine — nothing is uploaded anywhere. The generated HTML embeds your
79
+ prompts and responses, which may contain file paths, code, and secrets. **Review the file before
80
+ sharing it with anyone.**
81
+
82
+ ## A note on cost figures
83
+
84
+ Cost numbers are **estimates**, not real API charges. They multiply estimated token counts by
85
+ Claude **Opus** pricing ($5 / $25 per 1M input / output tokens) — your actual model and rates may
86
+ differ. Treat them as a relative signal, not a bill.
87
+
88
+ ## Development
89
+
90
+ ```bash
91
+ git clone https://github.com/pragnesh12/claude-code-insights
92
+ cd claude-code-insights
93
+ pip install -e ".[tokens]"
94
+ claude-insights --help
95
+ ```
96
+
97
+ ## License
98
+
99
+ [MIT](LICENSE) · An unofficial tool — not affiliated with or endorsed by Anthropic. "Claude" and
100
+ "Claude Code" are trademarks of Anthropic.
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "claude-code-insights"
7
+ dynamic = ["version"]
8
+ description = "Local session-history browser, token/cost analytics, and productivity insights for Claude Code."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Pragnesh Rana", email = "pragnesh.rana@nyusoft.com" }]
13
+ keywords = ["claude", "claude-code", "analytics", "cli", "tokens", "productivity"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Utilities",
26
+ ]
27
+ dependencies = []
28
+
29
+ [project.optional-dependencies]
30
+ # More accurate token counting (uses the cl100k_base encoding).
31
+ tokens = ["tiktoken>=0.5"]
32
+
33
+ [project.scripts]
34
+ claude-insights = "claude_insights.cli:main"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/pragnesh12/claude-code-insights"
38
+ Repository = "https://github.com/pragnesh12/claude-code-insights"
39
+ Issues = "https://github.com/pragnesh12/claude-code-insights/issues"
40
+
41
+ [tool.hatch.version]
42
+ path = "src/claude_insights/__init__.py"
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["src/claude_insights"]
@@ -0,0 +1,3 @@
1
+ """claude-code-insights — local analytics & history browser for Claude Code sessions."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,6 @@
1
+ """Enable `python3 -m claude_insights`."""
2
+
3
+ from claude_insights.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()