Skip to content

Persistent Token/Context Usage Indicator #2052

@orenMicrosoft

Description

@orenMicrosoft

Describe the feature or problem you'd like to solve

It would be very helpful to have an always-visible token usage indicator in the CLI interface — similar to a status bar — showing the current context window utilization (e.g., "45% context used" or "52k/128k tokens"). Currently, checking token usage requires running /context or /usage manually, which breaks the flow. A persistent indicator would help users proactively manage their context, know when to /compact, and avoid hitting the limit unexpectedly

Proposed solution

Add a lightweight, always-visible status bar at the bottom of the CLI (similar to how vim or tmux display status).
It could show a compact token usage indicator like:

[Context: ████░░░░ 52k/128k (41%)]

  • Updates after each prompt/response cycle
  • Changes color as usage increases (green → yellow → red)
  • Can be toggled on/off via a config option (e.g., "showContextBar": true in config.json) or a slash command like
    /context-bar
  • Minimal: doesn't interfere with the conversation area

Example prompts or workflows

Long refactoring session — User is deep into a multi-file refactor. The context bar shows [Context: 78%] in
yellow, prompting them to run /compact before continuing, rather than getting surprised by auto-compaction mid-task.
2. Debugging with large files — User references several large files with @. The bar immediately jumps to [Context:
65%], helping them decide whether to include additional files or keep context lean.
3. Multi-session planning — User sees they're at 90% in one session, so they open a new terminal with copilot for a
separate task instead of overloading the current session.
4. Teaching/onboarding — New users can visually understand how their prompts and file references consume context,
building better habits from the start.

Additional context

  • Other AI-powered tools like Cursor and Windsurf already show token/context usage persistently, setting a user
    expectation for this kind of visibility.
    • The CLI already tracks this data internally (as seen via /context and /usage), so the information is available —
      it just needs a persistent display layer.
    • Auto-compaction at 95% is helpful but can feel abrupt. A visible indicator gives users agency to manage context
      proactively rather than reactively.
    • This would pair well with the existing Ctrl+T toggle pattern — a Ctrl+U or similar shortcut could toggle the bar
      on/off without needing a slash command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions