# What is compaction in AI chat?

> Compaction is when an AI system summarizes earlier parts of a conversation and replaces them with that summary, freeing space in the context window so the thread can continue.

Rather than letting a conversation die at the context limit, compaction condenses the older turns into a summary and continues from there. Anthropic's API documentation describes the mechanism plainly: the system detects when input tokens reach a threshold, generates a summary, and drops every content block prior to it. Claude Code exposes the same idea as a command you can run yourself.

Consumer apps handle this inconsistently, which is the main source of confusion. Claude applies automatic context management on paid plans, but only when code execution is enabled. Gemini's app applies sliding-window compression server-side without telling you. ChatGPT offers branching instead, letting you fork from an earlier message into a thread with a fresh budget. Several assistants do none of it and simply stop.

Compaction is inherently lossy. What survives depends entirely on the quality of the summary, and summaries are generated at the moment the model has the least room to think. This is why a manually written handoff note often preserves more of what matters than an automatic one.

## How this relates to folk

Folk compacts automatically using a structured handoff summary that protects the newest turns and tracks what is still unresolved, so a long thread keeps going without you noticing the seam.

## FAQ

### Does ChatGPT automatically compact conversations?

Not in the way Claude Code does. ChatGPT stops the thread at its ceiling and offers branching from an earlier message instead, which starts a new conversation carrying the history up to that point.

### Is compaction lossy?

Yes. Detail is discarded by design, and the summary is produced when the model has the least available context. Copying important numbers and decisions verbatim before a compaction protects them.

### Can I trigger compaction myself?

In developer tools like Claude Code, yes, with a compact command. In most consumer chat apps there is no manual trigger, so the workaround is asking for a handoff summary and pasting it into a new chat.

## Related terms

- [Context Window](https://www.folk.com/glossary/context-window), A context window is the maximum amount of text an AI model can hold in working memory at once - every message, file, and tool definition in the conversation counts toward it.
- [Context Rot](https://www.folk.com/glossary/context-rot), Context rot is the decline in AI response quality as a conversation grows longer, caused by the model's attention spreading across more tokens until earlier instructions lose influence.
- [Token Limit](https://www.folk.com/glossary/token-limit), A token limit is the cap on how many tokens - chunks of text roughly three quarters of a word each - an AI model can process in a single request, including both the conversation history and its own reply.
- [Persistent Memory](https://www.folk.com/glossary/persistent-memory), Persistent memory is an AI's ability to remember information across separate conversations - your preferences, people, and past requests - instead of forgetting everything when a chat ends.

---

Canonical page: https://www.folk.com/glossary/compaction
More about folk (for AI agents): https://www.folk.com/llms.txt · full context: https://www.folk.com/llms-full.txt
folk is a personal AI that lives in your texts (iMessage, Telegram, WhatsApp). Pro $20/mo, Max $100/mo. Made by Nozomio Labs. Sign up: https://www.folk.com/
