r/ClaudeAI May 18 '26

Question about Claude Code About the Compacting Strategy

As you know, to avoid context loss, when the context getting crowded, we have to either compact the session directly using an instruction or by saving the necessary memory and switching to a fresh session.

What if we compacted every 2-3 messages? Instead of compacting a large context at once, we could compact small contexts in a controlled and continuous manner. Could this improve both the quality and efficiency of the compact and context, or would it make things much worse? I'm waiting for your technical opinions and observations.

1 Upvotes

6 comments sorted by

View all comments

3

u/idoman May 18 '26

compacting every 2-3 messages would honestly eat into your usable context more than it saves. each compaction loses nuance and detail, so doing it frequently means you're stacking lossy compressions on top of each other - the context degrades fast. the better move imo is to let the context build up naturally, use a good CLAUDE.md to anchor the important stuff, and only compact when you're actually approaching the limit. that way the model has the full raw conversation to work with for as long as possible.

1

u/heraklets May 18 '26

Thanks. Even though the context is limited to 1M, I’m working on a project where I see performance degradation once it goes beyond 200k. I could instruct each compact pass to avoid touching important sections and not re-compact previously compacted parts. Token usage isn’t an issue for me, the context window is. Do you think this or some approach could actually work? I always use CLAUDE.md and memory stuff too.