Repository navigation
Description
Feature Request
Is your feature request related to a problem? Please describe.
Claude Code supports a custom statusline via a statusLine.command setting in settings.json that pipes JSON session data (model, cost, context window usage, git info, transcript path) to a user-supplied shell script. This lets users render a rich two-line status bar showing:
- Model name
- Repo + branch + git status (ahead/behind, dirty flag)
- Lines added/removed
- Context window usage as a visual brick bar + percentage
- Session duration
- Session cost (computed from token usage at model-specific rates)
I recently migrated from Claude Code to OpenCode and this is the one feature I miss. OpenCode's built-in status bar shows the model name and token count, but it is not customizable — I cannot add git status, context bricks, cost, or duration.
Describe the solution you'd like
Add a statusline key to tui.json (or opencode.json) that accepts a command, similar to Claude Code's approach:
// tui.json
{
"$schema": "https://opencode.ai/tui.json",
"statusline": {
"command": "~/.config/opencode/statusline.sh",
"padding": 0
}
}The command would receive session data as JSON on stdin (model, token usage, cost, git info, working directory, session duration) and its stdout would be rendered as the status line at the bottom of the TUI.
Describe alternatives you've considered
-
Plugin events — The plugin system has
tui.toast.showandtui.prompt.appendbut notui.statusline.renderhook. A plugin event for statusline rendering could work, but a command-based approach (like Claude Code) is simpler for users who just want to port an existing shell script. -
Built-in enrichment — Expanding the built-in status bar to show git status and cost would help, but wouldn't allow user customization (e.g., custom colors, model-specific pricing overrides, context bricks).
Additional context
For reference, Claude Code's statusline spec: the command receives JSON on stdin with fields like model.display_name, model.id, cost.total_cost_usd, cost.total_duration_ms, context_window.context_window_size, context_window.current_usage.*, workspace.current_dir, and transcript_path. The script writes ANSI-colored text to stdout.
This is especially useful for users on custom model gateways (e.g., HelloFresh's AI Model Router) where the gateway sends zeroed cost/usage fields for non-Anthropic models — a custom script can fall back to reading the transcript JSONL to compute real token counts and cost at published rates.
Happy to help test or provide my existing 250-line statusline script as a reference implementation.
Activity
github-actions commentedon Sep 2, 2026
This issue might be a duplicate of existing issues. Please check:
tui.footer.itemsplugin hook for persistent status display in the footer