56 lines
2.1 KiB
Plaintext
56 lines
2.1 KiB
Plaintext
---
|
|
title: "Auto Compact"
|
|
sidebarTitle: "Auto Compact"
|
|
description: "Automatic context summarization to keep working when approaching context limits."
|
|
---
|
|
|
|
When your conversation approaches the model's context window limit, Cline automatically summarizes it to free up space and keep working.
|
|
|
|
<Frame>
|
|
<img
|
|
src="https://storage.googleapis.com/cline_public_images/docs/assets/condensing.png"
|
|
alt="Auto-compact condensing conversation context"
|
|
/>
|
|
</Frame>
|
|
|
|
## How It Works
|
|
|
|
Cline monitors token usage during your conversation. When you're getting close to the limit, it:
|
|
|
|
1. Creates a comprehensive summary of everything that's happened
|
|
2. Preserves all technical details, code changes, and decisions
|
|
3. Replaces the conversation history with the summary
|
|
4. Continues exactly where it left off
|
|
|
|
You'll see a summarization tool call when this happens, showing the cost like any other API call.
|
|
|
|
## Why This Matters
|
|
|
|
Previously, Cline would truncate older messages when hitting context limits, losing important context.
|
|
|
|
Now with summarization:
|
|
- All technical decisions and code patterns are preserved
|
|
- File changes and project context remain intact
|
|
- Cline remembers everything it's done
|
|
- You can work on much larger projects without interruption
|
|
|
|
<Tip>
|
|
Auto Compact works especially well for long-running tasks. Structured task lists can help maintain progress across summarizations so Cline can stay on track across multiple context windows.
|
|
</Tip>
|
|
|
|
## Cost Considerations
|
|
|
|
Summarization leverages your existing prompt cache from the conversation, so it costs about the same as any other tool call.
|
|
|
|
Since most input tokens are already cached, you're primarily paying for summary generation (output tokens), making it cost-effective.
|
|
|
|
<Note>
|
|
With other models, Cline falls back to standard rule-based context truncation, even if Auto Compact is enabled.
|
|
</Note>
|
|
|
|
## Restoring Context
|
|
|
|
You can use [checkpoints](/core-workflows/checkpoints) to restore your task state from before a summarization occurred. You never truly lose context since you can always roll back.
|
|
|
|
Editing a message before a summarization tool call works similarly, restoring the conversation to that point.
|