Gatewarden Nexus
Docs
Plugins
What's new
Roadmap
Tools
Your Nexus
Plugins/nexus-cost-control

OpenCode Plugin

nexus-cost-control

v2.0.0Published

Token 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.

Key Features

  • Per-session token & cost tracking
  • Auto-snapshot to session timeline
  • Per-model breakdown (input/output/cache)

Registered Hooks

Events this plugin listens to in the OpenCode runtime.

event (session.idle)

Auto-appends cost snapshots to the active Nexus session timeline. Debounced at 5-minute intervals to avoid noise.

Custom Tools

MCP tools this plugin exposes to agents.

nexus_cost_summary

On-demand cost snapshot with input/output/reasoning/cache token counts and estimated cost in USD.

nexus_show_plugins

Discovers all loaded Nexus plugins by scanning .opencode/plugins/ for nexus-*.ts files. Shows versions, API connection status, and registered hooks.

Technical Details

DistributionTypeScript source via nexus pull into .opencode/plugins/, no npm install required.
Dependency@opencode-ai/plugin (auto-installed via .opencode/package.json).
RuntimeDistributed as an OpenCode plugin to OpenCode projects; Claude Code projects receive the equivalent Claude Code hook adapter.
ArchitecturePure local data, no Helicone or external service dependencies. All cost data from OpenCode AssistantMessage.info.cost/tokens.

Plugin Info

Version
v2.0.0
Hooks
1
Custom Tools
2
Plans
Community, Pro, Enterprise

Source Code

View the full source, report issues, or contribute on GitHub.

View repository

Links

  • All plugins
  • Plugin collection repo
  • Nexus CLI (nexusctl)
  • Pricing
  • Developer docs
Back to pluginsView on GitHub

Get started

Ready to put specifications first?
Start building with Nexus.

Governed specs drive your agents. No ad-hoc prompts, no vibe coding.

Sign in with GitHub
Gatewarden Nexus

Platform

  • Documentation
  • Tools
  • What's new
  • Roadmap
  • Pricing

Resources

  • MCP Server
  • CLI
  • GitHub

Company

  • RelicFrog
  • Imprint

Legal

  • Privacy policy
  • Terms of service
© 2026 RelicFrog Holding UG (haftungsbeschränkt)·v0.17.2 (aea217e)
a Gatewarden product by RelicFrog Holding UG