Compact Early, On Your Terms
Auto-compaction fires when the window is nearly full — which is after quality already sagged, and the automatic summary guesses at what mattered. Compact earlier and by hand, or ask the agent to lower its auto-compact threshold, so the squeeze happens while the session is still sharp.
Why it works
Auto-compaction fires when the window is nearly full — which is AFTER quality already sagged, and its automatic summary guesses at what mattered. Compacting early and manually flips both: you choose the moment (a natural task boundary, while the session is still sharp) and you dictate what survives. The best version is making the squeeze rare at all: /clear at boundaries beats /compact mid-flight.
How to do it
- Glance at /context at natural boundaries — end of a feature, before a new direction.
- Don't ride past ~70–80%: compact while quality is still good, not after it visibly isn't.
- Always compact WITH instructions: name what the summary must keep.
- Prefer /clear whenever the task is genuinely done — free beats expensive-and-lossy.
- Ask the agent to lower its auto-compact threshold if you keep getting surprised by it.
- Standing insurance: the CLAUDE.md preserve-line (see the compaction-rules tip) works even when auto fires.
Copy this
/compact Keep: the list of files we changed, my stated requirements, and the decisions we agreed on. Everything else can compress.
What to watch for
- Compaction is itself an expensive call — the agent re-reads the whole conversation to write the summary. Scheduled preventive compacting of short sessions is pure waste.
- After any compaction, spot-check one detail you care about ('what format did I ask for?') — trust, then verify the summary kept it.
Sources