Skip to content

Commit 308c24f

Browse files
committed
update landing page
1 parent 0af9a16 commit 308c24f

23 files changed

+612
-200
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ blogs/
4545
openspec
4646
.claude
4747
repo-insights.md
48+
coverage/
49+
context-stats-report-*.md
50+
.gstack/

README.backup.md

Lines changed: 68 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<div align="center">
2-
<img src="assets/logo/logo-full.svg" alt="cc-context-stats" width="320"/>
2+
<img src="assets/logo/logo-full.svg" alt="context-stats" width="320"/>
33

44
<h1>Know your context zone. Act before Claude degrades.</h1>
55

6-
[![PyPI version](https://img.shields.io/pypi/v/cc-context-stats)](https://pypi.org/project/cc-context-stats/)
7-
[![PyPI Downloads](https://img.shields.io/pypi/dm/cc-context-stats)](https://pypi.org/project/cc-context-stats/)
6+
[![PyPI version](https://img.shields.io/pypi/v/context-stats)](https://pypi.org/project/context-stats/)
7+
[![PyPI Downloads](https://img.shields.io/pypi/dm/context-stats)](https://pypi.org/project/context-stats/)
88
[![GitHub stars](https://img.shields.io/github/stars/luongnv89/cc-context-stats)](https://github.com/luongnv89/cc-context-stats)
99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1010

1111
Real-time context window monitoring for Claude Code. Five zones tell you exactly what to do next — keep coding, finish up, export your session, or restart.
1212

13-
[**Get Started →**](#installation-and-configuration)
13+
[**Get Started →**](#installation)
1414
</div>
1515

1616
---
@@ -19,19 +19,21 @@ Real-time context window monitoring for Claude Code. Five zones tell you exactly
1919

2020
```mermaid
2121
graph LR
22-
A["Claude Code session"] --> B["Status line script"]
22+
A["Claude Code session"] --> B["Python statusline script"]
2323
B --> C["Context zone + MI score"]
2424
B --> D["Local CSV state file"]
2525
D --> E["Live graph dashboard"]
26-
D --> F["Markdown export report"]
27-
E --> G["Delta · Cumulative · Cache · MI · I/O"]
28-
F --> H["Snapshot · Takeaways · Timeline · Charts"]
26+
D --> F["Session export report"]
27+
D --> G["Cross-project analytics"]
28+
E --> H["Delta · Cumulative · Cache · MI · I/O"]
29+
F --> I["Snapshot · Takeaways · Timeline · Charts"]
30+
G --> J["Cost · Tokens · Patterns · Sessions"]
2931
```
3032

31-
1. Claude Code pipes session JSON to the status line script on every refresh.
33+
1. Claude Code pipes session JSON to the Python statusline script on every refresh.
3234
2. The script computes zone, Model Intelligence (MI) score, and displays a compact status line.
33-
3. The CLI reads the local state file for live charts and exportable session reports.
34-
4. Everything stays local in `~/.claude/statusline/`.
35+
3. The CLI reads local state files for live charts, session reports, and cross-project analytics.
36+
4. Everything stays local `~/.claude/statusline/` for session state, `~/.claude/projects/` for analytics.
3537

3638
---
3739

@@ -80,7 +82,7 @@ When the terminal is narrow, lower-priority elements drop off in order — the p
8082
|:---:|:---:|
8183
| ![Green statusline](images/1.10/statusline-green.png) | ![Yellow statusline](images/1.10/1.10-statusline.png) |
8284

83-
### Rich Customization
85+
### Customization
8486

8587
Every element has its own color key. Override per-property or set hex values:
8688

@@ -97,7 +99,7 @@ show_delta=true
9799
token_detail=true
98100
```
99101

100-
Full palette: 18 named colors + any `#rrggbb` hex. Per-property colors override base color slots; base slots override built-in defaults. Copy the annotated example to get started:
102+
Full palette: 18 named colors + any `#rrggbb` hex. Copy the annotated example to get started:
101103

102104
```bash
103105
cp examples/statusline.conf ~/.claude/statusline.conf
@@ -153,19 +155,37 @@ Auto-refreshes every 2 seconds (flicker-free). Pass `-w 5` to slow it down or `-
153155

154156
---
155157

156-
## Cache Keep-Warm
158+
## Cross-Project Analytics
157159

158-
Claude's prompt cache has a ~5 minute TTL. A background heartbeat prevents expensive cache misses during pauses.
160+
Aggregate token usage and cost across **all** Claude Code projects and sessions:
159161

160162
```bash
161-
# Start keep-warm for 30 minutes
162-
context-stats <session_id> cache-warm on 30m
163+
context-stats report # Full analytics report (all time)
164+
context-stats report --since-days 30 # Last 30 days only
165+
context-stats report --output report.md # Write to specific file
166+
```
163167

164-
# Stop it
165-
context-stats <session_id> cache-warm off
168+
The report breaks down every token dollar spent across projects, models, and sessions:
169+
170+
```markdown
171+
## Grand Totals
172+
173+
- Total Tokens: 128,254,398
174+
- Input: 19,574,606 · Output: 46,329,340
175+
- Cache Creation: 1,835,113 · Cache Read: 60,515,339
176+
- Total Cost: $6,292.64
177+
- Total Sessions: 751 across 59 projects
166178
```
167179

168-
Heartbeats fire every 4 minutes (under the 5-min TTL). Runs as a detached background process on Unix, subprocess fallback on Windows. State tracked in `~/.claude/statusline/cache-warm.<session_id>.json`.
180+
| Section | What you learn |
181+
|---|---|
182+
| Grand Totals | Total spend, token breakdown (input/output/cache), session count |
183+
| Per-project breakdown | Which projects consume the most tokens and cost the most |
184+
| Top sessions | Heaviest sessions per project — identify costly workflows |
185+
| Cache efficiency | Cache read vs. cache creation ratio — high read ratio means good reuse |
186+
| Token composition | How much of your spend is output (expensive) vs. cache reads (cheap) |
187+
188+
Cache reads cost ~10x less than input tokens. The report makes cache efficiency visible so you can optimize session structure.
169189

170190
---
171191

@@ -179,7 +199,6 @@ context-stats <session_id> export --output report.md
179199

180200
| Section | Contents |
181201
|---|---|
182-
| Generate | Copyable command to regenerate this report |
183202
| Executive Snapshot | Model, project, duration, interactions, final zone, cache activity |
184203
| Summary | Window size, token totals, cost, final MI |
185204
| Key Takeaways | Short read of what changed |
@@ -205,18 +224,34 @@ See the full example in [`context-stats-export-output.md`](context-stats-export-
205224

206225
---
207226

208-
## Installation and Configuration
227+
## Cache Keep-Warm
228+
229+
Claude's prompt cache has a ~5 minute TTL. A background heartbeat prevents expensive cache misses during pauses.
230+
231+
```bash
232+
context-stats <session_id> cache-warm on 30m
233+
```
234+
235+
```bash
236+
context-stats <session_id> cache-warm off
237+
```
238+
239+
Heartbeats fire every 4 minutes (under the 5-min TTL). Runs as a detached background process on Unix, subprocess fallback on Windows.
240+
241+
---
242+
243+
## Installation
209244

210-
### Python (pip) — recommended
245+
### pip
211246

212247
```bash
213-
pip install cc-context-stats
248+
pip install context-stats
214249
```
215250

216-
### Python (uv)
251+
### uv
217252

218253
```bash
219-
uv pip install cc-context-stats
254+
uv pip install context-stats
220255
```
221256

222257
### Claude Code setup
@@ -232,7 +267,7 @@ Add to your Claude Code settings:
232267
}
233268
```
234269

235-
Restart Claude Code. The status line and dashboard both read the same local state files.
270+
Restart Claude Code. The status line, graph dashboard, session export, and analytics report all read the same local state files.
236271

237272
---
238273

@@ -242,17 +277,17 @@ Restart Claude Code. The status line and dashboard both read the same local stat
242277
Yes. MIT licensed, zero external dependencies.
243278

244279
**Does it send my data anywhere?**
245-
No. Session data stays local in `~/.claude/statusline/`.
280+
No. Session data stays local in `~/.claude/statusline/`. Analytics read from `~/.claude/projects/`.
246281

247282
**What runtimes does it support?**
248-
Python 3. Install via `pip install cc-context-stats`.
283+
Python 3 only. Install via `pip install context-stats`.
249284

250285
---
251286

252287
## Get Started
253288

254289
```bash
255-
pip install cc-context-stats
290+
pip install context-stats
256291
```
257292

258293
[Read the docs](docs/installation.md) · [View export example](context-stats-export-output.md) · MIT Licensed
@@ -262,7 +297,7 @@ pip install cc-context-stats
262297
<details>
263298
<summary><strong>Documentation</strong></summary>
264299

265-
- [Installation Guide](docs/installation.md) - Platform-specific setup (shell, pip)
300+
- [Installation Guide](docs/installation.md) - Platform-specific setup
266301
- [Context Stats Guide](docs/context-stats.md) - Detailed CLI usage guide
267302
- [Configuration Options](docs/configuration.md) - All settings explained
268303
- [Available Scripts](docs/scripts.md) - Script variants and features
@@ -290,7 +325,7 @@ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.
290325

291326
Context Stats hooks into Claude Code's status line feature to track token usage across sessions. The Python statusline script writes state data to local CSV files, which the `context-stats` CLI reads to render live graphs. Data is stored locally in `~/.claude/statusline/` and never sent anywhere.
292327

293-
The statusline is implemented in Python. Claude Code invokes the statusline script via stdin JSON pipe — the script reads JSON from stdin and writes formatted text to stdout.
328+
Claude Code invokes the statusline script via stdin JSON pipe — the script reads JSON from stdin and writes formatted text to stdout. The `report` subcommand reads Claude Code's own project logs from `~/.claude/projects/` to aggregate cross-session analytics.
294329

295330
</details>
296331

@@ -304,7 +339,7 @@ pip uninstall cc-statusline
304339
```
305340

306341
```bash
307-
pip install cc-context-stats
342+
pip install context-stats
308343
```
309344

310345
The `claude-statusline` command still works. The main change is `token-graph` is now `context-stats`.
File renamed without changes.

0 commit comments

Comments
 (0)