Token tracker

Running

Runs on Brain →

Records every AI model call made on my behalf, across Claude, Antigravity and the models on my Mac, in one ledger, and shows me where the usage goes.

  • 25,900+model calls logged
  • 4engines tracked
  • 445automated tests
  • 11system-check rules

HOW IT WORKS

Architecture

Code collects every call from every engine, attributes it to a project, and turns patterns into proposals I approve or deny.

Interactive diagram. Select a card to highlight what it feeds and what feeds it; press Escape to clear.

Who does the work:

DASHBOARD

The dashboard

Shown with demo data. The real one runs privately on my Mac.

Still
6 second walkthrough

UNDER THE HOOD

What it actually does

  • Exact, from every engine

    Each engine is read from its own per-call receipt. The one estimate is labelled and never added to exact totals.

  • A call, not a message

    One message can trigger several calls, including silent retries. The ledger shows every one.

  • A drift guard on the format

    If a vendor changes how it records usage, those rows are flagged and left out rather than guessed.

  • No double counting

    One tool writes the same usage on several lines, so rows are matched on request ID before they count.

  • Compute, not only tokens

    During each local call the proxy samples CPU, memory and swap once a second.

  • Attribution is an algorithm

    The project with the most touched files wins, a tracker edit counts double, and ties are marked mixed.

  • No prompt text kept

    The ledger stores no prompt text beyond a short, redacted opening line.

  • Locked to my Mac

    The proxy and the dashboard refuse anything that does not come from the machine itself.

  • Secrets cannot be committed

    A pre-commit scan blocks any key-shaped string, naming the file and line without printing the secret.

  • Two vendors review every proposal

    Claude and Antigravity judge each proposal side by side. Automatic mode stays off unless every check agrees.

  • A denial sticks

    A denied proposal does not come back when the same finding fires again, only when something genuinely new appears.

  • Tracking sits outside the model

    A hook records usage after each reply, so no model is trusted to report on itself.

HOW I DESIGNED IT TO WORK

Exact, or labelled

Three lines from the spec I wrote for the tracker.

“Every engine is exact, read from its own per-call usage receipt.”

On accuracy

“Running Ollama must never skip the ledger.”

On local models

“Estimated figures … are always labelled and never summed into exact totals.”

On honest numbers

WHAT'S NEXT

Next, in order

  1. Make the health check catch a run that hangs, not only one that fails.

  2. Rule on the pending efficiency changes, such as worker limits for the job search.

  3. Close the remaining gaps where some local calls pass through unrecorded.