# Compaction

> Compressing earlier context into a shorter summary so an agent can continue without exceeding its context window.

- Category: Context & Memory
- Stage: Rising
- Also called: Context compaction, Conversation summary
- Canonical: https://www.joelcsaji.com/ai-dictionary/compaction

## Plain English

When the model's workspace fills up, compaction turns the messy history into a smaller handoff note.

## Example

A coding agent summarizes completed files, open bugs, failed attempts, and next steps before a new session starts.

## Why it matters

Poor compaction loses details; good compaction keeps long tasks alive.

## Related

- [Context Window](https://www.joelcsaji.com/ai-dictionary/context-window)
- [Long-Running Agent](https://www.joelcsaji.com/ai-dictionary/long-running-agent)
- [Checkpoint](https://www.joelcsaji.com/ai-dictionary/checkpoint)

## Sources

- [Anthropic: Effective Harnesses](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
