DEV Community

Yeskendir Salgara
Yeskendir Salgara

Posted on • Originally published at github.com

I built a token observatory for Claude Code because I was tired of flying blind

The problem

An hour into a Claude Code session, I got: "Context window full."

I had no idea what burned it. Was it the MCP tools fetching docs? The thinking budget? The growing list of edited files? I was flying blind on a meter that was costing me real money.

So I built Scopeon - a real-time observability tool that gives you X-ray vision into every token your AI coding agent consumes.

Key features

  • Turn-by-turn token breakdown — see every component, not just totals
  • Prompt cache ROI — hit rate gauge + dollars saved vs. uncached
  • Context countdown — "~12 turns remaining" before hitting the wall
  • CI cost gatescopeon ci report --fail-on-cost-delta 50 fails PRs on AI cost spikes
  • 14 MCP tools — Claude Code can query its own token stats without polling
  • Browser dashboard — live WebSocket charts, zero npm
  • Fully local — no cloud, no accounts, SQLite on your machine

Works with

Claude Code, GitHub Copilot CLI, Aider, Cursor, Gemini CLI, Ollama

Install

 curl -fsSL https://raw.githubusercontent.com/sorunokoe/Scopeon/main/install.sh | sh
 scopeon onboard
Enter fullscreen mode Exit fullscreen mode

The architecture (for the Rust folks)

Five crates:

  • scopeon-core — SQLite schema + pricing engine
  • scopeon-collector — file watchers per provider
  • scopeon-mcp — MCP server (14 tools over stdio)
  • scopeon-tui — ratatui dashboard
  • scopeon-metrics — aggregation + health scoring

Adding a new AI provider takes ~50 lines of Rust.

→ GitHub: https://github.com/sorunokoe/Scopeon

Top comments (0)