[ ABORT TO HUD ]
SEQ. 1

Automatic Context Management

🗃️ Context Compaction15 min1500 BASE XP

Server-Side Context Compaction

Context Compaction (Beta, 2026) is a server-side feature that automatically summarizes older parts of a conversation as it approaches the context window limit. This effectively extends the usable context window to infinity for long-running agent sessions.

How It Works

  1. Monitoring: Anthropic's infrastructure monitors the conversation's token usage in real-time.
  2. Triggering: When usage exceeds ~80% of the context window, compaction is triggered.
  3. Summarization: Older messages are replaced with a dense, LLM-generated summary that preserves key decisions, facts, and action items.
  4. Continuation: The conversation continues seamlessly with the compacted context + recent messages.

Developer vs Server Compaction

ApproachWho ManagesToken VisibilityBest For
Manual (client-side)Your codeFull control over summary qualityProduction agents needing deterministic summaries
Automatic (server-side)AnthropicTransparent — handled in backgroundRapid prototyping, long chat sessions, Managed Agents
🚧 Important: Server-side compaction is lossy by nature. For applications where every detail matters (legal, medical), implement your own compaction logic with explicit preservation rules rather than relying on automatic summarization.
SYNAPSE VERIFICATION
QUERY 1 // 2
What triggers automatic context compaction?
Every 10 messages
When token usage exceeds ~80% of the context window
Every 5 minutes
When the user types 'compact'
Watch: 139x Rust Speedup
Automatic Context Management | Context Compaction — Claude Academy