You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Auto-selection of nested AGENTS.md based on file/directory context #7576
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I’ve been working in a monorepo and noticed that the agent often misses the specific instructions we have in subdirectories because it mostly sticks to the root AGENTS.md file.
I’d love it if the agent could just "auto-pick" the nearest AGENTS.md file whenever it starts working in a specific part of the tree.
Specifically:
If the agent is reading or writing a file inside a subdirectory, the agent should automatically check for a local AGENTS.md in that folder (or the closest parent) and pull that context in.
If I mention a specific folder or path in my prompt, it should be smart enough to go grab the instructions for that area before it starts.
Right now, it’s a bit of a manual process to make sure the agent is following the right local rules for different parts of the repo. It would be much smoother if this happened automatically based on whatever files or folders I'm actually touching.
Just checked. This is supposed to be a part of the Agents.md spec as well.
4. Large monorepo? Use nested AGENTS.md files for subprojects
Place another AGENTS.md inside each package. Agents automatically read the nearest file in the directory tree, so the closest one takes precedence and every subproject can ship tailored instructions. For example, at time of writing the main OpenAI repo has 88 AGENTS.md files.
Activity
YourTechBud commentedon Jan 10, 2026
Just checked. This is supposed to be a part of the Agents.md spec as well.
github-actions commentedon Jan 10, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
YourTechBud commentedon Jan 10, 2026
Seems like #6316 already exists for this
feat(lint): add `--nested` — apply lint rules to every AGENTS.md in t…