r/ClaudeCode • • 3d ago

Built with Claude Half my Claude Code tokens went to stuff I never asked for

I put a logging proxy in front of Claude Code to see where tokens actually go.

I typed 3 prompts. It sent 7 requests.

Two of them were the grey “next prompt” suggestions. Each one re-sent the entire conversation so it could guess what I might type next. Another request just named the session. On top of that, every request includes the full list of every skill and tool you’ve installed used or not.

Claude Code already has settings to turn most of this off. I just packaged the useful ones into one command so you don’t have to hunt for them.

Results (measured):

  • 3-prompt chat: ~85K tokens → ~40K (-53%), same answers
  • Short chats: roughly half the tokens
  • SWE-bench Verified (Sonnet 4.6, 33 tasks): same 20 solved, $24.78 → $20.05, 135 → 103 minutes

It only turns off things that cost tokens and aren’t required for the actual work (suggested prompts, session titles, long skill descriptions, a rarely used tool, etc.). Claude’s answers stay the same.

Install:

Bash

npx claude-lean init

Uninstall is one command too. No account, no telemetry.

Repo: github.com/JacobTheJacobs/claude-lean

One caveat I learned while testing: token usage on the same task can swing a lot between runs. If you’re evaluating any cost-saving tool, run it on your own work (or a fixed benchmark) more than once.

27 Upvotes

14 comments sorted by

•

u/AutoModerator 3d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/CandidSystem6155 3d ago

Matches what we saw when we measured: reading context was around 170x the tokens the model actually wrote, so anything that resends the whole conversation is where the cost lives. Besides the settings, what helped was keeping sessions short and moving mechanical steps like fetching, parsing and counting into small scripts, so the model only reads the narrowed output and decides.

2

u/CapableForce1027 3d ago

~100x on SWE-bench for me. Claude reread the whole conversation 400 times to write a two-line fix. Very relatable, honestly, that's how I answer emails.
Short sessions + scripts for the grunt work is the stuff no setting can fix.

1

u/Dehrose 1d ago

Can you explain these scripts? Have you told Claude to build and use python for certain things? What things? Do you mind sharing?

1

u/CapableForce1027 22h ago

Yes. Instead of Claude reading a whole log, I have it write a quick Python script that prints just the errors. Claude only sees the summary, and that's what gets re-sent every turn, not the whole file. One of my logs: ~396K tokens to read, ~27 tokens of script output. Same answer. It's the difference between reading the whole novel and texting a friend "how does it end?"

1

u/CandidSystem6155 2d ago

400 rereads for a two-line fix is the most honest benchmark I've seen this week. And agreed, the settings only change how fast you pay, the scripts change what you're paying for.

1

u/Surendra_GBP 2d ago

The 53% reduction is impressive, especially if answer quality stays consistent. One thing worth checking is whether these savings hold up in longer coding sessions, where conversation history and tool descriptions can add significant overhead.

Would be interesting to see a breakdown of which disabled features contributed the most savings. That would help developers understand what they're actually paying for.

1

u/CapableForce1027 2d ago

Good point. Long sessions only save ~10% on SWE-bench because Claude keeps rereading the chat like it has short-term memory loss.

Biggest win is still turning off the background noise (suggestions, titles, recaps). After that, shorter skill descriptions. Same answers, just less Claude refreshing its own tab.

1

u/cautistic-john 2d ago

the detail i'd want to see is whether both setups solved the same 20 tasks. the same total can hide a few regressions cancelling out a few improvements, which matters when the claim is that the answers stay the same. also useful to separate the settings that disable background requests from anything that changes which tools the agent can use. i'd be much more comfortable adopting the first group without changing my actual workflow.

1

u/CapableForce1027 2d ago

Same 33 tasks, both solved 20. And good call, just shipped npx claude-lean init --background-only: installs only the background-request part nothing Claude sees changes.

-5

u/awesomebirder 3d ago

nice writeup, and the caveat at the end is the most useful part. one thing worth separating: the skill and tool list sits at the start of every request, so after the first call it is mostly a cache read billed at about a tenth of normal input. halving raw tokens is not halving cost or limit. the suggestion requests that re-send the whole chat matter more, especially if they land after the cache expired. your swe-bench dollar number is the fairer comparison, would be curious to see it split into cache reads, cache writes and output

0

u/CapableForce1027 3d ago

Fair, cached tokens are basically on sale, so half the tokens isn't half the bill. SWE-bench split (33 tasks, Lean vs plain):

PartChange
Cache reads−13%
Cache writes−13%
Output−17%

Output dropping is luck, It doesn't touch what Claude writes. The cache part is the real saving.

-1

u/awesomebirder 3d ago

thanks for running it, thats a cleaner result than the headline. same 20 solved with reads and writes both down 13% is a real saving, and calling the output drop luck is the honest read. if you ever rerun it, turning off only the suggestion requests would show how much of the 13% is the re-sent chat versus the shorter skill list

2

u/gotcha-bro 3d ago

Weird seeing very obvious Claude output written with intentionally bad grammar (no caps) to what... Obfuscate? It's painfully overt AI structure and tropes from both your posts.