Compaction
A technical mechanism in AI dialogue tools whereby, when the input token count approaches the context window limit, the model is automatically invoked to generate a summary of the historical conversation in place of the original content, thereby freeing up context space.
Timeline (last 90 days)
Compression and prediction are mathematically equivalent: any compressor can be used for prediction, and any predictor can be converted into a compressor via arithmetic coding.
Compaction has Claude generate a summary of earlier turns, can be triggered on ordinary requests by setting a token threshold, with a default of 150,000 input tokens and a minimum of 50,000, and after setting pause_after_compaction to true it can pause to re-insert recent turns.
Compression has two layers of cost: the summary may omit or distort key constraints, and the summary itself requires a model call and counts toward costs.
For context distraction, the fix is compression: when the history becomes especially long, first summarize it into a summary, then discard the full log.
For teams building similar AI coding tools, it is worth regularly reviewing the data transmission pipeline to look for opportunities for compression and batching.
All Facts (5)
Compression and prediction are mathematically equivalent: any compressor can be used for prediction, and any predictor can be converted into a compressor via arithmetic coding.
50%UnverifiedCompaction has Claude generate a summary of earlier turns, can be triggered on ordinary requests by setting a token threshold, with a default of 150,000 input tokens and a minimum of 50,000, and after setting pause_after_compaction to true it can pause to re-insert recent turns.
50%UnverifiedCompression has two layers of cost: the summary may omit or distort key constraints, and the summary itself requires a model call and counts toward costs.
50%UnverifiedFor context distraction, the fix is compression: when the history becomes especially long, first summarize it into a summary, then discard the full log.
50%UnverifiedFor teams building similar AI coding tools, it is worth regularly reviewing the data transmission pipeline to look for opportunities for compression and batching.
50%