I'd like to see token usage in the session footer as a persistent display rather than relying on toast notifications from plugins. The footer already shows directory, LSP count, MCP count, and permissions. Token usage fits naturally here.
What I'm imagining:
~/project 142 tok/s · 4.5M in · 19K out · • 2 LSP · ⊙ 1 MCP
Three data points:
- tok/s -- live tokens-per-second during streaming (fades or shows last value when idle)
- in -- cumulative input tokens for the session (compact: K/M suffix)
- out -- cumulative output tokens for the session
The data is already available in the message store (message.data.tokens has input, output, reasoning, cache breakdowns). The footer component (packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx) would subscribe to message events and accumulate the totals.
For the tok/s calculation: track output tokens and elapsed time during the streaming phase of each assistant turn. Display the rate while streaming, show the final rate for a few seconds after completion, then hide or show "idle".
This is useful for understanding context consumption during long sessions and for comparing model performance across providers.
Happy to submit a PR.
I'd like to see token usage in the session footer as a persistent display rather than relying on toast notifications from plugins. The footer already shows directory, LSP count, MCP count, and permissions. Token usage fits naturally here.
What I'm imagining:
Three data points:
The data is already available in the message store (
message.data.tokenshasinput,output,reasoning,cachebreakdowns). The footer component (packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx) would subscribe to message events and accumulate the totals.For the tok/s calculation: track output tokens and elapsed time during the streaming phase of each assistant turn. Display the rate while streaming, show the final rate for a few seconds after completion, then hide or show "idle".
This is useful for understanding context consumption during long sessions and for comparing model performance across providers.
Happy to submit a PR.