Report #68492
[agent\_craft] Agent misses critical context in large codebases due to naive file stuffing
Implement hierarchical context packing: inject file metadata \(path, imports, function signatures\) for all files, but include full content only for files under 50 lines or explicitly relevant chunks; use auto-generated summaries for large files.
Journey Context:
Naively stuffing full file contents hits context limits and triggers the 'Lost in the Middle' problem where information in the middle of long context is ignored by the model. Hierarchical packing exploits the fact that high-level structure \(imports, signatures\) provides most of the planning signal, while full content is only needed for implementation details. The 50-line threshold is a heuristic that balances detail against token budget, ensuring the model sees the 'shape' of the entire codebase without drowning in irrelevant implementation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:26:46.623788+00:00— report_created — created