Compaction is a technique used by agents built on large language models during long tasks. When the conversation and work history approach the limit of the context window, the earlier material is summarized or compressed so that only the essential state remains, and the compressed version becomes the starting point of a fresh context window.
It is used in long-running coding agent work to preserve earlier requirements and progress while reducing token usage. A known limitation is that details can be lost during compression.