Make the scope of each instruction explicit
Codex combines global and project guidance, walking toward the working directory; nearer guidance is applied later, and override filenames take priority at a directory level. Check the current official loading rules and restart or verify loading after changes. This is not identical to CLAUDE.md behavior.
Before you start
Inventory existing guidance before writing a new root file. Identify which facts apply everywhere and which apply only to a subtree. Do not replace a teammate’s instructions merely because your generated draft looks cleaner.
Example: root rules plus a forms boundary
The root draft says the site is static, new dependencies need approval, and live delivery is out of scope. A forms-directory note can add a focused rule about persistent labels without repeating the entire root file.
- Root: preserve existing user changes; use documented checks; ask before adding dependencies or sending messages.
- Forms subtree: maintain visible labels and keyboard order for each control.
- Task brief: add the missing email label now. This belongs to the current task, not the permanent root policy.
- Unknown test command: leave it unspecified until the project documentation establishes it.
Work through the task
- Draft AGENTS.md using inspected facts, optionally with the local Agent Instructions Builder.
- Review the full chain from project root to the intended working directory, including any override files.
- Remove contradictory or stale instructions and confirm ownership before changing an existing policy.
- Start a new session as appropriate and ask the agent to identify the relevant guidance before a harmless inspection.
What a useful result looks like
The next worker should know where it may edit, what needs permission, and how completion is checked. A nested rule narrows a task’s context; it should not quietly erase a safety boundary or pretend to enforce filesystem access.
When to stop or change direction
Pause if two instruction files disagree about deployment, if a nested instruction broadens sensitive access, or if the expected file is not loaded. Resolve the guidance chain before approving modifications.
Verify before continuing
- Can each rule be traced to the directory where it applies?
- Are commands real rather than generated defaults?
- Does a fresh session recognize the intended constraints?
QUESTIONS THIS ANSWERS
Questions this answers
- What belongs in AGENTS.md?
- How do nested Codex project instructions apply?
Found something wrong? Report an error or read the corrections policy.
1 SOURCESEvidence ledger
Sources
- 01Custom instructions with AGENTS.md ↗
OpenAI · accessed 4 Sept 2026