Repository navigation
Releases
The transform fix
Silent breakage from the package install path
0.3.1 regressed for every package install (npm or git): the panel was stuck on
"no captured requests yet" permanently, and the prompt-footer context gauge
never rendered on fresh sessions. Capture and the server side were healthy
throughout; only the TUI was broken (reported 2026-11-23 from the Studio and
the iMac).
OpenCode applies the solid reactivity transform at load time, but its source
filter skips everything under node_modules — and an installed package lives in
one, inside the npm cache. Our uncompiled src/tui.tsx fell through to bun's
default JSX compilation, which passes props as values; solid's Show/For treat a
non-function when as a static value, sampled once at creation and never
tracked. The panel's gate is created before the records RPC resolves, so it
latches on "empty" and never updates. (The footer gauge rendered only when its
creation happened to sample true. Pre-0.3.1 verification ran from paths the
transform does cover, which is why this shipped.)
- Ships a pre-compiled dist/ — built with the exact transform function the host
calls (universal output: getter props, no JSX left in the file) — with the
package exports pointed at it. - Adds a TransformCanary load-time tripwire: if the transform is ever missing,
the plugin logs a console error and shows a visible warning in the panel and
footer, so this failure class can never be silent again.
Upgrading from 0.3.1:
opencode plugin update opencode-what-context
plugin update re-resolves latest from the registry, so this is normally
all that is needed — restart OpenCode afterwards to load the new build. One
caveat: for a few minutes after a publish, npm is still processing it (the
202 being processed window), and an update run inside that window resolves
the old version and reports "No plugin updates available" — wait a couple of
minutes and re-run. If you would rather not wait, clear the install cache and
restart:
rm -rf ~/.cache/opencode/npm/opencode-what-context@latest
The narrow-panel fit
The narrow-panel dots are fixed, and the round of polish that shipped with them.
What changed
- No more
...artifacts in a narrow panel. The dot-leader rows, the usage
grid, and the request gauge no longer overflow the box. The leader flexes down
to one dot, then the name elides with a single-cell ellipsis — the figures and
percentages always stay whole at any panel width. - Context model extracted to
src/context.ts; the panel header shows the
plugin name and version. - Tools and scaffolding are legend leaves — only system and messages expand
into breakdown trees, and the sub-rows drop their part counts. - The whole panel scrolls when the view is too short for the three boxes.
- README gains a Reading the panel section, and the dev tooling (design mock,
five-state preview, layout and render probes) lands in the repo.
v0.3.0
The panel gets its btop treatment, and the repository gains a demo reel.
- Panel: btop-style boxes with tree breakdowns, content-sized context detail, and section titles carried in the border's title area (with the headline figure) — the fix for titles overflowing the native title area is in here.
- Examples: a vhs demo reel of the panel in a live session against the local model — two prompts,
/what-context, the walk, and the prompt-footer indicator. Re-render withexamples/run_vhs.sh.
OpenCode 2.x and later.
The clone-and-run fix
The clone-and-run fix
The local development loader (.opencode/plugins/opencode-what-context/) was tracked in the
public repo, so anyone who cloned the repo and started OpenCode inside the checkout hit a
TUI plugin failure: the loader re-exports src/tui.tsx, which imports @opencode/client, and
a fresh clone — or a checkout whose node_modules predates v0.2.0 — has no such package
(reported 2026-11-20 from the iMac).
- The loader is no longer tracked; .opencode/ is gitignored in full.
- scripts/dev-link.sh (re)creates it from the tracked template in dev/plugins/; the README
gains a Development section. - The npm package code is unchanged; 0.2.2 ships the Development documentation and keeps
latest in lockstep with the tag.
An existing clone is healed by git pull alone — git removes the now-untracked loader, so
the failure goes away without any further step. Run scripts/dev-link.sh and npm install
only when developing the plugin locally.
Panel: the btop-style layout
Panel: the btop-style layout
- The panel is now a single stacked column of three sections behind one-line
dividers: the selected request's composition on top, the trend in the
middle, the request list at the bottom (the list+detail split is gone). - The dividers take btop's heading treatment: a bold embedded label, and —
where a section has a headline figure — the figure right-aligned at the
rule's end: the context window on the trend divider (the curve's scale
label), the captured-call count on the requests divider. - The composition bar ends in the prompt total, and the former totals row is
the response row (completion + cache), so no figure appears twice. - The trend strip and its marker row run the divider's full width; a
truncation figure appears only when the strip cannot show every request. - The request list has a column-header row built from the same width
constants as its rows, so the columns cannot drift. - Display only: the capture, the estimator, and the footer indicator are
unchanged.
Verified live in the TUI: the dividers, the bar values, and the aligned list
columns render on a real session without distorting the outgoing call.
v0.2.0: Build step 4: the Claude-Code-style display
- Prompt-footer context-window indicator: a 10-cell glyph-density gauge of the
model's registered context window plus the free space (or overrun), on the
prompt bar of every session. It reads the client's synced session state
(last completed assistant step, after the last compaction, before the revert
boundary) reactively — no captured records, no RPC. It yields on the home
route, in shell mode, and while the host hides details, and it shows the
complementary free-space figure so it doesn't duplicate the host's own token
numbers. - Per-tool rows in the panel detail: the tools slice breaks down into its
individual schemas (up to 5 rows, tokens apportioned by rendered bytes) —
same shape as the existing per-source and per-part blocks. - Free-space row in the panel detail: the context window minus the request's
prompt, in the gauge colours, error-styled when the request overran it. - The slash command is now /what-context (no /context alias — the name change
deliberately dodges the community opencode-context-usage plugin). - Install is from the npm registry: opencode plugin add opencode-what-context
Verified live in the TUI: the indicator and the new panel blocks render on a
real session without distorting the outgoing call.
v0.1.0
v0.1.0 — the capture and the TUI panel are complete.
Every model call OpenCode makes is recorded: the assembled context (system
instructions by source, tool schemas, conversation) where the hooks expose
it, plus the wire body size and the provider's reported usage on every call.
In the TUI the records render as a panel — a context-window gauge, a request
history, a per-request composition bar, and a token trend.
Per-part token counts are estimated by apportioning the provider-reported
prompt total over rendered bytes; the provider's reported totals remain the
ground truth the gauge and trend are built on.
Install:
opencode plugin add github:ali5ter/opencode-what-contextThe package installs from the Git repository on first start, so restart
OpenCode afterwards.
Tag history. The v0.1.0 tag was force-moved twice after its initial
placement, so the release ships as main now stands:
- 2026-11-14 — onto the install-closure fix: the TUI part's runtime
dependencies (solid-js,@opentui/core) were devDependencies, and a
package installed from git or npm receives onlydependenciesin its
closure, so an installed panel could not resolve them. - 2026-11-15 — onto the panel-location fix: the panel's RPC call carried the
TUI's own directory, which on macOS can be the symlinked logical form
(/var/folders/...) that the service never registered, so the call 400ed
rpc.unavailableand the panel sat empty. The call now prefers the
session's stored location and canonicalises either way.