Track opencode token usage and cost in VS Code. Shows rolling-24h and today's usage in the status bar, a hover dashboard with a ring gauge / stats row / per-day chart / per-model breakdown, and one-shot warnings before you hit a configured budget (e.g. a free-tier cap that resets 5–24h after being hit).
Requires the opencode CLI on your PATH (or set opencodeTracker.opencodeBin).
Rolling-window cost budget in USD. 0 disables cost warnings.
opencodeTracker.warnThresholds
[0.7, 0.9]
Fractions of the budget that trigger one-shot warnings.
opencodeTracker.pollIntervalSec
60
Refresh cadence in seconds.
opencodeTracker.windowHours
24
Rolling usage window length in hours.
opencodeTracker.opencodeBin
opencode
opencode CLI executable path override.
Development
npm install
npm run compile # tsc -> out/
npm test # vitest unit tests
npm run watch # incremental compile
Run the extension in the Extension Development Host: press F5 with the workspace open (VS Code launches a second window with the extension loaded).
Manual E2E checklist
[ ] Status bar shows $(flame) OC <n>/24h · <m> today and updates within one poll interval.
[ ] Running an opencode session in the terminal increases the numbers on the next refresh.
[ ] Hovering the status bar shows a dashboard: ring gauge with threshold ticks, stats row (24h / today / cost / sessions), 14-day chart, and model bars; colors adapt to the theme.
[ ] With tokenBudget set slightly above current rolling usage and warnThresholds: [0.7], a warning fires once per day and not repeatedly.
[ ] Renaming opencode in PATH (or setting opencodeBin to a bad path) shows OC unavailable and a one-time info notification; restoring it recovers on the next poll.
[ ] With pollIntervalSec changed in settings, the refresh cadence changes without a reload.