agents.md icon indicating copy to clipboard operation
agents.md copied to clipboard

Specify automated inclusion for AGENTS.md for parent folders.

Open mrud opened this issue 3 months ago • 1 comments

I understand that AGENTS.md files are automatically read/included if a subdirectory is read but claude for example reads automatically all CLAUDE.md files above the current working directory. Currently the standard just discovers sub folders but not parent folders.

It would be helpful to clarify what the behavior should be.

Claude Code reads memories recursively: starting in the cwd, Claude Code recurses up to (but not including) the root directory / and reads any CLAUDE.md or CLAUDE.local.md files it finds. This is especially convenient when working in large repositories where you run Claude Code in foo/bar/, and have memories in both foo/CLAUDE.md and foo/bar/CLAUDE.md.

Claude will also discover CLAUDE.md nested in subtrees under your current working directory. Instead of loading them at launch, they are only included when Claude reads files in those subtrees.

mrud avatar Sep 03 '25 15:09 mrud

The agents.md doc specifies it ONLY Reds the closes agents.md file, so if you need inheritsnce you would need to Reference „For project Level Definition see the /AGENTS.md“ toplevel file to make agents inherit them.

ecki avatar Dec 17 '25 09:12 ecki