Codex reads project guidance files so the agent can follow local conventions. Scope and precedence decide which instruction wins.
40 min · Reviewed 2026
AGENTS.md Scope And Precedence In Codex
Codex reads project guidance files so the agent can follow local conventions. Scope and precedence decide which instruction wins.
Name the job before naming the tool.
Write the smallest useful scope the agent can finish.
Run the result as a user, not as a fan of the tool.
Inspect the diff, data access, and failure path before sharing.
Write AGENTS.md for a repo: commands, coding style, test policy, deploy policy, files never to touch, and how to handle dirty worktrees.Use this as the working prompt or checklist for the lesson.
What should the user be able to do when this is finished?
What data should the app or agent never expose?
What test proves the change works?
What rollback path exists if the output is wrong?
Codex Sandboxes And Permission Modes
Codex Sandboxes And Permission Modes
Codex is safest when the agent can read freely, edit deliberately, and ask before risky external actions.
Name the job before naming the tool.
Write the smallest useful scope the agent can finish.
Run the result as a user, not as a fan of the tool.
Inspect the diff, data access, and failure path before sharing.
Classify commands as safe, edit, network, destructive, or deploy. Decide which require explicit approval for your project.Use this as the working prompt or checklist for the lesson.
What should the user be able to do when this is finished?
What data should the app or agent never expose?
What test proves the change works?
What rollback path exists if the output is wrong?
Ask Codex For Findings, Not Praise
Ask Codex For Findings, Not Praise
A code review agent should lead with bugs, risks, missing tests, and exact files, not a friendly summary.
Name the job before naming the tool.
Write the smallest useful scope the agent can finish.
Run the result as a user, not as a fan of the tool.
Inspect the diff, data access, and failure path before sharing.
Review this PR. Return only findings ordered by severity. Include file, line, why it matters, and one test that would catch it.Use this as the working prompt or checklist for the lesson.
What should the user be able to do when this is finished?
What data should the app or agent never expose?
What test proves the change works?
What rollback path exists if the output is wrong?
Handoff State Between Codex Sessions
Handoff State Between Codex Sessions
Long projects need handoff files, logs, and final verification notes so the next agent does not restart from scratch.
Name the job before naming the tool.
Write the smallest useful scope the agent can finish.
Run the result as a user, not as a fan of the tool.
Inspect the diff, data access, and failure path before sharing.
Update HANDOFF.md with project purpose, last work done, current branch, verification commands, deploy URL, blockers, and next three steps.Use this as the working prompt or checklist for the lesson.
What should the user be able to do when this is finished?
What data should the app or agent never expose?
What test proves the change works?
What rollback path exists if the output is wrong?
End-of-lesson check
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-codex-agents-md-scope-creators
What is the primary function of an AGENTS.md file in a project using Codex?
It stores the project's API keys and authentication tokens for the agent to use
It provides project-specific instructions that Codex reads to follow local conventions
It compiles the code into executable binaries for distribution
It serves as the main documentation for end users learning the codebase
In agentic coding, what does the term 'scope' refer to?
The total number of lines of code in the project
The amount of computational resources available to the agent
The specific, bounded portion of work an agent is tasked to complete
The geographic location where the code will be deployed
When multiple instructions conflict in a Codex project, what determines which instruction takes precedence?
The number of times each instruction has been executed previously
The length of each instruction in characters
Precedence rules that establish which instruction wins based on hierarchy and specificity
The chronological order in which instructions were written
Which principle from the lesson emphasizes completing the smallest useful unit of work?
Run the result as a user, not as a fan of the tool
Inspect the diff, data access, and failure path before sharing
Name the job before naming the tool
Write the smallest useful scope the agent can finish
What does it mean to 'run the result as a user, not as a fan of the tool'?
Prefer using official tool documentation over community tutorials
Use the most advanced features of the agent regardless of user needs
Share the tool with as many people as possible to gain fans
Test the output from an end-user perspective rather than admiring the tool's capabilities
Which question helps determine what data an application should never expose?
What is the agent's favorite programming language?
What data should the app or agent never expose?
What is the current server time?
How many users have logged in today?
What defines a 'reversible' change in the context of agentic coding?
The code can be compiled without errors
The agent can run the same task twice
There exists a rollback path if the output is wrong
The output can be converted to a different file format
The lesson states that real skill in agentic coding involves transforming an AI demo into something that is:
Observable, reversible, and safe enough for another person to use
Fully automated without any human oversight
Faster, larger, and more complex than the original demo
Written in the newest programming language available
In Codex, what determines which guidance file's rules apply when multiple guidance files exist?
The longest file by line count
The file with the most recent modification date
Random selection by the agent
Precedence rules that establish which instruction wins
What is the recommended approach when defining tasks for Codex?
Name the job before naming the tool
Avoid naming tasks and rely on implicit understanding
Use only technical jargon in task descriptions
Name the tool first, then describe the job it should perform
What does 'observable' mean in the context of professional-grade agentic coding?
The agent runs on a visible public server
The code can be seen by anyone on the internet
The agent's actions and outputs can be monitored and verified
The project has a graphical user interface
Why is it important to inspect the failure path before sharing agent output?
To find syntax errors that prevent compilation
To make the code longer and more impressive
To understand what happens when things go wrong and ensure safety
To count the number of functions in the code
What question should be answered to determine if a change works correctly?
What is the agent's model version number?
What test proves the change works?
How many lines were added to the documentation?
What is the favorite color of the lead developer?
What question helps identify the rollback path if agent output is wrong?
What is the agent's response time?
What is the current temperature setting?
What rollback path exists if the output is wrong?
How many users have complained about bugs?
What question helps define what users should be able to do when a task is finished?
What should the user be able to do when this is finished?