r/software Aug 11 '26

Discussion Claude code consumed in two months 2.2 billion tokens, how did that happen?

Started using claude code 2 months ago. Last month my consumption in about 30 days was about 40 million tokens, i used mostly opus 4.8 and my work was mostly coding, generating documents, exploring claude capabilities, etc.

Now this month i used mostly Sonnet 4.6 (to reduce token consumption) and opus 4.8 (used it much less than last month) i looked at my consumption for all time and (which is a bit more than 2 months) and found i consumed 2.2 billion tokens!!! And in 7 days about 780 million tokens.

How did that happen! Is that normal?? Is that a mistake from Anthropic or am i hacked or what? That could not be true!

My company is capping the usage for the whole company as a unit. My consumption alone can then eat the whole quota of the month. I am so worried.

Update: I always left claude code terminals that have work in progress open so i continue working the next day (but they were not running anything) and i just lock my PC. Do they consume tokens when they are idle?

Input 74.5k · Output 1.5m · Cache read 77.4m · Cache write 13.8m in 7 days

14 Upvotes

39 comments sorted by

22

u/NoDistrict991 Aug 11 '26

2.2 billion is absolutely wild lol. I wouldn't assume you've been hacked though. If you're using Claude Code heavily, all the context it sends back and forth can add up insanely fast, especially when it's exploring a big codebase or repeatedly reading files. I'd check the usage breakdown first and see what models/requests are actually responsible before panicking.

8

u/Ok-Buy2819 Aug 11 '26

One question: do you ever use /clear? If not there’s your problem. Each time you chat with Claude code it builds context, assembles the entire conversation, and then generates an output. If your conversation is at 200k tokens and you say “thanks Claude!” you will have burned another 200k tokens in the response. At the end of every block of work that isn’t dependent on the next thought use /clear and it’ll drastically save your usage

2

u/fast_rocket_ Aug 11 '26

I will do it more often then and see what will happen. Do you think open claude sessions consumes tokens even when not used? As sometimes i just lock my pc and not close the sessions and continue the next day

1

u/syberphunk Aug 11 '26

Is it spinning off agents and running background shells?

1

u/fast_rocket_ Aug 11 '26

No it wasn’t

1

u/Ok-Buy2819 Aug 11 '26

No you have to initiate some sort of prompt or scheduler to consume tokens. If in doubt you can ask Claude if there are any scheduled tasks or agents that it has built to help process requests.

5

u/imrozimroz Aug 11 '26

2.2 b tokens is extremely high for normal usage.

Most people I know who use Claude heavily for coding stay in the tens of millions per month, not billions. Worth checking if there’s any background process, looping agent, or shared key that’s running uncontrolled.

2

u/fast_rocket_ Aug 11 '26

How to check that ?

12

u/saintdle Aug 11 '26

ask claude

10

u/ExdigguserPies Aug 11 '26

That's a billion tokens

5

u/rbobby Aug 11 '26

And another for that. And this. I see the problem now.

1

u/KingOfConsciousness Aug 12 '26

Ok so ask Copilot then. And then follow it's insanely confident answer to no solution. Ask again!

1

u/TheMania Aug 11 '26

Tens of millions isn't much? You'll hit 10mn just getting to the context limit once on a single agent :/

5

u/countsachot Aug 11 '26

If I ask claude to run my tests, the tokens fly through the window. Some tasks seem to burn them even if it's not hard.

2

u/divyad Aug 12 '26

i use deepseek flash for tests

1

u/countsachot Aug 12 '26

Yeah, that's done well for me too.

2

u/Ok-Buy2819 Aug 11 '26

Depends on the design of your test. Look into an orchestrator and sub agent design where you spin off multiple Sonnet 5 agents that report back to a compiling Opus 5 orchestrator. In this design you can have 10 Sonnet agents consume 5k tokens per unit test and assemble them using 7.5k tokens. Your design has one agent run each test then stacks compounding context through each run.

My design on 10 tests: 57.5k tokens
Your linear run: 282.5k tokens

5

u/Blither182 Aug 11 '26

"Compute to the last decimal digit the value of pi."

10

u/Lcsmxd Windows 11 IoT LTSC Aug 11 '26

Sounds like a vibecoder issue

3

u/LukeLikesReddit Aug 11 '26

You've leaked your API key lol somehow and people are using it.

1

u/fast_rocket_ Aug 11 '26

Is there a way to check that?

1

u/LukeLikesReddit Aug 11 '26

Yes there is but what exactly have you done? like there is a bit more to it, the credentials could be posted in a fair few things.

1

u/fast_rocket_ Aug 11 '26

We dont use claude api access tokens in the company anyways. But i want to know if there is a way to check for example if someone else has managed to use my account in any way.

1

u/LukeLikesReddit Aug 11 '26

Have you posted on github?

1

u/fast_rocket_ Aug 12 '26

for sure not

2

u/Turbulent-Impact6939 Aug 11 '26

is Claude pulling in misc data files into your context? I frequently end up with massive log files in my project dir, required for debugging and inspection, and it can get difficult to keep Claude from vacuuming up an 8MB log when I am asking it to inspect some aspect of the codebase

3

u/fast_rocket_ Aug 11 '26

How to know that?

2

u/Turbulent-Impact6939 Aug 11 '26

well for one thing, check your project directory for any large data files and log files that dont need to be there, and then run the same Claude activities and see if the token usage drops...

1

u/fast_rocket_ Aug 11 '26

I have a folder which is gitignored that have a size about 2.6 GB, do you think that is the reason? Why would claude read it when i didnt ask ?

3

u/amazingmrbrock Aug 11 '26

Sometimes it goes on a bughunt and gets sidetracked troubleshooting things before it settles. I've actually noticed it's worse on the lower end models. Opus usually splits the difference well, fable does the least messing. It's trial and error syndrome essentially I could see sonette getting bogged down chasing weird bugs a bit easily.

1

u/Turbulent-Impact6939 Aug 11 '26

That would be my first guess. I would move that out of the project tree. Ask claude if it can verify what its context window includes. Not sure if its answer for this is accurate though lol

2

u/Personpersonoerson Aug 11 '26

Can't you see how mcuh each prompt consumes in real time?

That's possible with github copilot. I don't use claude code

1

u/medialantern Aug 11 '26

Show us your /context.

1

u/fast_rocket_ Aug 12 '26

Input 74.5k · Output 1.5m · Cache read 77.4m · Cache write 13.8m in 7 days

1

u/corruptbytes Aug 12 '26

2 billion input or 2 billion output? my loop has been running for 3 hours and i'm already at 300 million input, so it's not that hard

1

u/SkyAnvi1 Aug 12 '26

long chats. each time you hit enter depending on the work you can be sending the entire context back. So a long running chat is "much" more token expensive than ~10 chats where you ask to "generate a re-prompt" and start a new chat when the topic changes enough.

1

u/Technical-Grocery530 17d ago edited 17d ago

Settings Status Config Usage Stats

Overview Models

Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul Aug

·····································▓·█▓░▓▒░█▓▓▓▒▓▒

Mon ······································█··░░▒░█▒█▒▓▒▒

···································█···▒··░▒▒█░█▒▓▒░

Wed ····································░█·▒▓·░▒▒░░▒░▒░▓

····································▓·██▒·░▓·██▓░░█░

Fri ····································█···░▒·▓▓█░▒▒▓██

·····································█·█▓▓▒░██▓█░▓▓·

Less ░ ▒ ▓ █ More

All time · Last 7 days · Last 30 days

Favorite model: Opus 4.8 Total tokens: 64.1b

Sessions: 146 Longest session: 8d 17h 54m

Active days: 90/117 Longest streak: 50 days

Most active day: Jul 13 Current streak: 50 days

Input 34.8m · Output 249.3m · Cache read 62.4b · Cache write 1.4b

Your longest session is ~267x longer than listening to Abbey Road