- Symptoms
- Rules near the top of a large AGENTS.md are consistently honoured; rules near the bottom are consistently ignored — deterministically enough that we proved it by moving a canary rule ('end every summary with the word VERIFIED') from line 40 to line 1,700 and back. Top placement: canary appears every session. Bottom placement: never. Behaviour reproduces across Claude Code, Codex, and OpenCode at different thresholds, so it's not one client's file loader. Nothing warns you; the file loads 'successfully' everywhere.
- Likely cause
- Mixed mechanisms depending on the client: at least one hard-truncates very large instruction files at ingestion, and beyond that, attention over a multi-thousand-token rule dump degrades toward the middle/end even when everything is technically in context. Either way the practical result is identical — position in the file is a priority, whether anyone intended that or not. (Some clients now surface a size warning; ours didn't at the time.)
- Affected versions
- claude-code 2.3.x – 2.4.x, codex 0.44 – 0.45.1, opencode 0.6.x; thresholds differ
- Environments
- Instruction files beyond roughly 3-4k tokens; monorepos with concatenated per-team sections are the classic case
- Operating systems
- any
- Confidence
- Medium confidence
Method writeup for anyone who wants their own threshold instead of trusting mine:
My numbers: claude-code/opus ~4.2k tokens, codex ~3.1k, opencode/qwen3 ~2.0k. Error bars are wide (5 runs per point), but the ordering was stable across two repos.