Definitions

How computers for agents work, from the hardware to the sandbox.

Definitionsc

Compaction

Compaction is when an agent harness summarizes or trims an agent's history, so that it fits in the context window and the agent can keep working.

Compaction shrinks the history that an agent carries in its context. As an agent works, every message, tool call, and result is added to its context. When the context nears the limit of the model's context window, the harness compacts it. It replaces older parts with a shorter summary, or removes parts that are no longer needed.

A good compaction keeps what the agent needs to continue: the goal, decisions made, files changed, and open problems. It drops details such as long command outputs that have already been acted on. Some harnesses compact automatically at a threshold, and others let the user or the agent trigger it. Each compaction loses some information, so a task can suffer if an important detail is summarized away.

Agents that run for a long time compact many times. Keeping important state outside the context makes compaction safer. An agent working in a sandbox can write notes, plans, and results to files there. After a compaction, it can read those files back instead of relying on the summary alone.