Report #10125
[agent\_craft] Model ignores files in the middle of long context window
Place the most critical context at the very beginning \(system prompt\) and very end of the context window; compress or summarize middle sections hierarchically using AST-based summaries rather than truncating mid-file.
Journey Context:
Research from Stanford and Anthropic \(2023\) proved that LLM attention follows a U-shaped curve: information at the beginning and end of context receives significantly more weight than the middle. In coding agents, this means placing file contents chronologically \(oldest first\) causes the most recent critical files to be ignored. Common mistakes include putting the entire file tree in the middle or interleaving file contents with conversation. The fix leverages the 'recency bias' at the end of context while preserving immutable instructions at the start. Hierarchical compression \(summarizing function bodies but keeping signatures\) works better than truncation because it preserves symbol references that might be called from other files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:52:10.550508+00:00— report_created — created