OpenCode TUI plugin: /brief opens an executive summary of the current session in a dialog.
Uses the same window as the built-in /btw: one model call that reads the session context and
returns transient text, rendered in a dismissable dialog — so the brief never lands in the
transcript. The same call also proposes a title for the session, which you can apply to the
session with one key.
opencode plugin add opencode-brief
That installs the package and registers it in the global configuration. Restart the TUI. Rollback is
opencode plugin remove opencode-brief.
A local checkout works the same way: point the package field in
~/.config/opencode/cli.json at the directory instead of the registry name.
/brief # brief of the current session
/brief deploy # same brief, focused on one aspect
ccopies the brief,tapplies the proposed session title,j/k, arrows, page keys and home/end scroll,esccloses.- While the brief is being generated,
/briefshows up in the prompt footer — the same indicator/btwuses. - Instructions come from
~/.config/opencode/skills/brief/SKILL.mdwhen that file exists, read at call time, so editing the skill changes both this panel and any/briefchat command. A built-in English fallback is used when it is missing.
The same generation also proposes a title for the session, because both answers come from the same
read of the conversation — a second request would cost a second pass over the same context. The
naming rules are the ones OpenCode uses for session_rename, so a title proposed here reads like one
generated by the host: three to five words, the specific subject, sentence case, same language as the
session.
The title is only a proposal: it shows in the dialog header and is written to the session only when
you press t (through client.session.update). Nothing is renamed by opening the dialog, and if the
model does not honor the TITLE: … / --- output contract the brief still renders and the title
action is not offered.
session.generate takes only { sessionID, prompt }: there is no per-call thinking switch, so by
default the brief inherits the session's model and variant. The plugin lowers the effort from the
server-side setup of the same entrypoint (the host loads it without a renderer and with the server
context) using session.hook("generate") — the hook the host provides for auxiliary requests
(SessionRequestKind has a separate generate kind). It writes reasoningEffort /
reasoning_effort into the request options and only touches requests carrying the
<!-- opencode-brief --> marker, so normal turns and other plugins' transient generations are
untouched.
{
"plugins": [
{
"package": "opencode-brief",
"options": { "thinking": "low" }
}
]
}lowis the default;inheritskips the hook entirely.none/minimalare only valid if the model exposes them. Some models only havelow,highandmax; models built on gpt-oss do havenone/minimal.- The hook is registered when the server loads the plugin for a location, so a long-running
background service keeps the previous load until it restarts.
reasoning.initin~/.local/share/opencode-brief/brief.logtells you the current process has it;generate.hookconfirms it was applied to a brief. The host also logssession generation usage diagnosticwithreasoningTokensfor the same request.
The dialog is opened the way the host opens /btw, not with plugin-specific plumbing:
ui.dialog.show(render, onClose)first,ui.dialog.set({ size: "large", centered: true })second. Order matters:showreplaces the dialog stack and resets size tomediumand centering tofalse, so asetbeforeshowis silently discarded.- The key layer is registered by the panel component itself with
mode: "modal", so it lives exactly as long as the dialog: the host pushesmodalwhile any dialog is open and pops it on close. No custom mode push, andesc/ctrl+cclose come from the host layer (which also clears a text selection before closing). - Body: markdown on
background.raised.highwithinternalBlockMode="top-level"andtableOptions: grid, inside ascrollboxcapped at 60% of the terminal height. The syntax style is built from the theme'smarkdownandsyntaxtokens with the same scope table the host generates for/btw, so headings, strong/emphasis, links and inline code are styled instead of flat text. - Chrome:
theme.surface("dialog")colors, lateral inset 3, header with the title and the focus.
Two host internals /btw uses are not exported to plugins, so the panel rebuilds them with
@opentui primitives: the Dialog/DialogHeader/DialogFooter components (header + footer rows
are plain boxes here) and the clipboard hook (c falls back to OSC52, so a terminal without OSC52
support reports the failure in a toast instead of copying).
By default the brief is generated by the session's own model, through client.session.generate — it
sees the conversation natively, cannot call tools, and does not mutate history.
That endpoint returns an empty string on some sessions (observed on long or busy ones), so the
plugin falls back to the stateless client.generate.text with the serialized transcript (read from
the server, tail-capped at 40k characters) and the session's current model. Every attempt is logged
to ~/.local/share/opencode-brief/brief.log with lengths only, never content; override the path
with OPENCODE_BRIEF_LOG.
To pin a different model, set model in the plugin options (provider/model or
provider/model#variant). That skips the session path and always uses the stateless one, which
costs more input tokens and loses anything that never made it into the transcript:
{
"plugins": [
{
"package": "opencode-brief",
"options": { "model": "anthropic/claude-sonnet-4-5" }
}
]
}A slash command submits its expanded template as a user prompt, so a 50-line command fills the transcript. This plugin keeps the instruction out of the conversation and renders the result in a dismissable panel instead.
npm install npm run typecheck # tsc --noEmit npm test # bun test (reasoning hook: scoping and effort parsing)
MIT — see LICENSE.