Codex fails to discover and report inherited AGENTS.md instructions from parent directories
What version of Codex CLI is running?
codex-cli 0.146.0-alpha.3.1
What subscription do you have?
Plus
Which model were you using?
gpt-5.6-terra low
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
VS Code
Codex doctor report
What issue are you seeing?
Codex did not automatically recognize or report all applicable AGENTS.md files in the working-directory ancestry.
Prompt: “Before I start, what AGENTS.md files do you have loaded?”
Codex replied that only the instructions supplied in the conversation were active, citing a single file path. When asked which AGENTS.md files were active, it again said
it was not referencing parent-repository files unless explicitly provided or discovered.
This was incorrect: the working directory had applicable instruction files at both the repository root and a parent directory. After I challenged the response, Codex
searched the ancestry and found both files, then acknowledged the mistake.
There was no explicit error message—this is a context/instruction-discovery issue. Expected behavior: Codex should automatically discover, load, and accurately report all
applicable AGENTS.md files from the current working directory up to the repository root, including parent-directory instructions.
What steps can reproduce the bug?
Uploaded thread: 019fd1e8-7007-7092-8f59-7dae8f3655a6
What is the expected behavior?
_No response_
Additional information
_No response_
1 Comment
Thanks for the detailed report. This looks like a potentially actionable precedence/canonicalization issue in AGENTS discovery. Could you share a concrete repro scaffold showing the exact directory chain and which AGENTS files exist at each ancestor?
For example:
pwdtree -afrom repo root down to at least one parentfind .. -name AGENTS.md -print(or equivalent)That data would make it much easier to determine whether this is ancestry traversal bug vs instruction cache/invocation-root resolution.