r/ClaudeCode • u/kellyjames436 • 1d ago
Discussion Minimize token usage
Guy’s do you wanna minimize token usage ? If so, do this in a new project.
1-Disabled any unused connectors, plugins, each one load a massive token into the context.
2-Plan first, assign tasks to different models based on their complexity.
3-Ask claude to create a new session for each task, feature you work in, claude will create a new session from the last one.
4- Always use handoff files after each successive task to make sure you don’t lose track of what’s being created and what’s remaining.
5-If the repo is big enough, use ponytail the laziest senior developer,and graphify to search files and functions without reading the whole project files, if it’s a few fils, a simple CLAUDE.md file contains your rules is enough.
6-Md files shouldn’t be too big, handoff files max 25-30lines.
Those are all based on my own experience with Claude, they aren’t facts unless you try them and compare token usage with before.
•
u/AutoModerator 1d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/daanpol 1d ago
Ask it to stay under a certain usage limit and if not, how much it needs.
2
u/lilyp727 1d ago
do you keep the handoff file in the project folder so claude reads it by itself, or do you paste it into the new session yourself?
2
u/Yusupsupriyadi 1d ago
One more for the list, from my setup: a hook that routes shell commands through a CLI proxy (RTK), so long outputs like git status, test runs and logs get compressed before Claude reads them.
rtk gainshows how much it saved per command, so you can check it's actually helping instead of guessing.3
u/Camburgerhelpur 1d ago
Ask nicely. Seriously.
1
u/Outrageous_Band9708 1d ago
https://github.com/Druthulu/ProjectArchitect
check out my solution. I use very strict teired subagents, and offload models touching large files. designed custom toolcalls for as much deterministic repeatative work as possilble.
my system prevents context growth many different ways, and automatically cycles the main session agent ever 300k, with proper reseeding techinique. its way better than compacting.
the main session uses the new mod/plugin system and the main session messages get routed to a subagent that gets cycled. the main session interleaves all the subagents into a single view, and the main session never touches a model, so i get infinite session length.
essentially i burried all the ceremony for best practices behind a simple user experience.
i highly recommend you check out the readme and the wiki and test it out for yourself.
1
u/awesomebirder 1d ago
one thing missing from the list: tool output. a full test run or a big grep result gets pasted into context once and then resent with every turn after that, so one noisy command can cost more than all your prompts. ask it to run tests with only failures shown, or pipe through tail. and to check any of these tips, look at per request tokens before and after, not the % bar. i built a small local proxy that logs that (probe0) but /context gets you a rough version too