You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zoo Code shows total token usage in the chat header, but doesn't break down where those tokens go. Users trying to optimize MCP usage have no signal for how much their tool definitions are costing. Once dynamic loading lands, this panel is also how users verify it's working ("attached 30 of 200 tools — saved 8k tokens").
Compute per-section token counts at API request build time in `src/core/task/Task.ts`: base system prompt, MCP tool array, conversation history, and any other major sections.
Use the same tokenizer already used to compute the total context count — no new dependency.
Emit the breakdown to the webview via a new scoped message (e.g. `contextUsageBreakdown`).
Add `ContextUsagePanel.tsx` to `webview-ui/src/components/chat/`: collapsed by default in the chat header; expands to show per-section rows.
Acceptance Criteria
Per-section breakdown computed at request build time
New webview component renders breakdown, collapsed by default
Total matches existing top-level token count (no double-counting)
Unit test: panel reflects accurate counts for each section
Activity
[-][Story] W0.4 — Detailed context-usage panel showing per-section token cost[/-][+][Story] Detailed context-usage panel showing per-section token cost[/+]