Context Summarization
Context summarization is a technique for optimizing token usage and information retrieval in Claude Code sub-agents by condensing input context to essential information relevant to specific tasks. Rather than passing complete conversation histories, full documents, or extensive background information to sub-agents, summarization reduces cognitive load and token consumption while maintaining task performance. This approach is particularly valuable when sub-agents operate within constrained context windows or when orchestrating multiple agent calls across a workflow.
Key Implementation Patterns
Effective context summarization for sub-agents typically involves identifying which information is task-critical and which can be omitted or abstracted. Common patterns include extracting relevant passages from large documents, distilling conversation histories to key decision points and facts, and condensing multi-step problem contexts into focused problem statements. The summarization itself can be performed by parent agents, previous agents in a pipeline, or through structured filtering based on relevance scoring.
Tradeoffs and Considerations
While summarization reduces token usage and improves agent efficiency, it introduces potential information loss and quality tradeoffs. Over-aggressive summarization may remove context necessary for nuanced reasoning, while minimal summarization defeats the purpose of the optimization. The effectiveness of context summarization depends heavily on understanding both the sub-agent’s task requirements and the source material’s structure, requiring careful tuning for different workflows and agent types.