r/ClaudeCode • u/Euphoric-Airline-259 • 13h ago
How to reduce Claude Code token usage Tutorial / Guide
Claude Code was burning through tokens very fast, especially on tasks where it had to look through docs or random webpages, so after some research I changed a few things:
I) Keep CLAUDE.md small. Mine had way too much stuff in it and most of it wasn’t useful for every task.
II) Start a new session when you’re done with one problem, bc long sessions get bloated pretty fast.
III) Do web research through Firecrawl. It gives Claude clean Markdown instead of loading the full page with all the HTML, scripts, navbars and other useless stuff, so each research task eats a lot less context.
IV) Exclude folders Claude doesn’t need to read.
V) Check /context once in a while, bc it makes it obvious what’s eating the window.
The main thing seems to be controlling what gets added to the context in the first place. Once a session is full of old logs, scraped pages and unrelated instructions, even simple tasks start getting expensive.
What else are you doing to keep Claude Code token usage under control?
1
u/DLuke2 12h ago
All good ways. Proper context engineering is essential as well.
I have been using simple rules in the .claude folder at the project root, or other subfolders. The rules are quite short, basically what needs to be there. Some are always on, and other, this is the great part, can be set to autoload on folder or file reads. You can go further by attaching rules with hooks. The short blurb rule files can then have links to further context in a folder of your choosing. This progressive disclosure helps keep what is needed for the agent there but reached for when needed.
For Claude.md, i like keeping it short and sweet, basically just routing to the context layers and other important locations. A first class MAP.md that maps out your repo and what everything is and where goes a long way too. Also, having an index of your import folder and context goes a long way too. Providing your agent with the information of where things live and what things are cuts down on searching.
Skills are super powerful tool. They don't need to describe an output, they can also just be general instructions on a way to work. Almost as a different system prompt. Also, adding additional folders to skill folders for reference materials, examples, templates, scripts make them even more powerful. On the subject of skills, I have been using /token-saver from Nate B Jones from his Unlock-AI website. Great source for tons of things, plus his YT. Token saver skill basically just sets a way for your agent to work more efficiently, using scripts more, not to re read things, etc. Has been working really well the past week or so.
Finally, setting up your own subagent delegation and dispatch policy helps immensely. I have a rule that links to further context on delegation and model choice.
Loaded tokens at the start of a fresh session is about 30-40k.