Glossary / Prompting & Context

Compaction

The summary step that lets a long AI session keep going after context gets crowded.

Updated July 2, 2026

Compaction isn’t free memory. It’s compression: helpful, but lossy. A summary of a session is not the full session, so the work survives while some detail quietly disappears.

Think of a five-hour meeting. When you come back from a break, you don’t remember every sentence. You remember the important points, the decisions, and the next step. That’s enough to keep going, but some detail is gone. That’s compaction.

How it shows up

AI tools have a context window, the amount of material the model can hold at once. As a session grows, it carries more prompts, answers, file reads, tool outputs, and corrections, all counted in tokens. When the window gets crowded, the tool summarizes what happened and continues from the smaller version. The model may keep the goal but lose the exact wording of an instruction, or remember there was a bug but not the edge case behind it. That’s why important context shouldn’t live only in the chat. Put durable facts into files, notes, or project memory, and ask the agent for a handoff note before a big transition.

Why you care

When the stakes are high, treat compaction like meeting notes, not a perfect recording. Wrap up the phase, save the important state, and start the next session with a clear brief. The work can keep moving after compaction. It just may not carry every detail with it.