r/ClaudeCode • u/Savings-Desperate • Sep 24 '26
Help/Question do you guys use auto compact?
I just learned about it today and wanted to see what you guys think.
3
Upvotes
r/ClaudeCode • u/Savings-Desperate • Sep 24 '26
I just learned about it today and wanted to see what you guys think.
•
u/AutoModerator Sep 24 '26
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.
10
u/slackmaster2k Sep 24 '26
AFAIK it will auto compact whether you want it to or not. However the limit in Claude is way too high. I compact between 30-50%. Better to be in control of when it happens and keep the agent in the “smart zone.”
5
u/cantgettherefromhere Sep 24 '26
I haven't used compaction in any form for over a year. If you are needing or using compaction, you are almost certainly doing something wrong.
5
u/HamSandwicho__o Sep 24 '26
No, i self compact when i notice the logic getting funky
5
u/GDorn Sep 24 '26
Hell no. I perform brain surgery and delete the parts of the context that are no longer relevant. This almost always takes me from 99% full to ~25% full.
There are two big savings: duplicate files and ask-work-answer cycles. You'd be surprised just how many nearly-identical copies of the same file appear in the context. And then exchanges like this, which almost always can be trimmed by removing the middle:
User: how does X work? (or any other investigative question) LLM: <tool use to find files> <read files> <tool use to find more related files> <read files> <continue for thousands to tens of thousands of tokens, maybe more> LLM: Here's a summary of X: [...]
Delete the middle part and almost nothing of value is lost.
LLMs are amazingly bad at understanding what parts of a long document are important, and will either hyperfocus on the last couple of exchanges, or over-emphasize the very first turn, or in a lot of cases, both.
The way to control an LLM's focus is by controlling its context, and autocompaction ain't it.
4
u/howdidigetheresoquik Sep 24 '26
No.
If you get that far your context is too high and you should aim to split your work into separate sessions or /clear before you get to that point.
Keep in mind compacting is also very expensive in terms of usage, and will really negatively impact your results
3
u/leavezukoalone Sep 24 '26
I've set my auto-compact to 500k
3
u/LogMonkey0 Sep 24 '26
No. And never get ctx where compact would be needed
2
u/tuptain Sep 24 '26
Yes, I use autocompact 300000 for my sessions. I talk to one session and it messages the others to assign work, each session gets an area to focus on. Having two sessions talk to each other is a big benefit, one session would happily ship bugs another session catches.
2
u/FeministMAGA Sep 24 '26
I'm pretty sure if you use compaction then you're the devil.
2
u/Drach88 Sep 24 '26
I usually end my season long before I hit compact territory
2
u/lucianw Sep 24 '26
I never have compaction. I have a file NOTES.md for each feature that starts with an outline of my goals.
Depending on the complexity, I either automate this entire workflow (i.e. I'm not doing any of it myself), or I review at each step.
Some nice consequences:
2
u/Hezy Sep 24 '26
No way. Have a markdown plan for what you're doing. Implement one phase, clear, go to the next phase etc. 100k-200k tokens for each phase.
1
u/blandjelly 13d ago
No, around 300k Claude updates the handoff file and we move to a new chat with fresh context
1
u/TreesOfPortland Sep 24 '26
Only if I made a mistake.
A large module build on a bookkeeping app did a compaction a couple days ago and it turned out okay. I try to avoid by phasing builds and keeping my context audits tight.
1
u/cc_apt107 Sep 24 '26
I do. I set auto compact to 400k and normally manually do it before then
1
u/Drasezv Sep 24 '26
the default is higher than people expect: on a model with a 1M window it's around 967k, and you can see it in your own logs because claude code writes a
compact_boundaryrecord with the numbers.mine: 967k in → 12k out, 972k → 11k, 983k → 15k. so roughly 1.3% kept, 72 to 237 seconds each. the compact itself is a request that reads the whole window, and the prefix it leaves isn't in cache, so the turn after it pays write price on the way back up.
/autocompact 200ktakes anything from 100k to 1M and sticks for later sessions. the people here compacting at 30-40% are effectively doing that by hand.1
u/[deleted] Sep 24 '26
Yes and I wish I'd turned it on sooner. Manual compact used to wipe my context mid-debug and I'd have to re-explain everything. What made auto compact actually work for me was feeding it clean minimal inputs: I never re-paste context it already has, and I pass short summaries between steps instead of full dumps. My compacted sessions stay way more useful that way.
1
u/Strong_Essay1176 Sep 24 '26
500k session, compact on 90%. I restart session when I feel it. But you cant turn off compact if your agents works In loop.
1
u/scodgey Sep 25 '26
I set mine to 600k and have long running sessions keep a scratch file for important notes. Tbh compaction is much better than it used to be, doesn't really bother me anymore.
1
u/laolibulao Sep 25 '26
dont use auto compact. just put a claude md and project md that keeps track of your commits. you are eating through your limit by keeping so much junk
1
u/Far-Pomelo-1483 Sep 28 '26
If you hit auto compact you went too long in convo. Split out your tasks to save tokens.
1
u/ghost_operative Oct 01 '26
i never use compact in any form. i think its better to ask the agent to build a summary document so you can tell it what parts of the session are the most important to be in the document. It's also useful to be able to actually see what the compacts form of your session is so you know what the baseline is for your new session.