Skip to content

[FEATURE]: /context — detailed token/cost breakdown panel per session component #41908

Closed as not planned

Description

@afonsoft

Requested feature

Add a /context slash command (inspired by Claude Code's /context) exposing a detailed breakdown of how the context window is being used: prompt, tools, and message history split by token counts, plus estimated cost.

Why

Today the sidebar (packages/tui/src/feature-plugins/sidebar/context.tsx) only shows the aggregate token count and cost for the latest assistant message (last.tokens.input + output + reasoning + cache.read + cache.write, plus money.format(cost())). There is no per-component visibility, so users can't tell whether prompt/system instructions, tools, or history is consuming the window.

Proposed behavior

  • /context opens a dialog/sidebar breakdown: system prompt, tool definitions, session messages, and cached tokens each as a separate row with token counts and percentages of the model's context limit.
  • Optionally surface estimated cost per component.
  • Reuse the model context-limit metadata already read in context.tsx.

Benefits

  • Diagnose context overflow before /compact is needed.
  • Clear view of cost drivers per conversation.

Activity

  1. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

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

  2. github-actions commented on Oct 11, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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