Context
Roo shows total token usage at the top of the chat, but doesn't break down where those tokens go. Users trying to optimize MCP usage have no way to see "MCP tools cost N tokens this turn." Once dynamic loading lands, this panel is also how users will verify it's working ("attached 30 of 200 tools — saved 8k tokens").
Closes: RooCodeInc#10238.
Developer Notes
- Compute per-section token costs at API request time: base prompt, system prompt sections, MCP tool array, conversation history.
- Surface as an expandable panel in the chat header (or settings drawer) — collapsed by default.
- Numbers come from the same tokenizer used to compute the total context.
- Files:
src/core/task/Task.ts (capture per-section sizes during request build), webview-ui/src/components/chat/ (new ContextUsagePanel.tsx), webview message channel for the breakdown.
- Validation: panel reflects accurate counts for each section; total matches existing top-level token count.
Context
Roo shows total token usage at the top of the chat, but doesn't break down where those tokens go. Users trying to optimize MCP usage have no way to see "MCP tools cost N tokens this turn." Once dynamic loading lands, this panel is also how users will verify it's working ("attached 30 of 200 tools — saved 8k tokens").
Closes: RooCodeInc#10238.
Developer Notes
src/core/task/Task.ts(capture per-section sizes during request build),webview-ui/src/components/chat/(newContextUsagePanel.tsx), webview message channel for the breakdown.