content-critical-position¶
Detect critical instructions in the middle of files where LLM attention is lowest
| Severity | warning (auto) |
| Autofix | - |
| Since | v0.7.0 |
| Category | Content Intelligence |
Why¶
LLM attention is strongest at the beginning and end of context and weakest in the middle (the "lost in the middle" effect, Liu et al. 2023). An instruction marked CRITICAL, IMPORTANT, or MUST that sits in the middle of a long file is the one most likely to be silently dropped — the emphasis signals it matters, but its position works against it.
This rule only activates on files with at least min-lines lines (default
50); short files do not exhibit a meaningful middle. An emphasized
instruction is flagged when it falls between the first 20% and the last
20% of the file.
Examples¶
Bad (line 80 of a 160-line CLAUDE.md):
Good (same instruction, first section of the file):
How to fix¶
Move emphasized instructions into the first or last 20% of the file — typically a "Rules" or "Critical" section at the top. If everything is marked critical, nothing is: demote emphasis on lines that are merely informative.
Tuning¶
Raise min-lines if you maintain long files deliberately and only want
the rule to fire on very large ones:
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
Run skillsaw explain content-critical-position to see this documentation and the rule's effective configuration in your terminal.