Thanks to visit codestin.com
Credit goes to superbased.app

TRACK COSTS BY TOOL

Track Command Code Token Usage & Costs

SuperBased reads Command Code's Claude-Code-shaped JSONL under ~/.commandcode/projects/. Track Command Code token usage locally with SuperBased.

SuperBased tracks Command Code token usage and cost on your own machine. SuperBased reads Command Code's Claude-Code-shaped JSONL under ~/.commandcode/projects/, where every assistant message carries its own usage block. Its inputTokens figure is gross - it includes cached tokens - so SuperBased nets it and records the cache read separately. Command Code resells mostly open-weight models through its own gateway, so its self-reported per-message cost is carried through as an estimate rather than recomputed. Its auth.json is never read. No account, no telemetry, no data leaves your laptop - SuperBased is a single open-source binary that also covers 39 other AI coding tools.

How SuperBased captures Command Code

  • Where the data lives - SuperBased reads Command Code's sessions from ~/.commandcode/projects/<project>/<session-id>.jsonl.
  • Capture tactic - Checkpoint, config, meta and history files sharing the directory are skipped, so only real session transcripts are parsed. Command Code exposes no Anthropic- or OpenAI-shaped base URL, so there is no proxy route today.
  • Token accuracy: From local logs - SuperBased reads token counts from Command Code's own local session files - the counts the tool itself recorded. Command Code talks only to its own backend, so there's no proxy route for exact provider-side counts.
  • Proxy routing - Command Code talks only to its own backend with no base-URL knob, so there is no proxy route - capture stays on the local files above.
  • Hooks - SuperBased registers into Command Code's own hook system, so sessions are captured as they happen.
  • MCP - SuperBased can register its MCP server into Command Code, so you can query your own session history and costs from inside the tool.

2-minute quickstart

Install SuperBased and start the local daemon (it auto-registers hooks for every AI tool it detects):

npm install -g @superbased/observer   # or: pip install superbased-observer
observer start

That's it - keep using Command Code exactly as you do now. SuperBased's watcher captures every session automatically.

Verify capture at any time:

observer doctor command-code

What you'll see

SuperBased dashboard showing Command Code session costs

  • Cost breakdown - per-session and per-day spend for Command Code, priced from SuperBased's built-in model pricing table.
  • Session history - every Command Code session with its model, duration, and token totals, searchable on the local dashboard.
  • Local dashboard - everything is viewable at http://localhost:8080; nothing is uploaded.

Limitations for Command Code

  • Known token-capture gap: no Tier-1 proxy path; costUsd trusted as-is for open-weight models with no observer pricing table.
  • Counts come from Command Code's own logs, so they are the tool's self-reported totals - accurate to what Command Code recorded, but not provider-verified unless you route through the proxy.
  • Conversation compression is off by default; token and cost tracking work without it.

FAQ

Is my Command Code data sent anywhere?

No. SuperBased runs entirely on your machine - it reads Command Code's local session files (and, if you opt in, proxies your API traffic through localhost). Nothing is uploaded, there is no account, and there is no telemetry.

How accurate are the token counts?

SuperBased reads token counts from Command Code's own local session files - the counts the tool itself recorded. Command Code talks only to its own backend, so there's no proxy route for exact provider-side counts.

Do I have to change how I run Command Code?

No. Run observer start once and keep using Command Code as usual - SuperBased captures every session automatically.

Does it track cache and reasoning tokens?

SuperBased captures whatever Command Code records locally. Note one honest gap: no Tier-1 proxy path; costUsd trusted as-is for open-weight models with no observer pricing table.

Where does SuperBased read Command Code data from?

SuperBased reads Command Code's sessions from ~/.commandcode/projects/<project>/<session-id>.jsonl - all on your own machine. Command Code talks only to its own backend with no base-URL knob, so there is no proxy route - capture stays on the local files above.

See also