Level 4 Practice: Persist Working Rules in AGENTS.md
About 5 minutes
About This Tutorial
Section titled “About This Tutorial”For the concepts and completion standards, first read Codex Levels 0-10.
Repeating the same rules in every prompt creates omissions and drift. Level 4 persists the stack, edit boundaries, checks, and prohibitions as repository instructions.
What You Will Complete
Section titled “What You Will Complete”You will produce AGENTS.md and scoped instructions. The goal is not the amount of work; it is a reproducible Level 4 delegation boundary and completion check.
Step 1: Set the Boundary
Section titled “Step 1: Set the Boundary”Before handing work to Codex, state the goal, scope, exclusions, and completion criteria. Adapt this prompt to your project.
Organize recurring working conditions in AGENTS.md. Avoid duplicating existing rules; provide concise links to detailed guidance, validation commands, and prohibited actions.Check: Continue only when Codex can restate the scope and unresolved questions before acting.
Step 2: Practice
Section titled “Step 2: Practice”- Document project context, read order, and primary commands in the root
AGENTS.md. - Add narrower
AGENTS.mdfiles only where a subdirectory needs scoped rules. - Start a fresh task and verify that Codex reports the applicable instructions.
Keep the scope stable and inspect the output or diff after each stage.
Step 3: Verify Completion
Section titled “Step 3: Verify Completion”You are done when a new task follows the same boundaries and checks without repeating a long setup prompt.
Record the actions performed, supporting evidence, and anything not verified. Also record why work stopped when a condition was not met.
Troubleshooting
Section titled “Troubleshooting”Codex exceeded the requested scope
Section titled “Codex exceeded the requested scope”Stop the task and inspect the diff. Add explicit owned files and exclusions to the prompt, then rerun only the approved scope.
Completion is difficult to judge
Section titled “Completion is difficult to judge”Replace vague criteria such as “implement it” with observable files, commands, pages, or review results.
Next Step
Section titled “Next Step”Continue to Level 5 to expand the delegation boundary by one step.
See the references for the external specifications and background sources used on this page.[1][2][3]