Skip to content
Muhammet Şafak
tr
Tools & Technologies 5 min read

Which project burned how many tokens? I stopped guessing and measured

My subscription limits fill up every week, but I didn't know which project burned how many tokens. So I built a desktop app to measure it.

TL;DR

I could see the weekly limit filling up but only guessed which project burned how many tokens. TokenMetrics reads Claude Code, Codex CLI and Gemini CLI logs locally and makes usage visible by project, model and session.

On a dark background, Tan the indigo beaver points at violet line and bar charts on a translucent panel

I’ve been using AI agents heavily for a long time, and the weekly limits on my personal subscriptions fill up almost every week. At some point I asked myself: for which project, which job, did I actually burn how many tokens? The only answer I had was “probably that project.”

Guessing at this is lying; you have to measure. And measuring isn’t enough, you have to make the result readable at a glance. That’s why I wrote TokenMetrics.

What I am trying to fit into what

Over time I’ve developed some usage standards for myself, and I think I’m very close to a balance I can call sound. I try to fit my token usage into my subscription plans as much as I can, without giving up quality or security along the way.

So my concern isn’t using less. I’m trying to get the safest, most stable output I can with as few tokens as I can. What I do isn’t vibe coding, it’s AI-assisted development; whoever steers the agent should also know what it costs.

Leaving my API usage aside, I pay for a $200 Claude plan, a $100 ChatGPT plan and Gemini’s AI Pro for my personal projects and work. On top of that, the company I work for provides a Claude Teams subscription; I think it’s close to the $100 individual plan. On my personal accounts the weekly limit is usually used up to 100%, while the company account mostly stays around 70%.

I knew the limits were filling up. I didn’t know which work was filling them.

Why guessing can’t be trusted

Memory keeps the dramatic. I remember the long session that ran until morning; I don’t remember hundreds of small requests spread across the week. “I spent a lot on this project” is an impression, not a measurement. If I optimize on impressions, I optimize in the wrong place: I trim work that was never the problem and leave the real spender alone.

So I stopped guessing and decided to measure.

What TokenMetrics reads

TokenMetrics is a desktop app I wrote in Go. The window layer is Wails and the interface is Svelte; it runs on Windows, macOS and Linux. It collects the data the tools I already use leave behind, keeps it in a local SQLite file, and breaks it down by service, model, project, session and time.

It reads these sources:

SourceWhere it reads
Claude Codelocal session logs under ~/.claude/projects
Codex CLIsession files under ~/.codex/sessions
Gemini CLIchat recordings under ~/.gemini/tmp
Anthropic and OpenAI Admin APIsAPI accounts only; needs an Admin API key
Manual entry and CSVfor services that leave no logs

I made a few decisions up front so the measurement could be trusted. I made scanning incremental: the app remembers how far it read each log file and only reads what was appended since. It never counts the same message twice. It keeps stored records even if the log file is deleted. For Claude Code I also wrote a verification tool: it recomputes the totals from the raw logs with its own parser and compares the result with the database, model by model. If I couldn’t trust the numbers, there was no point in writing this app.

On privacy, my log parsers read token counts and metadata: model, time, project directory, session ID. They don’t read your prompts or answers. The data doesn’t leave your machine; network traffic exists only for the Admin APIs you configure yourself.

Measuring isn’t enough: you have to see it

A raw table didn’t answer my question. Pulling “which project this week” out of a list of records still leaves the work to memory and instinct. The app’s real job is therefore visualization:

  • Totals for today, the last 7 days and the last 30 days, and a token chart by hour or day, split by service or model.
  • A model and service comparison table: input, output and cache tokens, request count, estimated cost.
  • Usage per project and per session. I defined a project as the directory the agent worked in; that’s where the answer to “which project” comes from.
  • Estimated limit tracking for the 5-hour and weekly subscription windows.
  • An OS notification and a tray icon alert when a threshold is crossed.

You enter the limits yourself, because providers don’t publish subscription limits. That’s why I marked limit percentages and costs as estimates in the interface. Prices live in a built-in table that you can edit in Settings.

The limits of the measurement

There are things the app can’t see yet:

  • Usage that leaves no logs is invisible. I read only Claude Code, Codex CLI and Gemini CLI logs. For the places where I use ChatGPT and Gemini outside those tools, there is only manual entry.
  • No account split. I keep records by service, model, project and session; I haven’t added which subscription they were charged to as a separate field yet. I can’t use this app to measure the 100% versus 70% gap between my personal and company accounts separately.
  • Cost and limit percentages are estimates. I didn’t write them to replace the real invoice or the real limit counter.
  • The interface is Turkish only.
  • Beta. Version 0.1.0; I haven’t code signed the binaries or notarized the macOS app, so the operating system asks for confirmation on first start. The code is licensed GPL-3.0-only.

There are no per-project numbers in this post, because I released the app today and I don’t have a week of regular data yet.

Try it

If you want to measure your own usage, the source is on GitHub: muhammetsafak/TokenMetrics. I described how I built it on the Labs page. My suggestion: measure a week without changing how you work, then put your guess and the measurement side by side.

Experiments on this topic

An open-source desktop app in Rust and Tauri 2 records a meeting's audio and the screen frames that change, then writes a summary and action items.

What it does today

Records a meeting's microphone and system audio on separate tracks plus only the screen frames that change, then writes a note with a summary, decisions, action items and open questions. Anyone who wants meeting recordings turned into notes without keeping video can build it from source and try it.

Desktop Open-Source Rust Tauri 2 React +4 more
November 2026 — Ongoing

A desktop app that reads Claude Code, Codex CLI and Gemini CLI logs locally and shows token usage by project, model and session.

What it does today

Collects AI agent token usage from local logs and shows it by project, model, session and time, with estimated cost and subscription limit tracking. A developer who uses Claude Code, Codex CLI or Gemini CLI heavily and wants to see the spend can install it.

Open-Source Desktop Go Wails Svelte +2 more
November 2026 — Ongoing

Comments

Sign in with your GitHub account to join the discussion. Comments are stored in GitHub Discussions.

Related Posts

Search the site

Start typing to search posts, projects and pages.

Esc to close Powered by Pagefind