Write prompts and set up projects so OpenAI Codex makes focused, tested, reviewable changes
Short answer
A free guide to prompting OpenAI Codex in 2026: where Codex runs, AGENTS.md project instructions, the structure of a good task, approval and sandbox modes, reasoning effort, prompts for features, bugs, tests, and reviews, running parallel tasks in the cloud, reviewing pull requests, and common mistakes.
Start with modes that ask before running commands or editing outside the project
Give more autonomy only in projects you trust
Never give it secrets it does not need
Mode names and options change between versions. Check Codex’s current settings.
05
Match reasoning effort to the task
Lower effort for small edits and questions
Higher effort for complex bugs and refactors
06
Feature prompts
Add CSV export to the reports page. Reuse the table data from src/reports/data.ts, follow the existing button styles, and add a test. Run the test suite and summarize the changes.
07
Bug fix prompts
The total in the cart is wrong when a discount and tax both apply. Reproduce it with a failing test first, then fix the calculation in src/cart/total.ts only. Run all cart tests.
08
Test and review prompts
“Write tests for this module covering edge cases. Do not change the source.”
“Review this pull request for bugs, security issues, and missing tests.”
“Explain this function and list what could break if it changes.”
09
Run tasks in parallel
Send several small, independent tasks to Codex cloud
Keep each task focused on one change
Review each pull request separately
Avoid parallel tasks that touch the same files
10
Review everything
Read the full diff
Run the tests yourself
Check for changes outside the task
Ask Codex to explain any change you do not understand
11
Common mistakes
Tasks that are too big or vague
No tests or commands to verify work
Missing AGENTS.md, so Codex guesses your setup
Merging without reading the diff
The golden rule
Do not ask Codex for a big rewrite. Give it small, verifiable tasks with clear instructions, then review every change.
AGENTS.md
Goal
Constraints
Verify
Approvals
Parallel
Review
Write an AGENTS.md for your project today with build, test, and style instructions.
It has 11 sections, starting with “Where Codex runs”, “Set up AGENTS.md”, “The structure of a good task” and “Choose approvals and sandbox”, plus 7 more sections.
How long does it take to read?
About 2 minutes. Every section is a short, self-contained card, so you can jump straight to the part you need.
Is this guide free?
Yes. The full guide is free to read on this page, with no sign-up.
For research and ideas only. Results vary and nothing here is a promise of income. See our Disclaimer.
Weekly newsletter
Everything new, every Monday.
One short email every Monday with everything shipped that week: new free tools and websites, new guides, new free browser tools and what's new in my free Gumroad libraries, plus how the site is growing. Free, and you can unsubscribe anytime.
You sign up on Gumroad, which stores your email to send the newsletter. See our Privacy Policy.
Cookies and your choices
This site works without tracking you and loads no analytics scripts. Essential storage is always on so pages load and work correctly. You decide whether your browsing preferences are saved on your device. Read the Privacy Policy.