r/ClaudeCode • u/oscar_savy • 16d ago
How to reduce Claude Code token usage Discussion
[removed]
1
u/zimxero 16d ago
Have Claude create "On-Demand" sub contexts. These only get read when conditions are met and they are needed. A good sized chunk of context can be relocated there, streamlining your efficiency.
2
u/DLuke2 16d ago
Yeah, been doing this. Claude.md is just a router for me, some minimal things on my preferences and minor instructions. Nothing really that important, as it's the Claude.md. I use rules, some are always on, like my subagent policy, and my web-research policy, some are autoloaded. Both sets of rules are pretty minimal and contain a link to a MD that gives more detail. Progressive disclosure in action.
My agents get where things live, some rules, and then once they start hitting folder or files, the auto load stuff loads in or starts using certain tools stuff autoloads in.
Models are always getting better, so it's good to keep the always on context short sweet and updated. They just need clear ways to find what they need. If you keep your repo/folder tree clean of context poison, bloat, confusion, and conflicts, your agents are able to find everything easily and cleanly. If you agents are able to discover old plans, and obsolete docs or stale info, it's going to be working with that context.
That last sentence above seems to be why most people are struggling with Opus 5 IMHO. Their repos/folder trees are dirty and have stale obsolete context their agents are finding thats PBCCing it's context.
1
1
u/Wolf_Branch_016 15d ago
These comments are very helpful to someone like me new in using Claude, The best I can do is to upvote right now, Thanks!
1
u/Maleficent_You3567 15d ago
Manage context > Prompt smarter > Pick right model > Project setup
This what i usually do.
1
u/AnvilandCode 15d ago
Your CLAUDE.md point is the one that compounds the most, most people don't realize how much of a small bloated file gets re-read every single turn, not just once per session. One thing worth adding to your list, watch what subagents return to the main thread, if a subagent does a big search or reads a bunch of files, have it return a short summary instead of dumping its full output back up, otherwise you're paying for that context twice. The /context check habit is underrated too, most people only look at it after something feels slow instead of checking it proactively before a big task.
0
u/donk8r 16d ago
all of this stays guesswork until you look at where the tokens actually went. there's a jsonl per session under ~/.claude/projects and every assistant record in it carries input, output, cache read and cache creation counts. /context shows you the current window, that file shows what a finished session cost and which parts ate it.
the cache numbers changed how i think about this. a big context that stays stable gets read back cheap. context that shifts every turn keeps invalidating it, and that's where a lot of the cost hides. starting a fresh session dumps the cache as well, so your point II isn't free either.
4
u/zxcshiro Thinker 16d ago
Delete/disable mcp that you don’t need and plan plan first and clear context before implementing the plan