# Conversation compaction

**Source:** https://promtable.com/glossary/compaction

> Conversation compaction summarises a long agent or chat history into a tight representation that preserves the relevant signal — used when the conversation approaches the model's context window.

---
Conversation compaction summarises a long agent or chat history into a tight representation that preserves the relevant signal — used when the conversation approaches the model's context window.

As agent loops and long chats grow, the history eventually approaches the context window. Compaction runs a summariser (typically a cheaper model) that rewrites the history as a structured summary — current goal, key facts learned, open subtasks, important decisions — and discards verbatim tool outputs once their information has been extracted. Production implementations: Claude Code's auto-compact, OpenAI Assistants thread summarisation, LangGraph state compaction nodes. The hard problem is what to keep vs drop; aggressive compaction loses signal, light compaction barely helps. Most teams in 2026 trigger compaction at 70-80% context fill.

## When to use

- Long agent loops (15+ steps).
- Multi-hour chat sessions.

## Common mistakes

- Compacting too aggressively — losing context the next step needed.
- Compacting too late — the model has already lost quality from context pressure.

## Related terms

- [context-distillation](https://promtable.com/glossary/context-distillation)
- [context-window](https://promtable.com/glossary/context-window)
- [agent-loop](https://promtable.com/glossary/agent-loop)
- [long-context-prompting](https://promtable.com/glossary/long-context-prompting)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/compaction
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/compaction".
Contact: info@vibecodingturkey.com.