Skip to content
    ↑↓ select↵ openesc close
    English中文
    aundal

    Token Monsters

    v0.1.5Observability
    @aundal/opencode-token-monsters

    OpenCode plugin that shows Token Monsters token usage breakdowns in the TUI sidebar.

    GitHub stars

    0

    Monthly installs

    52

    14 in 7 days

    Composite scoreSCORE

    30.6

    Multi-signal model

    Last commit

    5 days ago

    2026-08-14

    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": ["@aundal/opencode-token-monsters@0.1.5"]
    }

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

    Token Monsters adds a token usage sidebar to OpenCode. It shows the current context size, cache hit percentage, session totals, current prompt totals, prompt/tool/file breakdowns, and tool-definition overhead.

    All numbers are approximate and counted with gpt-tokenizer using the OpenAI o200k tokenizer. For Claude, Copilot, and other non-OpenAI models, treat the numbers as a ballpark.

    Token Monsters sidebar screenshot

    Install

    Add the plugin to both OpenCode config files.

    ~/.config/opencode/opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": [
        "@aundal/opencode-token-monsters@latest"
      ]
    }
    

    Restart OpenCode after saving. OpenCode installs npm plugins automatically at startup.

    ~/.config/opencode/tui.json

    {
      "$schema": "https://opencode.ai/tui.json",
      "plugin": [
        "@aundal/opencode-token-monsters@latest"
      ]
    }
    

    Install with OpenCode

    Paste this prompt into OpenCode:

    Install the OpenCode plugin @aundal/opencode-token-monsters@latest into my global opencode.json and tui.json plugin arrays. Preserve my existing config, validate config shapes against https://opencode.ai/config.json and https://opencode.ai/tui.json, and tell me to restart OpenCode when done.
    

    Usage

    Token Monsters appears in the session sidebar.

    Use /tokenmonster to fold or unfold the sidebar panel.

    You can also click the Token Monsters header to fold or unfold it with the mouse.

    Views

    • Session: Total shows everything captured since the session started.
    • Session: Aktuel shows the last request only.
    • View: Prompts groups usage per prompt turn.
    • View: Tools aggregates tool and file usage.

    Package

    The package exports one OpenCode plugin module with both server and TUI hooks. The server hook writes token capture data, and the TUI hook renders the sidebar.

    End users only install the npm package in opencode.json and tui.json. No build step is needed for end users. The published package ships the compiled files.

    Development

    bun install
    bun run build
    npm pack
    

    Publish

    bun run build
    npm pack
    npm publish --access public
    

    License

    MIT