Back to all rules / Drift between files

nested-contradiction

A subfolder instruction file says the opposite of the file above it.

note by default Drift between files Needs the whole project Inline suppression allowed

Source: Codex docs: AGENTS.md (learn.chatgpt.com), read 14 October 2026.

On GitHub: the rule doc and the tests.

Jump to another rule89

What it catches#

A subfolder instruction file says the opposite of the file above it.

A subfolder CLAUDE.md, AGENTS.md or GEMINI.md that says the opposite of the same kind of file in a folder above it ("use X" against "never use X"). The agent gets both when it works in the subfolder, the nested one last. That is often a deliberate exception, so this is a note, but a silent exception reads like a mistake to the agent and to the next person.

Why it matters#

The agent gets both files when it works in the subfolder, the nested one last. That is often an intended exception, so this is a note: say the exception out loud, or keep one rule.

Bad example#

AGENTS.md                - Use npm for installs
packages/web/AGENTS.md   - Never use npm for installs

Good example#

AGENTS.md                - Use npm for installs
packages/web/AGENTS.md   - This package is the exception: use pnpm here, not npm

How to fix#

If the exception is intended, say so in the subfolder file and name the rule it replaces. If it is not, keep one of the two.

Suppress or configure#

For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:

<!-- asitis-disable-next-line nested-contradiction -- why this one is fine -->

For a whole file:

<!-- asitis-disable-file nested-contradiction -- why this file is an exception -->

For every file, turn it off or change its severity in .asitisrc.json:

{ "rules": { "nested-contradiction": "off" } }

A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.

Source#

Codex docs: AGENTS.md, read on 14 October 2026.

See what an agent changed in your CLAUDE.md. Keep or revert each change.

The linter is free and needs no signup. I'm also building a desktop editor for the markdown your agents write and read. It shows what an agent changed since you last looked, lets you keep or revert each change, and never touches a line you didn't edit. No release date yet. One email to confirm, one when the paid beta opens, one when 1.0 ships. $29 once for a founding licence, with 24 months of updates.

Or add the linter to CI, no email needed.

Your address is stored with Cloudflare, which hosts this site. No IP address is kept. See the privacy policy.

Back to all rules

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.