Lesson 941 of 2116
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.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1AGENTS.md Scope And Precedence In Codex
- 2Codex Sandboxes And Permission Modes
- 3Codex Sandboxes And Permission Modes
- 4Ask Codex For Findings, Not Praise
Concept cluster
Terms to connect while reading
Section 1
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.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Write AGENTS.md for a repo: commands, coding style, test policy, deploy policy, files never to touch, and how to handle dirty worktrees.- 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?
Key terms in this lesson
Section 2
Codex Sandboxes And Permission Modes
Section 3
Codex Sandboxes And Permission Modes
Codex is safest when the agent can read freely, edit deliberately, and ask before risky external actions.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Classify commands as safe, edit, network, destructive, or deploy. Decide which require explicit approval for your project.- 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?
Section 4
Ask Codex For Findings, Not Praise
Section 5
Ask Codex For Findings, Not Praise
A code review agent should lead with bugs, risks, missing tests, and exact files, not a friendly summary.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Review this PR. Return only findings ordered by severity. Include file, line, why it matters, and one test that would catch it.- 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?
Section 6
Handoff State Between Codex Sessions
Section 7
Handoff State Between Codex Sessions
Long projects need handoff files, logs, and final verification notes so the next agent does not restart from scratch.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Update HANDOFF.md with project purpose, last work done, current branch, verification commands, deploy URL, blockers, and next three steps.- 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 quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “AGENTS.md Scope And Precedence In Codex”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 40 min
Cursor Rules: Teach The Editor Your Repo
Cursor works better when repo rules explain architecture, commands, style, and boundaries before the agent edits.
Creators · 40 min
Lovable Starts With A Product Brief
Lovable works best when you describe the app like a product manager: user, job, screens, data, and constraints. Write the smallest useful scope the agent can finish.
Creators · 14 min
Comet And Browser Agent Safety
Browser agents can click, read, and sometimes act across tabs. Treat web pages as untrusted instructions until you approve the action.
