Skip to content

Tokenscope

Tokenscope provides token usage, cache, context, and cost analysis for OpenCode sessions, built on the telemetry OpenCode already persists.

Key features

FeatureDescription
Session reportsTurns persisted OpenCode telemetry into a readable report
Honest numbersRecorded usage kept separate from local tokenization and explanatory estimates
Cost trackingCost analysis alongside token, cache, and context views

Installation

  1. Install globally:
npm install -g @ramtinj95/opencode-tokenscope
  1. Add the plugin to opencode.json (project root or ~/.config/opencode/opencode.json):
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@ramtinj95/opencode-tokenscope"]
}
  1. Create the /tokenscope command at ~/.config/opencode/command/tokenscope.md — see the repository README for the command file content.