agentdrift
agentdriftv0.1.0 · python, zero deps

Four files tell your agents what to do. Nobody updates all four.

So Cursor is told to use npm while Claude Code is told to use pnpm, and you find out when a PR shows a package-lock.json nobody asked for. agentdrift reads every agent instruction file in a repo and shows you exactly where they disagree.

CLAUDE.md

Use pnpm for all installs.

Run tests with pytest before every push.

Format Python with ruff.

≠
.cursorrules

Use npm for all installs.

Run tests with pytest before every push.

Prefer TypeScript in new files.

Both files are committed. Both are current. Neither author knew the other existed.

The check

agentdrift check

Exits 1 when it finds drift, so it drops straight into CI.

$ agentdrift check
Agent instruction files (4)
  .cursor/rules/api.mdc
  .cursorrules
  .github/copilot-instructions.md
  CLAUDE.md

Duplicated in 2+ files (2) safe to dedupe
  Never commit directly to main; open a PR.
    .github/copilot-instructions.md, CLAUDE.md
  Run the test suite with pytest before every push.
    .cursorrules, CLAUDE.md

Only in one file (8) other agents never see these
  .cursor/rules/api.mdc:4  All FastAPI routes must declare a response_model.
  .cursorrules:4           Prefer TypeScript over plain JavaScript in new files.
  CLAUDE.md:10             Keep functions under 40 lines.
  ... 5 more

Contradictions (2)
  .cursorrules:1  Use npm for all installs.
  CLAUDE.md:4     Use pnpm for all installs.

  .cursorrules:3  Format Python with black.
  CLAUDE.md:8     Format Python with ruff.

10 drift issue(s). Run `agentdrift sync --write`.
exit 1

Three kinds of rot

What it looks for

Code blocks, headings and frontmatter are ignored, so only real instructions get compared.

Duplicated

The same rule in two or more files

Harmless today, drift tomorrow. Someone edits one copy and now you have a contradiction instead.

One file only

A rule only one agent can see

Your FastAPI response_model rule lives in a Cursor .mdc. Claude Code has never read it, so it never follows it.

Contradiction

Same subject, opposite answer

npm vs pnpm vs yarn vs bun, black vs ruff, tabs vs spaces, rebase vs merge, pytest vs unittest. Flagged with file and line, never auto-resolved.

AGENTS.mdCLAUDE.mdGEMINI.md.cursorrules.cursor/rules/*.mdc.windsurfrules.clinerules.github/copilot-instructions.md

The fix

Collapse it into one AGENTS.md

Every rule kept, deduped, attributed back to where it came from. Contradictions land in a \"Needs a human decision\" section, because picking npm over pnpm is your call.

pip install -e .Python 3.10+. No dependencies.
agentdrift checkReport drift. Exit 1 if any.
agentdrift syncPreview the merged AGENTS.md. Dry run by default.
agentdrift sync --write --stubsWrite AGENTS.md, replace the others with pointers to it, keep a .bak of each.
.github/workflows/agents.yml
- run: pip install -e . && agentdrift check

Run it once after sync and it exits clean: the generated pointer files carry no rules to disagree about.