Critical Position¶
Rule ID: content-critical-position
Detect critical instructions in the middle of files where LLM attention is lowest
| Severity | info (auto) |
| Autofix | llm |
| Since | v0.7.0 |
Configuration¶
| Parameter | Description | Default |
|---|---|---|
min-lines |
Minimum file length (in lines) before the rule activates | 50 |
Research Basis¶
Flags critical instructions buried in the middle of files where LLM attention is lowest.
The "lost in the middle" effect is one of the most replicated findings in LLM research. Liu et al. showed that LLM performance follows a U-shaped curve: information at the beginning and end of context is recalled reliably, while information in the middle is significantly degraded. This has been replicated across all tested model families.
The implication for instruction files is clear: if you mark something as IMPORTANT or CRITICAL, it should be at the top of the file — not buried between routine instructions at line 47.
References:
- Liu et al., Lost in the Middle: How Language Models Use Long Contexts (arXiv:2307.03172, TACL 2024) — The foundational U-shaped attention curve paper
- Serial Position Effects of Large Language Models (arXiv:2406.15981, Jun 2024) — Confirms primacy and recency biases analogous to human cognition
- Chroma Research, Context Rot: How Increasing Input Tokens Impacts LLM Performance (Jul 2025) — Tested 18 frontier models, confirms lost-in-the-middle across all of them