Codex doesn't load AGENTS.md in all the parent directories

Resolved 💬 3 comments Opened Mar 2, 2026 by amit-mittal Closed Mar 2, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

v0.107

What subscription do you have?

Enterprise

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Darwin

What terminal emulator and version are you using (if applicable)?

iTerm2

What issue are you seeing?

Repo structure:

- AGENTS.md
- java/AGENTS.md
- go/AGENTS.md

Now, if codex is invoked from the root of the repo, codex only loads the AGENTS.md present in the root of the repo even if it is working on code present in go folder.

I expect codex to merge both AGENTS.md without having me to invoke codex from go folder since the changes might be in different folders.

What steps can reproduce the bug?

As described above, you can ask it to do any change and it won't be loading AGENTS.md from the sub-folders in the plan mode.

Ran "Summarize the instructions." after the change is done and you won't find any context present in go/AGENTS.md being picked up.

What is the expected behavior?

Codex should automatically load AGENTS.md in all the parent directories while working on a sub-directory even if it was invoked from repo's root.

Additional information

_No response_

View original on GitHub ↗

3 Comments

etraut-openai contributor · 5 months ago

This is by design, so we don't consider it a bug.

For a description of how it's intended to work, refer to this documentation.

There is a feature request to dynamically load AGENTS.md during a task based on source files that are accessed. If you'd like to see that feature, please upvote.

amit-mittal · 5 months ago

Thanks, Eric! That's exactly what I am looking for.

Rednas83 · 4 months ago

For me it was fixed after switching agent environment from "Windows Subsystem for linux" to "Windows native"