OpenCode Plugin
nexus-cost-control
v2.0.0PublishedToken usage and cost tracking for Nexus sessions using native OpenCode message data. Zero external dependencies.
Overview
Tracks token usage and estimated cost for the current Nexus session by aggregating data from OpenCode's native AssistantMessage objects. Each message carries provider-computed cost and detailed token counts (input, output, reasoning, cache read/write). v2.0.0 removed all Helicone dependencies — no external API keys or HTTP requests required. Cost snapshots are automatically appended to the active Nexus session timeline during idle periods.
Registered Hooks
event (session.idle)Auto-appends cost snapshots to the active Nexus session timeline. Debounced at 5-minute intervals to avoid noise.
Custom Tools
nexus_cost_summaryOn-demand cost snapshot with input/output/reasoning/cache token counts and estimated cost in USD.
nexus_show_pluginsDiscovers all loaded Nexus plugins by scanning .opencode/plugins/ for nexus-*.ts files. Shows versions, API connection status, and registered hooks.