Session Report - patrickbykov/claude-telemetry-widget GitHub Wiki
TL;DR: Run session-report.py <session-id> to get a self-contained HTML report for one session. It uses the same formulas as the menu and adds 2 estimates: what compacting earlier would have saved, and whether the session ever compacted.
python3 session-report.py <session-id>You can also open it from the menu: hover over a session and click Review session (HTML report). Copy prompt to optimize this session copies the same findings to the clipboard as a prompt.
For each main-thread request above the threshold T, take the share of its read and write cost that comes from tokens beyond T:
big_save += (read + write) × (ctx − T) / ctx
Example: ctx 300k, T 150k, read + write $0.10 → $0.10 × 150/300 = $0.05 saved on that request.
The report shows this as a "high" finding when it's more than 15% of the session's total cost, and "med" otherwise.
This fires when the session's peak context went above 2T (300k) and the session never ran /compact.
Severity is low because this is normal on a native-1M window, where auto-compact only fires near 967k. It only matters on a 200k window.
The report uses the threshold of the model that made up most of the session's cost. Today every model uses the same value, ctx_big_tokens.
| Finding | Trigger |
|---|---|
| Cold restarts | Any. See Cold-cache detection |
| Largest context passenger | One tool result whose carrying cost is > 2% of the session |
| Repeated reads | The same file read ≥ 3 times |
| Subagent share | Subagents > 25% of the session's cost |
Back to Home