protologue

Context Compaction

Also called compaction, conversation summarization, context summarization.

Context compaction is summarizing an agent's or conversation's history when it nears the context limit and continuing with the summary in place of the full history, so that long tasks can run beyond one context window.

Description

Good compaction keeps decisions, open problems, and key details while dropping redundant tool output. Overly aggressive summaries lose information the agent later needs. It is one of several long-horizon strategies in context engineering, alongside structured note-taking outside the context and delegating work to sub-agents with fresh contexts. Research on long-horizon agents reports that rules and constraints an agent follows while they are visible can be dropped from compaction summaries, after which the agent violates them, and that pinning such constraints outside the summarized history greatly reduces these violations.

Sources

  1. Anthropic (2025). Effective context engineering for AI agents.
  2. Chen et al. (2026). Governance Decay: How Context Compaction Silently Erases Safety Constraints in Long-Horizon LLM Agents.

Cite this entry

Protologue. (2026). Context Compaction. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0149). https://protologue.com/t/context-compaction/

BibTeX
@misc{protologue_context_compaction,
  title = {Context Compaction},
  author = {{Protologue}},
  year = {2026},
  howpublished = {Protologue: A Taxonomy of Prompting and LLM Techniques, v1.4.0},
  note = {Entry PTL-0149},
  url = {https://protologue.com/t/context-compaction/}
}

Markdown JSON