Codex ignores contents of agents file, even after explicitly asking it to read it
Resolved 💬 2 comments Opened Sep 10, 2025 by dellis23 Closed Nov 10, 2025
What version of Codex is running?
codex-cli 0.30.0
Which model were you using?
gpt-5
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
Create an AGENTS.md file that contains the following instructions, among others:
Comment style (keep only high-signal comments)
- Do not add comments that merely restate what the code already conveys (e.g., “now inferred from POC team”, “no team_id accepted by design”, “form no longer has team context”).
- Do not leave migration notes, historical rationale, or references to removed code (“used to…”, “now…”, “by design…”). Prefer clear code and tests.
- Keep comments only for non-obvious constraints, invariants, or external requirements (protocol quirks, upstream bugs, security caveats) that are not evident from the code.
- Prefer expressive names and tests over explanatory comments.
Code hygiene
- Do not leave leftover comments referencing removed code or temporary notes. Remove obsolete blocks entirely to avoid confusion.
Explicitly ask codex to read the file on startup. Ask it to perform a task.
What is the expected behavior?
Not to leave comments referencing removed code.
What do you see instead?
Comments referencing removed code.
Example:
# foo (legacy upper code removed)
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗