opencode-turn-stats
v1.0.0
Published
Current-turn processed-token count for the OpenCode sidebar
Maintainers
Readme
OpenCode Turn Stats
OpenCode Turn Stats adds one line to the OpenCode sidebar:
This turn 13k processedIt counts uncached work reported for the current user turn. The count includes input, cache writes, visible output, and reasoning across tool-call continuations. It excludes cache reads.
The plugin uses only synchronised OpenCode host state. It makes no provider requests, reads no transcript files, starts no subprocesses, and stores no usage history. If the host records cannot support the number, the row is omitted instead of estimated.
OpenCode exposes synchronised, bounded snapshots without a completeness marker. The plugin omits the row when a missing or inconsistent record is detectable. A pathological snapshot that loses an earlier step while retaining a matching latest step is indistinguishable from complete host state.
OpenCode 1.18.30 or later is required.
Install
After the package is published, run:
opencode plugin opencode-turn-stats --globalRestart OpenCode, then show the sidebar. The row appears below built-in Context and above MCP. OpenCode does not currently expose an insertion point inside the built-in Context component.
For an unpublished checkout:
bun install --frozen-lockfile
bun run buildAdd the built entry to the plugin array in ~/.config/opencode/tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["file:///absolute/path/to/opencode-turn-stats/dist/tui.js"]
}On Windows, use a URL such as
file:///C:/projects/opencode-turn-stats/dist/tui.js.
Development
Run all checks:
bun run verifyCreate and check the release archive without publishing it:
bun pm pack
bun run package:check --packedLicence
MIT - see LICENSE.
