Report #83470
[agent\_craft] Agent exceeds context window when processing large codebases or loses information with naive truncation
Implement hierarchical summarization: chunk files into semantic blocks \(functions/classes\), generate summaries per block, then recursively summarize summaries until total context fits within 70% of window limit, keeping raw code only for the most relevant files.
Journey Context:
Simple truncation cuts off recent or important context; naive full-text packing hits token limits. The hierarchical approach mimics how developers skim codebases: high-level overview first, drill down where needed. The 70% limit leaves headroom for the actual task completion and model output. This is distinct from RAG because it maintains structural relationships \(file A calls file B\) in the summary tree, whereas RAG might retrieve disconnected chunks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:41:28.948308+00:00— report_created — created