Skip to content

[FEATURE]: Show the model's context window limit in the TUI (footer and sidebar) #42929

Open

Description

@Haltarys

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

The TUI usage counter shows the current session's token usage with a percentage, e.g. 30.0K (15%), but there is no visible reference for what that percentage is relative to — the model's context window limit is not shown anywhere in the TUI.

Without the limit, it's hard to judge how much room is left in the context window, which matters in long sessions where compaction kicks in near the limit.

Requested: show the model's context window limit alongside the token count in both places the usage counter appears:

  • Input bar / prompt counter: 30.0K / 200K (15%) instead of 30.0K (15%).
  • Sidebar context panel: 30,000 / 200,000 tokens instead of 30,000 tokens.

The limit comes from the active model's limit.context (models.dev / provider config). Models without a known limit should keep the current behavior (token count + percentage only).

Related: builds on #13003 (display token usage in the TUI — its status-bar option already sketches Tokens: 19.9K/1M). #33745 asked for the utilization percentage, which the TUI now already shows; this request is specifically about the absolute context window limit.

Activity

  1. github-actions commented on Aug 16, 2026

    @github-actions
    Contributor

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

    If your request is meaningfully distinct from these (e.g., specifically the absolute limit value shown inline in the prompt bar and sidebar counter), feel free to clarify how it differs.

  2. changed the title [-][FEATURE]: Show the model's context window limit in the TUI usage counter[/-] [+][FEATURE]: Show the model's context window limit in the TUI (footer and sidebar)[/+] on Aug 16, 2026
  3. VladSmr commented on Oct 2, 2026

    @VladSmr

    This adds exactly what's requested — an OpenTUI sidebar showing the model's
    context window, current usage, and a per-category breakdown, live per session.

    I've built it as a plugin — opencode-context-indicator. Still in a testing
    stage; with your help and feedback we can make it better together.

    • real-time sidebar: model · ctx/limit (%) · user / assistant / reasoning /
      tool args / system / tool schemas / residual
    • /context — instant 3-line summary; /context-breakdown — full table for the
      session and all subagent sessions
    • dual V1 + V2, tested against opencode 2.0.21+; everything stays local
      (estimates, no uploads, no extra LLM calls)

    https://github.com/VladSmr/opencode-context-indicator
    npm: opencode-context-indicator

  4. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the suggestion, @Haltarys! You're asking for the TUI to show the active model's context window limit next to the token count: 30.0K / 200K (15%) in the prompt footer and 30,000 / 200,000 tokens in the sidebar context panel. Models without a known limit would keep the current format.

    The percentage is already calculated from the model's limit.context, but the limit itself isn't shown anywhere. Maintainers will consider this.

    Related issues:

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