-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
What version of Codex is running?
codex-cli 0.77.0
What subscription do you have?
Enterprise
Which model were you using?
gpt-5.2-codex xhigh
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
Codex CLI fails to load the AGENTS.md from the global location (~/.codex/AGENTS.md) despite it being listed as a valid location here: https://developers.openai.com/codex/guides/agents-md
Codex CLI always fails to load it and I'm forced to spend time telling it where to find it in every new session. It always says:
Step 2 (explanation):
- I defaulted to searching only the workspace because I assumed the instruction file would be colocated with the repo and did not expand to the documented global locations unless prompted; that assumption was wrong given your setup.
- Each new session starts without memory of prior paths, so if I don’t immediately check the known global location, I repeat the same mistake.
Asking it how to prevent this in new session, it admits it can't
Step 2 (root cause):
- I defaulted to a repo-local search because I didn’t include the documented global location in my initial search order. That’s on me; your setup is valid.
Progress update:
- Step 2: completed.
Step 3 (durable fix for new sessions):
The only solution that does not depend on me “remembering” in each new session is to make the instructions discoverable from the repo itself. These are the reliable options:
- Create a symlink AGENTS.md in the repo root pointing to /Users//.codex/AGENTS.md (single source of truth, no duplication).
- Copy /Users//.codex/AGENTS.md into the repo root as AGENTS.md (works everywhere, but duplicates content).
- I can follow a strict search order that checks the global path first every session, but that still relies on me doing it correctly each time and does not enforce discovery at the repo level.
What steps can reproduce the bug?
- Add an
AGENTS.mdfile to~/.codex - Launch a new codex CLI instance some where (eg: ~/foo) that doesn't contain an
AGENTS.mdfile - Require it load
AGENTS.mdto process requests - Observe it failing to discover the file
What is the expected behavior?
It should load ~/.codex/AGENTS.md when there is no local AGENTS.md defined as it's a valid search location according to documentation.
Additional information
No response