Summarizing history to make room
By Prof. Tom Yeh
Published: 2026-08-19
URL: https://www.byhand.ai/p/library-agents-context-compacting-the-window
Library › Context Problems
-
-
-
-
-
-
-
-
-
-
-
Compaction
-
-
-
-
-
-
-
-
-
Truncation throws the oldest turns away. Compaction keeps them, but small: the model reads the history and writes a summary that stands in for it. The system prompt is not part of the history and does not get compacted; it is pinned at the front and survives intact. So the window after a compaction is the same system prompt, followed by a summary a fraction of the size, and a great deal of space that was not there before.
Paid members: the worksheet and its printable PDF are below ↓