Economic concept

Context compaction

Condensing earlier conversation or working material so a model can continue with a smaller retained context.

Definition checked Oct 11, 2026.

Save concept

What it means

Context compaction condenses a long conversation into a shorter record that the model can use to continue. Instead of carrying every earlier message and tool output forward, the system preserves the task, important facts, decisions and unfinished work in a summary. This frees working space for subsequent steps when the conversation is approaching the context-window limit.

How it works

The system creates a summary and replaces some earlier context with it, sometimes retaining recent messages or links to files. Choosing what to keep matters: a shorter record can omit a constraint or the reasoning behind a decision. Durable notes and retrievable original material can complement the summary. Summarization itself also requires processing, so compaction is not automatically free or instantaneous.

A hypothetical example

Suppose an assistant has 30,000 tokens of conversation about preparing a budget. A 3,000-token summary preserves the approved J$2 million ceiling, the chosen supplier, pending quotations and the next calculation. That removes 27,000 tokens from the carried-forward history. If the summary omits the instruction that delivery must occur before July, the assistant may propose an unsuitable purchase despite retaining the headline budget. The example illustrates both the space saving and the loss risk.

What to distinguish

Compaction differs from prompt . reuses processing for matching content; compaction changes which content remains in the active context. It also differs from enlarging the . A good summary enables continuity but is not a complete archive or an assurance of accuracy. Important commitments should be checked against durable records, particularly when a later decision depends on a detail the summary may have compressed away.

Sources

In the news

Anthropic lowers small-model API prices with Haiku release