Skip to content
    ↑↓ select↵ openesc close
    sm18lr88

    Turn Stats

    opencode-turn-stats·v1.0.0·Observability

    Current-turn processed-token count for the OpenCode sidebar

    GitHub stars

    0

    Monthly installs

    175

    6 in 7 days

    Composite score

    33.0

    Multi-signal model

    Last commit

    21 days ago

    2026-09-13

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-turn-stats@1.0.0"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    OpenCode sidebar showing current-turn processed tokens

    OpenCode Turn Stats adds one line to the OpenCode sidebar:

    This turn 13k processed
    

    It 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

    Install the published package:

    opencode plugin opencode-turn-stats --global
    

    Restart OpenCode. 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 build
    

    Add 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 verify
    

    Create and check the release archive without publishing it:

    bun pm pack
    bun run package:check --packed
    

    Licence

    MIT - see LICENSE.

    Similar plugins