Repository navigation
opencode-token-metrics v0.3.0
One package for OpenCode V1 and V2.
V2
- The same package loads in the OpenCode 2 TUI and renders in the prompt footer.
- Add
"opencode-token-metrics"topluginsinopencode.json. Options go in~/.config/opencode/cli.json. - A tool loop keeps one graph across steps, then freezes on the execution's summed tokens.
- Compaction is its own generation and does not leak the previous turn's totals.
V1
Install is unchanged:
opencode plugin opencode-token-metrics -gThe server entry now loads as an empty hook, so that installer does not error on startup.
Metrics
- Prompt-cache hit rate on the frozen line (
cache 87%). It is omitted when the provider reports no prompt tokens.showCachedefaults totrue.
Verification
- 118 tests, typecheck, and the packed-package smoke test.
- CI passed on Node 20 and 22.