AI CompendiumA public chart of the language
Home / Agents & Harness / Autocompact
Agents & Harness

Autocompact

Compaction that fires automatically as the window fills.

Definition

An automatic context-management step that triggers when usage crosses a threshold, summarising older content without the user asking.

Useful, but it happens at a moment of the system’s choosing, and it can summarise away something you still needed. Knowing the threshold lets you compact deliberately on your own terms instead.

Automatic compaction trades a hard failure for a soft one. Without it a long session simply stops when the window fills; with it, the session keeps going but on a lossier model of its own history. Both are worth instrumenting, and knowing which threshold you are running is a real operational detail.

How people use it
A long debugging session.
"Autocompact fired and lost the stack trace. Re-paste it, or raise the threshold and compact by hand."
Worked example

Noticing after the fact

Quality drops partway through a long task and nobody changed anything.

Check the transcript for the compaction marker. If the drop is right there, the problem is what the summariser discarded — usually a constraint or an identifier — rather than the model getting worse.

Sources
  • docsContext windows ↗Claude platform docs · 2026

    What actually consumes the window — input, tools, thinking and output — plus context rot and compaction. Authoritative for this product, not for models generally.

  • blogBuilding agents with the Claude Agent SDK ↗Anthropic · 2025

    States the agent loop plainly — gather context, take action, verify work, repeat — and shows subagents and compaction as context-isolation tools.

Related terms