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
{{ message }}
Repository navigation
feat(tui): persistent token usage display in session footer #18968
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.
Closing as duplicate of #17449 (real-time token display in footer) and #13003 (token usage in TUI). I'll comment on those with an implementation offer.
Activity
github-actions commentedon Mar 24, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]: persistent token usage display in session footer)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
andrewdunndev commentedon Mar 24, 2026
Closing as duplicate of #17449 (real-time token display in footer) and #13003 (token usage in TUI). I'll comment on those with an implementation offer.