DEV Community

Valancio Dsouza
Valancio Dsouza

Posted on

I Analyzed 4,788 AI Coding Sessions — Here's Where Your Tokens Actually Go

Last month I started tracking every command I ran through Claude Code, Cursor, and Aider. After 4,788 commands and 355 million tokens, I found something shocking:

97.6% of my tokens were wasted on noise.

Not on actual coding. Not on debugging. On repetitive test output, build logs, and progress bars that the AI didn't need to see.

THE NUMBERS

Commands tracked: 4,788
Total tokens processed: 355,785,039
Tokens that were actual content: 8,694,751
Tokens that were noise: 347,090,288
Waste rate: 97.6%

WHERE THE WASTE COMES FROM

  1. Test Output (99.7% waste)

Running pytest on a project with 1000 tests generates around 14,000 tokens. After filtering to just failures and summaries: 38 tokens.

Every "PASSED" line, every progress dot, every timing stat — the AI doesn't need any of it to help you fix the failing test.

  1. Build Logs (99.4% waste)

A typical webpack or tsc build dumps 300+ lines. The only lines that matter: errors and warnings. That's usually 5-10 lines.

  1. Package Manager Output (97% waste)

npm install produces pages of resolution trees, audit notices, and funding requests. What you actually need: "installed" or the error message.

  1. Git Status (96.9% waste)

50 modified files = 254 tokens. What you usually care about: "these 3 files in src/". About 8 tokens.

THE ONE EXCEPTION: STACK TRACES

Interestingly, stack traces showed almost 0% compression opportunity. Every line matters for debugging. The AI actually needs to see the full trace.

This makes sense — stack traces are information-dense. Test output is the opposite.

WHAT THIS MEANS FOR YOUR WALLET

At Claude's Sonnet pricing ($3/million input tokens), my 347 million wasted tokens = $1,041 burned on noise.

With Opus ($15/million), that's $5,206.

And I'm just one developer. Multiply this across a team.

THE FIX

The solution isn't to use AI less. It's to filter what you send it.

Before:
pytest output with 1000 tests showing every PASSED line = 14,006 tokens

After filtering:
Just the failure message and summary = 38 tokens

Same information. 99.7% fewer tokens.

MY TAKEAWAYS

  1. Test output is the #1 token killer — it accounted for 343 million of my 347 million wasted tokens

  2. Build tools are chatty by design — they're made for humans scrolling terminals, not AI context windows

  3. Stack traces are sacred — don't compress them, you'll lose debugging context

  4. Progress bars are pure waste — those loading bars mean nothing to an AI

TRY IT YOURSELF

Track your next 100 AI coding sessions. Count the tokens going in. I bet you'll find similar numbers.

The AI coding revolution is here. But we're paying 40x more than we need to because our tools were built for human terminals, not AI context windows.


Data collected over 7 days using local token counting with tiktoken. All commands run through Claude Code, Cursor, and Aider on real projects.

Top comments (0)