OpenCode Plugin - Full Claude Code Parity
Token Optimizer now runs natively on OpenCode (163K stars). One command to install:
opencode plugin add token-optimizer-opencode
What's included
Every Claude Code capability, ported ground-up to TypeScript for OpenCode's plugin API:
- 7-signal dual-score quality engine with ResourceHealth (monotonic) + SessionEfficiency (rolling window)
- MRCR quality curves calibrated for Anthropic, OpenAI GPT-5/5.5/4.1, and Gemini model families
- Smart compaction with mode-aware PRESERVE/DROP guidance (code/debug/review/infra/general)
- Session continuity restoring context from prior sessions via keyword-matched checkpoints
- Quality nudges on score drops, fill warnings at 75%/85%, tool call fatigue with superlinear scaling
- Loop detection via Jaccard similarity (catches retry loops before they burn context)
- token_status tool for on-demand quality reports inside OpenCode
- token_dashboard tool generating a standalone HTML dashboard with quality trends, session history, and daily stats
- Full configuration via plugin options + environment variable overrides + per-feature toggles
Quality assurance
12-agent torture room gauntlet covering security, correctness, parity, TypeScript type safety, reliability, performance, architecture, maintainability, testing, dashboard security, and repo-forensics. 30+ bugs caught and fixed before shipping.
Stats
- 21 source files, 2,537 lines of TypeScript
- 42.6 KB npm package (zero runtime dependencies beyond OpenCode's plugin SDK)
- Supports 30+ models across Anthropic, OpenAI, Google, DeepSeek, Qwen, Mistral, xAI, and local models
Also in this release
- README updated with OpenCode badge, install section, and platform mentions
- Version bumped to 5.7.0 across all manifests (plugin.json, marketplace.json, codex manifest)
Docs
- opencode/README.md for full OpenCode docs
- Main README for install quickstart