Skip to content

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):

**CRITICAL**: Never push directly to main.

Good (same instruction, first section of the file):

# Project rules

**CRITICAL**: Never push directly to main.

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:

rules:
  content-critical-position:
    min-lines: 100

Configuration

rules:
  content-critical-position:
    enabled: auto  # true | false | auto
    severity: warning
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:

Run skillsaw explain content-critical-position to see this documentation and the rule's effective configuration in your terminal.