Specification feature · interfaces

Nested AGENTS.md instructionsAGENTS.md convention

Apply nested AGENTS.md files with directory-sensitive precedence.

Terminology basis: AGENTS.md convention. AGENTS.md convention

Nested AGENTS.md instructions: 2 supported, 4 partial, 0 unsupported, 25 unreviewed across 31 cataloged products.

Markdown · JSON

Explore this familyMore in Persistent instructions3 capabilities

Current evidence by product

Can my agent use Nested AGENTS.md instructions?

Read across for the answer. 6 of 31 current product columns have reviewed evidence; unreviewed does not mean unsupported.

  • Supported2
  • Partial4
  • Unsupported0
  • Unknown25
  • Not applicable0

Web

9 products

Desktop

13 products

CLI

9 products

Unknown means no public evidence has been reviewed for that product and capability. It does not mean unsupported.

How statuses are assigned

Definition and scope

What this capability means

Apply nested AGENTS.md files with directory-sensitive precedence.

Support is recorded only when exact, dated evidence covers this behavior.

Traceable compatibility

Assertion ledger

Documentation evidence only. No runtime conformance test is implied.

Codex CLIcli · current
Supported
Target
current Codex AGENTS.md documentation · dated-documentation
Environment
local-default
Observed
2026-08-28

No additional condition is recorded for this statement.

Evidence
Cursordesktop · current
Supported
Target
current Cursor Rules documentation · dated-documentation
Environment
local-default
Observed
2026-08-28
  • host-roleclaim is scoped to Cursor Agent in the desktop workbench
Evidence
Copilot Chatdesktop · current
Partial
Target
current VS Code custom-instructions documentation · dated-documentation
Environment
preview-enabled
Observed
2026-08-28
  • feature-flagrequires chat.useNestedAgentsMdFiles
  • runtimeVS Code adds relative paths to chat context and lets the agent decide which instructions to use; deterministic nearest-file precedence is not documented
Evidence
Gemini CLIcli · current
Partial
Target
current Gemini CLI context-file documentation · dated-documentation
Environment
local-default
Observed
2026-08-28
  • runtimehierarchical and just-in-time discovery applies only after AGENTS.md is added to context.fileName; GEMINI.md is the default
Evidence
Copilot CLIcli · current
Partial
Target
current GitHub Copilot CLI custom-instructions documentation · dated-documentation
Environment
local-default
Observed
2026-08-28
  • runtimethe CLI documentation establishes directory-sensitive discovery but does not specify conflict precedence between nested AGENTS.md files
Evidence
Windsurfdesktop · current
Partial
Target
current Windsurf Rules documentation · dated-documentation
Environment
local-default
Observed
2026-08-28
  • runtimeroot AGENTS.md is always on and subdirectory files become automatic glob-scoped rules, but conflict precedence is not documented
Evidence
  1. 1. Evidence checked 2026-08-28: Codex walks from the project root to the working directory, concatenating AGENTS.md guidance root-to-leaf so nearer files override earlier guidance.
  2. 2. Evidence checked 2026-08-28: Cursor combines nested AGENTS.md files with parent instructions and gives more-specific directories precedence.
  3. 3. Evidence checked 2026-08-28: VS Code's nested AGENTS.md support is experimental and exposes discovered paths to the agent, which decides relevance rather than enforcing documented nearest-file precedence.
  4. 4. Evidence checked 2026-08-28: Gemini CLI provides hierarchical and just-in-time context discovery, but AGENTS.md requires configuring context.fileName.
  5. 5. Evidence checked 2026-08-28: Copilot CLI discovers AGENTS.md in intermediate directories and directories nested in the path of a file it is working on, but the reviewed CLI page does not define conflict precedence.
  6. 6. Evidence checked 2026-08-28: Windsurf converts subdirectory AGENTS.md files into directory-scoped automatic rules, but the reviewed page does not define conflict precedence between nested files.