Checkpoint Before Compaction, Reinject the Richest Survivor After

Kills the post-compaction 're-read storm' on long agent sessions โ€” the agent wakes oriented instead of re-opening files and re-running tools it already paid for; magnitude is workload-dependent and grows with how often the session compacts Advanced 4 min read

When compaction drops the raw history, a long-running agent loses its file map, error state, and plan โ€” then pays full input-token freight to re-read everything to get its bearings. Snapshot compact state at graduated context-fill levels before compaction fires, and after it frees space reinject a dense digest of the richest checkpoint that fits, so the agent resumes oriented instead of amnesiac.

๐Ÿ”’ Pro tip ยท Advanced

Unlock this tip โ€” and 119 more

This is one of 120 advanced, fact-checked tactics reserved for Pro. Get the full 142-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.

Prefer to browse? The 22 Beginner tips are free forever.