Skip to content

Statusline

Statusline puts a line of live session state under your conversation, or a column of it in the sidebar. Bay 02, new in 0.3.0.

The statusline under an OpenCode conversation: a context bar at 40%, the token total with its cache, input and output parts, the session diff, elapsed time and todo progress

That is the default line — what you get having written no configuration at all.

What it shows by default, and why it’s so little

Section titled “What it shows by default, and why it’s so little”

OpenCode’s own furniture already carries a lot. Its footer has the path, the branch and the token count. Its sidebar has the context percentage and the spend. Its prompt has the agent and the model.

A statusline that repeats those buys a second copy of something already on screen. Configured carelessly, the context percentage can end up drawn five times in one window. So the default line is what the host leaves out:

SegmentSays
session.statusworking, or retry 2 in 5s — OpenCode shows a spinner, not why it stalled
git.diff+150 / -30 for this session
todo3/7 todo, and nothing once the list is finished
session.time12m04s
diagnosticsonly when an LSP or MCP server is unhealthy

Everything the host shows is still available as a segment — the default just doesn’t assume you want it twice.

A segment with nothing to say says nothing.

  • cost hides itself where nobody declared prices, rather than reporting $0.00
  • context hides itself where nobody declared a window, rather than inventing a denominator
  • diagnostics is silent while every service is healthy
  • todo goes quiet once the list is done, instead of reporting 5/5 for the rest of the session

This matters most behind a proxy, where the model catalogue knows neither prices nor a context window. A confident $0.00 reads as “this was free”; an absent segment reads as what it is. See Proxies.

surfaceWhereGood for
bottomfull-width line under the conversationeverything, when no sidebar is open
sidebarthe sidebar, stacked vertically by defaulttrends and composition — the time dimension

There were three. The third sat inside the prompt box, which is both the narrowest place in the window and the one OpenCode already fills with the agent, the model and the elapsed time — so a line there had no room and nothing left to say. Two surfaces, each with a job, beat three that overlap.

Every segment carries a priority. A line too wide for its surface drops the lowest-priority segments until it fits, so how full the context is survives a 60-column window and the version string does not. A hard right-cut would have kept whichever segments happened to sit on the left.

A vertical line drops by maxRows instead, and each row is cut to the column’s width.

Use the first that fits.

  1. Declarative segments in config.json or .cockpit.json. No code, no subprocess.
  2. Your own TypeScript, for a segment that has to read the session and decide — or remember what it saw a minute ago.
  3. A shell command, fed the same JSON Claude Code’s statusLine hook sends, so a script you already wrote works unchanged.
Terminal window
opencode plugin @opencode-cockpit/status --global

Or get it with every other bay through the opencode-cockpit bundle.