39
compaction
also context rot
When the window fills, the agent summarises the chat. Details die in the summary. Pin what must live.
What is compaction?
Compaction is automatic compression of old turns so the model can keep going. Context rot is the quality loss: names, constraints, and “do not do X” fall out of the summary.
Why does compaction matter when vibe coding?
A long vibe session feels continuous to you and is a new, lossy document to the model. The spec you stated at turn 3 may not exist at turn 40 unless it is in a file.
How do you do compaction?
Put standing rules in files, not in chat. After compaction, restating the slice is cheaper than assuming memory. Start a new thread sooner than you think.
How do you ask a model for compaction?
If context was compacted, reread (spec file) before editing. Chat history is not the spec.
What goes wrong with compaction?
Trusting “as we discussed earlier.” After compaction there is no earlier. There is a haiku of earlier.