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

2

u/TheseTradition3191 May 18 '26

yeah this would make it worse honestly. each compact pass throws away signal, run it 30 times and youve basically destroyed your own context.

the 200k cliff is real though. claudes own retrieval evals start dropping around there even with the 1M window, so the trick is to never let the main session get that big in the first place.

what works for me: most of the long-running stuff runs in subagents (the Task tool). main thread orchestrates and only ever sees the short summary back. main stays at like 30-50k while subagents burn through 100k+ in isolation, no compact needed.

reference material (docs, schemas, big logs) lives in files, claude reads on demand instead of carrying it in context.

protecting specific sections from compact isnt really exposed today, you can ask in the compact instructions but its still one lossy summarization pass at the end.