v1.3.173
ggcode v1.3.173
Highlights
- New
ggcode reportsubcommand: Interactive HTML analytics dashboard for session data — overview, daily details, per-turn breakdowns, and performance metrics with embedded Chart.js (fully offline). - Token usage source tracking: All LLM token consumption (agent, strategist, verify, ratchet, subagent) now categorized by source in session JSONL, making previously invisible usage visible.
- Session analytics dashboard: Date range filters, workspace filters, draggable turn range slider, grouped bar charts with dual Y-axis, and cumulative token tracking.
New Features
ggcode report Subcommand
Standalone session analytics tool that scans ~/.ggcode/sessions/*.jsonl and generates a self-contained HTML report with embedded Chart.js.
- Overview tab: Summary cards, daily token trend, workspace distribution pie chart, tool call summary, and date range filter
- Daily Details tab: Per-model token usage (grouped bars, dual Y-axis) and per-model TTFT/Duration comparison — drill into any day from the overview chart
- Sessions tab: Sortable table with workspace and date range filters, click-through to session detail
- Session Detail tab: Draggable dual-handle turn range slider, per-turn token grouped bars, TTFT comparison line chart, tool statistics
- Performance tab: TTFT histogram (P50/P95/P99), LLM duration distribution, tool success rate, slowest tools top 10
Token Usage Source Tracking
UsageEntrynow has aSourcefield ("agent","strategist","verify","ratchet","subagent") identifying which LLM call consumed the tokens- Strategist, verify, and ratchet LLM calls previously consumed tokens invisibly — now all LLM usage is visible and categorized
MetricEventnow carriesInputTokens/OutputTokens/CacheRead/CacheWriteper LLM call- Turn digest shows cumulative token totals growing with each iteration
Dashboard Improvements
- Date range filter on Overview tab (from/to date pickers, live chart updates)
- Workspace and date range filters on Sessions tab (dropdown + date pickers, instant filtering)
- Draggable turn range slider on Session Detail (dual-handle, mouse + touch support)
- Grouped bar charts with dual Y-axis (Input/Cache on left, Output on right)
- Turn range slider labels show actual timestamps instead of turn indices
Bug Fixes
- Data race on
usageSource:emitUsageWithSourcewroteusageSourceoutside of lock protection — changedRLocktoLocksince the field is being mutated - O(n²) session count in overview date filter: Replaced
find()per turn with O(n) Set lookup — eliminates lag with 11K+ turns - Global tool average duration always 0:
TotalMswas not accumulated globally per tool — now properly computed asTotalMs / Calls - Daily tokens aggregated by session creation date: Multi-day sessions dumped all tokens on creation date — now attributed to each turn's actual usage timestamp
- Back button arrow: Showed literal
\u2190instead of←(Go raw string literals don't process\uescapes) - ggreport meta field parsing: Meta fields are top-level in JSONL records, not nested under a
"meta"key - Session table numeric sort: Was comparing formatted strings (
"4.7B"vs"291.9K") instead of raw numbers
Documentation
- Fixed Jekyll Liquid error from Go code
{{ }}syntax in grpc-plugins guide - Updated desktop framework references from Fyne to Wails
- Regenerated GGCODE.md project memory with current authoritative state
- Added
reportsubcommand to CLI reference and shell completion docs
Upgrade Notes
No breaking changes. All improvements are backward compatible.