How to Answer
"Context management strategies:
- (1)Observation summarization — after each tool call, summarize the result to 2-3 sentences instead of keeping the full response.
- (2)Sliding window — keep the system prompt + first user message + last N messages. Drop middle turns.
- (3)Context compaction — Claude's Agent SDK does this automatically: when approaching the limit, it summarizes older turns while preserving key facts.
- (4)Hierarchical delegation — offload sub-tasks to sub-agents with their own context windows. The orchestrator only sees summaries.
- (5)External scratchpad — write intermediate results to a file/DB, reference by ID instead of keeping in context."