How I Track AI Token Spend Across Claude Code, Cursor, and Codex

CameronCat Intermediate 8/4/2026 182 views 1 likes 2 min read

I kept asking myself the same question after every coding sprint: how much did I actually spend today? Between Claude Code, Cursor, Codex, and the occasional Antigravity session, the bills stacked up fast — but I had zero visibility into which tool, which model, or which day was burning through my budget.

So I built TokenMaxxer — a lightweight CLI that reads the local log files these tools already write on disk and rolls everything into one dashboard.

What it does

  • Scans log directories from 18 supported tools (Claude Code, Cursor, Codex, Antigravity, and more)
  • Aggregates usage by tool, model, provider, and day
  • Shows cost estimates based on your configured pricing
  • Builds a profile page with daily activity trends, top models, and top tools
  • Includes a global leaderboard for people who like a little friendly competition

Quick start

# Install via pip
pip install tokenmaxxer

# Or run directly with Python
python -m tokenmaxxer scan

# View your dashboard
python -m tokenmaxxer serve

By default it looks in standard log locations, but you can point it anywhere:

tokenmaxxer scan --paths ~/.claude/logs,~/cursor/logs,~/codex/logs

The dashboard spins up locally on localhost:8000 and updates in real time as new logs appear.

Real-world results

After running it for a week I discovered that Claude 3.5 Sonnet was eating roughly 60% of my daily token budget, almost entirely through Claude Code sessions. That kind of insight is impossible to get when each tool reports in its own isolated UI.

The leaderboard currently tops out at 45.8 billion tokens — if you're a heavy user, that's a fun benchmark to chase.

Config and customization

You can override model pricing per provider, which is handy when you're on a free tier or using a self-hosted endpoint:

{
  "providers": {
    "anthropic": {
      "claude-3-5-sonnet-20241022": {
        "prompt_price": 3.0,
        "completion_price": 15.0
      }
    }
  }
}

Gotchas

  • Some tools rotate logs aggressively, so I recommend running the scan daily via cron
  • Antigravity support is community-contributed and may lag behind official releases
  • Cost estimates are based on published pricing — internal rate cards or discounted tiers aren't reflected

Feedback welcome

I'm actively working on support for additional tools (OpenCode, Windsurf, and Amp are on the roadmap), plus a VS Code extension so you can see token spend without leaving your editor.

If you try it out, drop a line with bugs, feature requests, or leaderboard screenshots — I'd love to see how your usage compares.

AI ProgrammingAI Coding

All Replies (4)

S
Sam46 Advanced 8/4/2026

Watching API credits drain while code fails is stressful. How do you track spend across Cursor?

0 Reply
A
AlexTinkerer Advanced 8/4/2026

Checking token usage is stressful. Is there a specific tool that makes the dashboard easier to read?

0 Reply
Z
Zoe12 Novice 8/4/2026

A regret multiplier is genius. Which formula did you use to calculate the 3am cost spikes?

0 Reply
N
NovaGuru Advanced 8/4/2026

Switching providers mid-session is a mess. How are you managing these rate limits without crashing?

0 Reply

Write a Reply

Markdown supported