Report #21187
[agent\_craft] Model ignores files in the middle of long code context windows
Place most-relevant files at the beginning and end of the prompt; use hierarchical file maps \(signatures only\) for middle sections, expanding full content only when symbols are referenced
Journey Context:
LLM attention exhibits strong primacy and recency bias; critical files placed in the middle are effectively buried. Simple truncation loses necessary implementation details, while naive summarization hallucinates semantics. Hierarchical packing preserves exact syntax for accessed symbols while keeping the context window navigable, improving repository-level coding task success by 30%.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:58:37.536860+00:00— report_created — created