Rules File Drift Check: Is Your AGENTS.md Lying to the Agent?
A prompt that checks CLAUDE.md, AGENTS.md, GEMINI.md, and Cursor rules against the real code and against each other, and flags stale or contradictory lines before your agent follows them.
Added
Audit the agent instruction files in this repo for drift. Do not edit anything until I approve. ## 1. Find every instruction file List every file an agent might load, with its path and line count: AGENTS.md, CLAUDE.md, CLAUDE.local.md, GEMINI.md, .cursorrules, .cursor/rules/*.mdc, .github/copilot-instructions.md, and any file they import (@path). Include ones in subfolders and parent folders. Note which files are symlinks or one-line pointers. ## 2. Check each claim against the code For every concrete claim (commands, folder names, frameworks, SDKs and versions, model names, env vars, APIs, test setup): - Verify it against package files, lockfiles, config, and the actual source. - Run each build, test, and lint command listed, and record whether it works. - Mark each claim: CORRECT, STALE (was true, code moved on), WRONG (never true or names something that doesn't exist), or UNVERIFIABLE. ## 3. Check the files against each other Find lines that disagree between files (for example CLAUDE.md says one model or SDK and AGENTS.md says another), and rules that exist in one file but are missing from another agent's file. ## 4. Report A table: file, line, claim, status, evidence (file or command output), suggested fix. Then: - The 5 most harmful problems, the ones most likely to make an agent write wrong code. - A plan to end up with one source of truth: AGENTS.md holds the rules, CLAUDE.md is just `@AGENTS.md`, other tools get pointer files. - A one-line freshness rule to add to AGENTS.md: "If these instructions conflict with the code, trust the code, tell me, and propose a fix to this file."
How to use it
- Click Copy template.
- Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
- Replace the [BRACKETED] parts with your details.
FAQ
Do AI coding agents follow outdated CLAUDE.md or AGENTS.md files?
Yes. Agents treat these files as instructions and often follow them even when the code says otherwise, so a stale command, folder name, or SDK version leads straight to wrong code. Builders on X have shared studies showing agents follow stale rules files in most of their choices.
How do AGENTS.md and CLAUDE.md drift apart?
Teams that keep two separate files update one and forget the other. One repo shared on X told Claude one model and Codex a model name that doesn't exist. Keeping AGENTS.md as the single source and making CLAUDE.md a one-line @AGENTS.md import stops it.
How often should I run a drift check?
After big refactors, dependency or SDK upgrades, model changes, and whenever an agent keeps doing something your rules file seems to ask for. Running it monthly on an active repo is a good default.
How do I check what Claude Code actually loaded?
Inside Claude Code, the /memory and /context commands show which instruction files are loaded and how much context they use. If a file you expected isn't listed, it isn't reaching the model.
Get 3 new templates every week
Free. Unsubscribe anytime.Related templates
One Rules File for Claude Code, Codex, Cursor & Gemini
Audit Untrusted AGENTS.md, CLAUDE.md & SKILL.md Files
Lean CLAUDE.md: Trim a Bloated Rules File to 40 Lines
Generate AGENTS.md or CLAUDE.md From Your Repo
Browse all Coding & Cursor Rules templates