Cursor rules vs AGENTS.md: what Cursor loads, and when
Cursor reads AGENTS.md and .cursor/rules. Which rules load depends on alwaysApply, globs and description. Here is how each rule type behaves and how to avoid duplicating AGENTS.md.
Updated 2026-10-27
Cursor reads two kinds of project instructions: AGENTS.md at the repository root (and nested AGENTS.md files in subdirectories), and project rules in .cursor/rules. The rules are where most surprises come from, because whether a rule loads depends entirely on its frontmatter.
The four rule types
| Frontmatter | Type | When it loads |
|---|---|---|
| alwaysApply: true | Always | In every session, like AGENTS.md. |
| globs: src/api/**/*.ts | Auto-attached | Only when a file matching the globs is in context. |
| description only | Agent-requested | Only the description is shown; the agent decides whether to read the rule. |
| none of the above | Manual | Only when you mention the rule with @. |
Taken from Cursor’s rules documentation as checked on 2026-10-03; see the Cursor page under Supported agents for the exact source. Team and user rules live in Cursor’s settings, not the repository.
Three mistakes that are easy to miss
- Globs that match nothing. A rule scoped to src/legacy/** keeps sitting in the repository after the folder is deleted, and never applies again.
- Restating AGENTS.md in an always-on rule. Cursor already loads the root AGENTS.md, so the same text ends up in context twice, in every session.
- Relying on .cursorrules. The legacy single file is no longer described in Cursor’s docs and may not load.
The pattern that works
- Shared, repository-wide instructions go in AGENTS.md, which Codex, Cursor and (through a one-line @AGENTS.md import) Claude Code all read.
- Cursor rules hold only what is genuinely path-specific, scoped with globs, or what the agent should pull in on request, with a clear description.
- Avoid alwaysApply rules unless the text truly applies to every task and is not already in AGENTS.md.
Check it
threadctx lists what Cursor loads at session start next to every other agent, flags globs that match no files and text duplicated between files loaded together, and shows exactly which rules attach for a given file.
npx threadctx scan
npx threadctx explain src/api/users.ts --tool cursor