Harness Notes

Instructions

Updated 2026-11-22,

On this page

Instruction files are guidance you write once and every session reads, such as AGENTS.md, CLAUDE.md or Cursor rules. Notes a harness saves on its own are on the Memories page.

What gets loaded

QuestionCursor Agentchecked at 2026.10.12-d47ca18
Which files it reads

Project rules are .mdc files under .cursor/rules/ (subfolders allowed; plain .md files there are ignored). The CLI also reads AGENTS.md, CLAUDE.md and CLAUDE.local.md, the legacy .cursorrules file at the repo root, user rule files in ~/.cursor/rules/, plus User Rules and Team Rules stored on your Cursor account.

.cursorrules is deprecated; it is still loaded as an always-applied rule.

~/.claude/CLAUDE.md, .claude/rules/ and GEMINI.md are not read.

Where it looks, and when nested files load

At startup the CLI walks from the workspace directory up to the filesystem root, loading .cursor/rules/, AGENTS.md, CLAUDE.md and CLAUDE.local.md from each directory, so ~/.cursor/rules/ and ~/AGENTS.md apply when you work under your home folder. It also scans subdirectories at startup for nested .cursor/rules/, AGENTS.md and CLAUDE.md (skipping folders such as node_modules, dist and build); nested files apply when the agent works with files in that directory or below. .cursorrules is read only from the git repo root.

The docs describe CLAUDE.md and AGENTS.md at the project root and in subdirectories; the CLI's walk up through parent directories is wider than the editor docs suggest.

When several apply, which wins

All applicable rules are merged into the context; none replaces another. When guidance conflicts, Team Rules beat Project Rules, which beat User Rules, and a nested AGENTS.md takes precedence over the ones in its parent directories. Two rule files with the same name in different folders both apply.

Size limits

Partly

There is no hard size limit or truncation of rule bodies; Cursor recommends keeping each rule under 500 lines and splitting larger ones. A rule's description is cut at 1,536 characters.

Every always-applied rule, AGENTS.md and CLAUDE.md uses context window on every request, so long files cost tokens.

Writing them

QuestionCursor Agentchecked at 2026.10.12-d47ca18
One file for several harnesses

Yes. The CLI reads AGENTS.md, CLAUDE.md and CLAUDE.local.md alongside .cursor/rules, so one AGENTS.md or CLAUDE.md can serve Cursor, Codex, Claude Code and others. CLAUDE.md is always applied, ignoring any alwaysApply frontmatter. The CLI reads CLAUDE.md and CLAUDE.local.md only while its third-party configuration support is on, which is the default; AGENTS.md is always read.

Claude Code's @path imports inside CLAUDE.md are not expanded; Cursor treats them as plain text.

Rules for some paths, or only on request

Yes. In a .mdc rule, alwaysApply: true applies it always; globs (comma-separated, e.g. src//*.tsx) attaches it when a matching file is in context; a description alone lets the agent pull it in when relevant; with none of these it applies only when you @-mention it (e.g. @my-rule). Team Rules can also carry glob patterns.

AGENTS.md and CLAUDE.md have no frontmatter scoping; use their directory placement instead.

Include other files

Not supported

No. Writing @file.ts in a rule only tells the agent where to look; it reads the file with its tools when needed and the contents are never inlined. Put anything that must always be in context directly in the rule body.

Add instructions from config or flags

Partly

There is no flag or environment variable that injects instruction text. You can load extra rules with --plugin-dir <path>, which loads a local plugin whose rules/ folder holds .mdc rules, or by installing plugins from a marketplace; --workspace <path> chooses which project's rules load.

Generate a starter file

cursor-agent generate-rule (alias rule) asks for a description, a scope (project .cursor/rules/ or user ~/.cursor/rules/) and a name, then writes a starter <name>.mdc. In a session, /rules has a "Create new rule" entry where you pick the rule type and globs, and the built-in /create-rule skill has the agent write the rule for you. There is no /init that generates an AGENTS.md.

Control

QuestionCursor Agentchecked at 2026.10.12-d47ca18
See what loaded, and apply edits

Partly

Run /rules in a session to browse, open and edit the .mdc files in the project's .cursor/rules/ and in ~/.cursor/rules/. It does not list AGENTS.md, CLAUDE.md or Team Rules, and there is no view of which rules were applied to a turn. Rule files are read when the CLI starts, so restart it to pick up edits; there is no reload command.

In the editor, Customize → Rules shows every rule and its status.

Turn them off or skip some

Partly

There is no flag to skip instruction files for a run. To exclude a file, list an AGENTS.md or CLAUDE.md path in .cursorignore, or change a .mdc rule to manual (remove alwaysApply, globs and description). Non-enforced Team Rules can be turned off under Customize → Rules.

Enforce instructions for an organisation

Yes, on Team and Enterprise plans. Admins create Team Rules in the dashboard and tick Enforce this rule so members cannot turn them off; enforced and enabled Team Rules apply to every repository, including CLI sessions. Admins can also mark a plugin that ships rules as Required so it cannot be uninstalled.

Non-enforced Team Rules can be switched off by each member in Customize.

Notes and sources

Cursor Agent, 7 sources
  • Enforced team rules cannot be disabled by users.
  • AGENTS.md is the plain-Markdown alternative to structured project rules.
Which files it reads, 3
Where it looks, and when nested files load, 3
When several apply, which wins, 2
Size limits, 1
One file for several harnesses, 3
Rules for some paths, or only on request, 2
Include other files, 1
Add instructions from config or flags, 3
Generate a starter file, 2
See what loaded, and apply edits, 1
Turn them off or skip some, 1
Enforce instructions for an organisation, 3