# Context compaction

**Answer:** What happens when an agent shrinks its context: standing instructions can be dropped, and some methods keep a residual memory or a separate constraint list.

This hub gathers practice notes and paper notes on context compaction and summarization. Use it when an agent has forgotten a rule after auto-compact, or when you want the library's record of a specific paper.

The practice note on side constraints already states a working habit: keep standing rules outside the summary and put them back verbatim after compaction. Author-reported figures stay on the paper notes; they are not reproduced here unless a note says they were.

Compaction is adjacent to memory, but it is not the same topic. Memory is what you store on purpose. Compaction is what you drop or rewrite when the window fills.

## Project notes

- [ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization](https://iinventedlight.com/library/notes/2509-13313-resum/) (`2509-13313-resum`) — ReSum is a context-summarization method for long-horizon search agents, presented as compatible with existing agents.
- [ACON: Optimizing Context Compression for Long-horizon LLM Agents](https://iinventedlight.com/library/notes/2510-00615-acon/) (`2510-00615-acon`) — Acon reduces peak token usage by 26-54% on AppWorld, OfficeBench, and Multi-objective QA, while improving task success over existing compression baselines, according to the authors.
- [Parallel Context Compaction for Long-Horizon LLM Agent Serving](https://iinventedlight.com/library/notes/2605-23296-parallel-context-compaction/) (`2605-23296-parallel-context-compaction`) — The authors say sequential compaction can reduce context by 90-99% in token count, with no guarantee of what is kept.
- [Lost in Context Compaction: When LLM Systems Drop Side Constraints](https://iinventedlight.com/library/notes/2608-11242-lost-in-context-compaction/) (`2608-11242-lost-in-context-compaction`)
- [CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents](https://iinventedlight.com/library/notes/2609-26779-cliffcompaction/) (`2609-26779-cliffcompaction`) — CliffCompaction is presented as an autocompaction method for coding agents that aims to cut cost under a bounded context.
- [AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents](https://iinventedlight.com/library/notes/2610-02163-autocompact/) (`2610-02163-autocompact`) — AutoCompact adds a compact() action the agent can call during a coding trajectory, rather than compacting only under window pressure.
- [REMORY: Learning Residual Memory for Context Compaction](https://iinventedlight.com/library/notes/2610-11287-remory/) (`2610-11287-remory`)
- [Evaluating Context Compaction on the Questions That Come Later](https://iinventedlight.com/library/notes/2610-27301-compaction-questions-that-come-later/) (`2610-27301-compaction-questions-that-come-later`) — The authors call the question available at compaction time known and later questions hidden.
- [SpecCompact: Accelerating LLM Agent Context Compaction with Slot-Parallel Semantic Speculative Verification](https://iinventedlight.com/library/notes/2611-06876-speccompact/) (`2611-06876-speccompact`) — SpecCompact fine-tunes a small drafter and generates structured summary slots in parallel, with target-model verification.
- [Context compaction and side constraints](https://iinventedlight.com/library/notes/ao-compaction/) (`ao-compaction`)
- [Gemini CLI compaction: /compress and compressionThreshold](https://iinventedlight.com/library/notes/ao-compaction-gemini-cli-compress/) (`ao-compaction-gemini-cli-compress`) — compressionThreshold sets the trigger fraction.
- [Beyond one summary: residual memory and parallel compaction](https://iinventedlight.com/library/notes/ao-compaction-memory-and-parallel/) (`ao-compaction-memory-and-parallel`) — A summary alone may not support every decision.
- [Context compaction can silently drop user constraints](https://iinventedlight.com/library/notes/ao-compaction-side-constraints/) (`ao-compaction-side-constraints`) — Compactors retained only 17% of injected side constraints on average.
- [Summarize and resume: long-horizon agents without bigger windows](https://iinventedlight.com/library/notes/ao-compaction-summarize-and-resume/) (`ao-compaction-summarize-and-resume`) — ReSum periodically condenses interaction histories.
- [When should a coding agent compact its context?](https://iinventedlight.com/library/notes/ao-compaction-when-to-compact/) (`ao-compaction-when-to-compact`) — Earlier exploration becomes stale as a coding task progresses.
## Main claims on these notes

- [2509-13313-resum](https://iinventedlight.com/library/notes/2509-13313-resum/): ReSum is a context-summarization method for long-horizon search agents, presented as compatible with existing agents.
- [2510-00615-acon](https://iinventedlight.com/library/notes/2510-00615-acon/): Acon reduces peak token usage by 26-54% on AppWorld, OfficeBench, and Multi-objective QA, while improving task success over existing compression baselines, according to the authors.
- [2605-23296-parallel-context-compaction](https://iinventedlight.com/library/notes/2605-23296-parallel-context-compaction/): The authors say sequential compaction can reduce context by 90-99% in token count, with no guarantee of what is kept.
- [2609-26779-cliffcompaction](https://iinventedlight.com/library/notes/2609-26779-cliffcompaction/): CliffCompaction is presented as an autocompaction method for coding agents that aims to cut cost under a bounded context.
- [2610-02163-autocompact](https://iinventedlight.com/library/notes/2610-02163-autocompact/): AutoCompact adds a compact() action the agent can call during a coding trajectory, rather than compacting only under window pressure.
- [2610-27301-compaction-questions-that-come-later](https://iinventedlight.com/library/notes/2610-27301-compaction-questions-that-come-later/): The authors call the question available at compaction time known and later questions hidden.
- [2611-06876-speccompact](https://iinventedlight.com/library/notes/2611-06876-speccompact/): SpecCompact fine-tunes a small drafter and generates structured summary slots in parallel, with target-model verification.
- [ao-compaction-gemini-cli-compress](https://iinventedlight.com/library/notes/ao-compaction-gemini-cli-compress/): compressionThreshold sets the trigger fraction.
## Atlas topics grouped here

- ao compaction
- 2610 02163 autocompact
- 2611 06876 speccompact

## Related hubs

- [Agent memory](/library/topics/agent-memory/)
- [React](/library/topics/react/)
## What links here

- [LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models](https://iinventedlight.com/library/notes/2310-05736-llmlingua/) (`2310-05736-llmlingua`)

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
