Guides
How to Cut Claude Code Token Usage (and Your Bill) on a Big Project
Published:
If Claude Code is chewing through tokens (and your budget) on a large project, you’re not doing anything wrong; you’re hitting how these tools work. The main reason is simple: the AI reads files to understand your code, and on a big codebase it re-reads a lot, every turn. The fixes are practical and mostly free. Here’s what’s actually driving the cost and how to bring it down without crippling your results.
Where the tokens actually go
Every message you exchange with Claude Code is measured in tokens, roughly pieces of text, and you’re billed (or rate-limited) on how many flow back and forth. Three things quietly inflate that count on a real project:
- Reading files. To answer “where do we handle payments?”, the AI opens files, sometimes many of them. Each one’s contents count as tokens.
- Re-reading. In a long session, it often re-opens the same files because it needs them again, paying for them more than once.
- A growing conversation. The whole chat history is re-sent each turn, so a long, cluttered conversation makes every new message more expensive.
Notice the theme: most waste comes from the AI scanning and re-scanning your code to find its way around. That’s the lever to pull.
Fix 1: Give it a map instead of letting it search
The biggest single win is to stop the AI from re-reading your whole project to locate things. Give it a map that summarises what’s in your code and how it connects: a code knowledge graph or a repo map. Then, instead of opening twenty files to find the right one, the AI consults a compact map and goes straight there.
This is why map-based tools advertise dramatic savings on large codebases: reading a small map once is far cheaper than scanning piles of files repeatedly. On a big project, this alone can be the difference between a comfortable session and one that burns through your limits by lunch.
Fix 2: Clear context between unrelated tasks
Because the conversation is re-sent every turn, a long chat is a hidden tax on each message. When you switch to a genuinely different task, run /clear to start fresh. You stop paying to drag along history the AI no longer needs, and as a bonus it stays more focused. The habit: one task, then clear, then the next.
Fix 3: Keep a lean rules file
Claude Code reads your project rules file (often CLAUDE.md) into context. A tight, well-written one is gold. It tells the AI your conventions so it doesn’t have to rediscover them. But a bloated one costs tokens on every single turn. Keep it focused on what genuinely changes the AI’s behaviour, and cut the filler.
Fix 4: Scope your prompts
Vague prompts make the AI explore widely (and expensively) to figure out what you mean. “Fix the bug where empty emails crash the signup form” points it straight at the relevant code; “fix the signup” sends it wandering. Specific prompts aren’t just clearer: they’re cheaper, because they cut the searching.
Fix 5: Use subagents for big, noisy jobs
For large research-style tasks, a subagent does the heavy reading in its own context and returns just a summary, so all those file contents don’t pile into (and inflate) your main conversation. It keeps your primary thread lean, which keeps every later message cheaper.
What about a cheaper model?
Switching to a smaller or free model lowers the per-token price, and it’s tempting. But be honest about the trade: cheaper models make more mistakes, and redoing work eats the savings. Usually the smarter play is to run a capable model efficiently, with a map, cleared context, lean rules and scoped prompts, rather than dropping to a weaker one and paying in errors. Save the cheap models for simple tasks where quality matters less.
Set up to spend less from the start
A good setup prevents most token waste before it starts. Our free AI for Coders tool helps you choose the right assistant, install it for your operating system, and generate a lean starter rules file so the AI understands your project without re-learning it every session. Add a code map as your project grows and the habits above, and you’ll get the same results for a fraction of the tokens.
Keep reading
Frequent questions
Why does Claude Code use so many tokens? +
Mostly because it reads files to understand your project, and on a big codebase that adds up fast, especially when it re-reads the same files across a long conversation. Every file it opens, every long exchange, and every search consumes tokens. The bigger the project and the longer the session, the higher the count.
What's the single biggest way to reduce token usage? +
Keep the AI from re-reading your whole project to find things. Give it a map (a code knowledge graph or repo map) so it looks up where code lives instead of scanning everything each time. Combined with clearing context between unrelated tasks, that's where the biggest savings come from.
Does clearing the conversation save tokens? +
Yes. A long conversation is re-sent to the model each turn, so a bloated chat quietly raises the cost of every message. Clearing the context between unrelated tasks (with /clear) starts fresh and stops you paying to drag along history the AI no longer needs.
Will a smaller or free model save money? +
It lowers the per-token price, but cheaper models make more mistakes, so you can spend the savings redoing work. Often the better lever is not switching to a weaker model but using a capable one efficiently: tight prompts, a code map, cleared context.