Skip to content

Add /context command to display session token usage #10575

@bpeers01

Description

@bpeers01

Problem
OpenCode already tracks per-request token usage, but there’s no quick way to view it in the TUI. This makes it hard to check context headroom without leaving the session.

Proposal
Add a session-level /context command that opens a dialog showing last-request token usage, context limit, usable input budget, and cache hit ratio.

Scope
TUI only. No new tracking data; just a UI for existing usage fields.

Why this matters
Improves visibility into prompt headroom and cache usage while staying in the session flow.

Verification
I will include a short repro in the PR and before/after screenshots for the dialog.

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions