Skip to content

v0.5.0: remove duration_ms and files tracking - #1

Merged
fjgbue merged 2 commits into
mainfrom
v0.5-cleanup
May 26, 2026
Merged

v0.5.0: remove duration_ms and files tracking#1
fjgbue merged 2 commits into
mainfrom
v0.5-cleanup

Conversation

@fjgbue

@fjgbue fjgbue commented May 26, 2026

Copy link
Copy Markdown
Owner

What's in v0.5.0

Bug fixes / cleanup

  • Remove duration_ms — was always null for hook-recorded sessions (the majority). Removed from run.json, both recorders, sessions table column, and detail panel.
  • Remove files trackingfile.read events and files.reads[] array were stored in run.json but never surfaced in the dashboard and were unreliable.

Analytics & visualizations (all use Recharts, already a dependency)

Per-turn token breakdown

  • New Turns tab in session detail showing a stacked bar chart: input (blue) / cache write (amber) / output (green) per turn
  • transcript.mjs now extracts per-turn usage into a turns[] array stored in run.json
  • Cache reads shown as a note (not stacked — they repeat context and aren't billed as new tokens)
  • Requires sessions recorded after this update; old sessions show a graceful message

Top sessions by cost

  • New Top Sessions by Cost horizontal bar chart in the left column
  • Shows up to 10 sessions ranked by cost, truncated description as label
  • Clicking a bar selects the session in the detail panel

Cache hit rate

  • New Cache Hit Rate line chart (daily, green) showing cache_reads / (cache_reads + fresh_input) over time
  • Dashed reference line at 80% (good baseline)
  • Shown side-by-side with the Cost per Day bar chart
  • New 5th metric card in the strip showing the overall cache hit rate % for the selected period

Context bloat warning

  • Session detail now warns when cache_creation_tokens > output_tokens × 8 — indicates the model loaded a large context but produced little output (expensive pattern)

Layout

MetricsStrip:  Total Cost | Total Tokens | Sessions | Avg Cost | Cache Hit Rate
Charts row:    [Cost per Day ████]  [Cache Hit Rate ———]
               [Top Sessions by Cost ████████████]
               [Sessions table]

Test plan

  • tt dash — confirm 5 metric cards, two charts side-by-side, top cost chart
  • Click a bar in the top cost chart — session should be selected in detail panel
  • Record a new session — confirm run.json has turns[] array
  • Open detail on a session with turns — confirm Turns tab appears with stacked chart
  • Check context bloat warning on a session with high cache_creation / low output

🤖 Generated with Claude Code

fjgbue and others added 2 commits May 26, 2026 19:23
duration_ms was always null for hook-recorded sessions (the majority),
making the column useless. files tracking (Read/Write/Edit tool calls)
was not surfaced in the dashboard and produced unreliable data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TurnChart: per-turn stacked bar (input/cache write/output) shown as a new
  Turns tab in session detail; requires sessions recorded after v0.5
- TopCostChart: horizontal bar ranking top 10 sessions by cost, click to select
- CacheEfficiencyChart: daily line chart of cache hit rate (cache reads / all input)
- MetricsStrip: 5th card showing overall cache hit rate %
- transcript.mjs: extract per-turn usage into a turns[] array stored in run.json
- Context bloat warning in session detail when cache writes >> output tokens

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fjgbue
fjgbue merged commit 43048d5 into main May 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant