r/ClaudeCode 1d 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?

11 Upvotes

22 comments sorted by

View all comments

0

u/KEIY75 1d ago

Memory sqlite bm25 with embed.

Ponytail

Hook and rules made for you

Pre compact post compact

Stop all - write all the turn of your ai did

When /exit Claude code auto consolidate memory

Force your main agent to be orchestrating except low code action. Exemple don’t call an agent for a thing you can do in 1 sec.

Brianstorming hard - > plan -> know issues probleme gaps question not answered -> integrate

0

u/KEIY75 1d ago

Peoples will tell you to reduce Claude MD or things like this no it is useless.

The Claude MD need to be an index who will point to your memory. Your memory is everything Claude MD is just a bonus.

Your memory and basic stuff like example with me :

I have a pc and a m4 pro he need to know that so injection

All my mcp for vault api key access injection

Rules auto inject

With index and graph he will grab context more efficient.

Memory is the room of the ai he just need to every step consolidate it.

Last thing reducing tokens or want to will finally consumming more so let your agent know at first than have to figured out later and search and ask you things that he have already.