Skip to content

[FEATURE]: Real-time token display in TUI footer/header #17449

Closed

Description

@FurryWolfX

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

Currently, OpenCode only displays token statistics after a request completes (in the header's ContextInfo component). During streaming:

  1. No real-time token count is shown
  2. No progress indicator is displayed
  3. Users have no way to know if the system is processing or stuck

This is particularly problematic for:

  • Long reasoning tasks (especially with thinking models)
  • Large context windows
  • Slow network connections

Request

Add real-time token display in the TUI footer or header that updates during streaming, similar to Claude Code's behavior. This would show:

  1. Estimated token count - Based on character count during streaming
  2. Visual activity indicator - Show that the system is actively processing
  3. Output rate - Tokens per second (optional, but helpful)

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 14, 2026
  2. github-actions commented on Mar 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review these issues and consider adding a comment or reaction there instead of opening a new one.

  3. andrewdunndev commented on Mar 24, 2026

    @andrewdunndev

    I'd like to take this on if there's interest. I filed #18968 (now closed as duplicate) with a concrete approach:

    Add token stats to the existing footer component in packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx. Three data points:

    • tok/s -- live output tokens-per-second during streaming, final rate shown briefly after completion
    • in -- cumulative input tokens for the session (compact K/M suffix)
    • out -- cumulative output tokens for the session

    The data is already in the message store (message.data.tokens has input/output/reasoning/cache breakdowns). The footer subscribes to message events and accumulates totals.

    I also filed #18969 proposing a tui.footer.items plugin hook so token-tracker plugins could use the footer instead of toasts. That one got the core label so it may be worth considering as the extensible approach.

    Happy to submit a PR for either the built-in footer display or the plugin hook, whichever the team prefers.

  4. added a commit that references this issue on Mar 25, 2026
    7cb34ff
  5. Tarquinen commented on Apr 4, 2026

    @Tarquinen
    Contributor

    This can be done via plugin now, for example:

    https://github.com/Tarquinen/oc-tps

  6. assigned and unassigned on Apr 26, 2026
  7. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  8. FurryWolfX commented on May 22, 2026

    @FurryWolfX
    Author

    This can be done via plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions