Codex fails to discover and report inherited AGENTS.md instructions from parent directories

Open
#37,091 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start with the uploaded reproduction thread 019fd1e8-7007-7092-8f59-7dae8f3655a6 and trace the Codex CLI's AGENTS.md discovery behavior for a working directory and its parent directories. Verify the applicable ancestry files are loaded and accurately reported, including both repository-root and parent-directory instructions.

Written by the indexing model from the issue text.

Description

bug CLI config
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

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.