Skip to content

content-critical-position

Deprecated

Deprecated since v0.18.0 and will be removed in a future release. This rule no longer runs under enabled: auto; set enabled: true explicitly to keep it during the transition.

Built on the lost-in-the-middle attention research: instructions in the middle 20–80% of a long file were assumed to be the most likely to be dropped. Models still show that attention dip, but it occurs across a long context window, not within a single skill or instruction file loaded on its own. Where a line sits inside one file says little about where it lands in the context, so moving CRITICAL lines to the edges of a file was not worth the churn.

Detect critical instructions in the middle of files where LLM attention is lowest

Severity info (deprecated)
Autofix -
Since v0.7.0
Category Deprecated

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: true  # true | false | auto
    severity: info
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.