Guide · Rules files

AGENTS.md, CLAUDE.md and Cursor rules: why rules files are not enforcement

Updated 15 Nov 2026 · 5 min read

Every serious AI-assisted codebase now has a rules file: AGENTS.md for most agents, CLAUDE.md for Claude Code, rules for Cursor. They help. But a rules file is a request. Nothing checks the agent actually followed it.

Which file does what

FileRead by
AGENTS.mdA shared convention read by Codex, GitHub Copilot, Windsurf, Gemini CLI and many other agents.
CLAUDE.mdClaude Code. It can import AGENTS.md (@AGENTS.md) so both share one rulebook.
Cursor rulesCursor's project rules.

Why agents drift from the rules

What a good rules file contains

  1. What the project is, in one paragraph.
  2. The current task and which files it may touch.
  3. The behaviours that must keep working, and the command that proves each.
  4. A short "never do" list: protected paths, no new dependencies without asking, never weaken a test.
  5. Recent decisions, so they aren't reopened.

Turn rules into checks

The fix is to keep the file generated from things that can be verified. Stet does this: it writes the Stet block of AGENTS.md (imported by CLAUDE.md) from the project charter, the current scope, the locked behaviours and the decision log, then verifies the outcome.

npx stet-cli init                     # creates the charter, AGENTS.md and CLAUDE.md
stet scope set "Add CSV export" --allow "src/export/**"
stet decide "Prices are integer cents" --why "float rounding bugs"
stet guard && stet check              # did the agent actually follow it?

Text you write outside the Stet block is kept. See the AGENTS.md guide for the full template.

Make your rules checkable

npx stet-cli init · AGENTS.md guide · Guardrails compared →