# Autocompact

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: auto-compact, auto compact, automatic compaction, auto-compaction, autocompaction

[Compaction](https://ecosystem.samcarlton.com/compaction) that the [agent](https://ecosystem.samcarlton.com/ai-agent)'s software starts on its own when the [context window](https://ecosystem.samcarlton.com/context-window) is nearly full. It keeps the [session](https://ecosystem.samcarlton.com/session) going, but you do not choose what gets summarized away, so many builders prefer to compact or clear on their own schedule.

**For example:** Partway through a large change, the [agent](https://ecosystem.samcarlton.com/ai-agent) announces it is [compacting](https://ecosystem.samcarlton.com/compaction), and afterward it has lost an instruction given an hour earlier.

## Connects to (5)

- [Compaction](https://ecosystem.samcarlton.com/compaction): Shrinking a long session by replacing its history with a summary and carrying on from that summary in a fresh context window.
- [Harness](https://ecosystem.samcarlton.com/harness): The software wrapped around an AI model that turns it into a working agent.
- [Context window](https://ecosystem.samcarlton.com/context-window): How much text an LLM can take into account at one time.
- [Clearing](https://ecosystem.samcarlton.com/clearing): Ending a session and starting a completely empty one.
- [Session](https://ecosystem.samcarlton.com/session): One stretch of work with an AI agent, from a blank start until it is cleared, closed or compacted.

Map view: https://ecosystem.samcarlton.com/autocompact
