From 48347a01c9a90716dff4e6155bd5b5faeb6ff866 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 10 Jun 2026 21:44:14 +0200 Subject: [PATCH] docs(web-ui): document the first-turn ctx stats chip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-agent stats page gained a "first-turn ctx" summary chip (the input tokens of the most recent fresh session's first turn — a system-prompt/CLAUDE.md sprawl proxy), but agent.md's chip-row description didn't mention it. Add it next to the reminder chips, noting the stats.rs derive and the inert-until-capture behaviour (omitted from JSON until the sessions / turn_stats.session_id capture has rows). --- docs/web-ui/agent.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/web-ui/agent.md b/docs/web-ui/agent.md index 3d93cfef..1b521206 100644 --- a/docs/web-ui/agent.md +++ b/docs/web-ui/agent.md @@ -393,7 +393,15 @@ hit-rate** (`cache_read` over all input-side tokens) and **tokens/turn**. When `reminder_stats` is present (fetched via `ReminderRollup` RPC and merged into the snapshot in `web_ui.rs::api_stats`) three more chips appear: **reminders -scheduled / delivered / pending** for the window. +scheduled / delivered / pending** for the window. When the +per-session capture has data, a **first-turn ctx** chip shows the +input tokens of the most recent fresh claude session's first turn — +a proxy for system-prompt + CLAUDE.md sprawl (a fresh session's first +turn pays the full static prefix uncached). It's derived in `stats.rs` +(`first_turn_ctx`: the first turn, `ORDER BY started_at LIMIT 1`, of +the latest `sessions` row in the window) and is omitted from the JSON +until the `sessions` / `turn_stats.session_id` capture has rows — so +the chip stays hidden on older dbs (inert-until-capture). `stats.rs` opens the sqlite db read-only and degrades to an empty snapshot on any error — the page is decorative, never authoritative.