Skip to content
Day 69: new resources are added every day. See what's new

Free guide

How to Prompt OpenAI Codex

Write prompts and set up projects so OpenAI Codex makes focused, tested, reviewable changes

  • 11 bite-sized sections
  • 2 min read
  • Free, no signup

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.

Updated

Built with love by Shushant Lakhyani. Building bestproductivityresources.com

Inside this guide

Short cards you can read in order or jump straight to. Tap the link icon on any card to share just that part.

01

Know where Codex runs

Codex CLI
In your terminal, on your own machine
IDE extension
Inside code editors such as VS Code
Codex cloud
Runs tasks in the cloud and opens pull requests for you

The same prompting principles apply everywhere.

Codex does its best work with a clear task, a clear finish line, and solid project instructions.

02

Set up AGENTS.md

AGENTS.md is a file in your repository that explains to Codex how your project works. Codex reads it automatically. Cover:

  • How to install, build, and test
  • Code style and conventions
  • Folders to stay out of
  • How to check work before calling it done
03

Structure every task

Goal
What needs to change
Location
The files, folders, or features involved
Constraints
What to leave alone, and which libraries to use
Verification
Tests or commands that prove the change works
Output
A summary, pull request, or diff
04

Choose approvals and sandbox

  • Start in modes that ask before running commands or editing outside the project
  • Grant more autonomy only in projects you trust
  • Never hand it secrets it does not need

Mode names and options vary between versions. Check the current Codex settings.

05

Match reasoning effort to each task

  • Lower effort for small edits and quick questions
  • Higher effort for complex bugs and large refactors
06

Prompt for features

Add CSV export to the reports page. Reuse the table data in src/reports/data.ts, match the existing button styles, and add a test. Run the test suite, then summarize the changes.

07

Prompt for bug fixes

The cart total is wrong when a discount and tax apply together. First reproduce it with a failing test, then fix the calculation in src/cart/total.ts only. Run every cart test.

08

Prompt for tests and reviews

  • “Write tests for this module that cover edge cases. Leave the source unchanged.”
  • “Review this pull request for bugs, security problems, and missing tests.”
  • “Explain this function and list what could break if it changed.”
09

Run tasks in parallel

  • Hand several small, independent tasks to Codex cloud
  • Keep every task focused on one change
  • Review each pull request on its own
  • Skip parallel tasks that touch the same files
10

Review everything

  • Read the entire diff
  • Run the tests yourself
  • Look for changes outside the task
  • Ask Codex to explain any change you do not follow
11

Avoid common mistakes

  • Tasks that are too large or too vague
  • No tests or commands to verify the work
  • No AGENTS.md, so Codex has to guess your setup
  • Merging before reading the diff

The golden rule

Skip the big rewrite request. Give Codex 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.

Share this guide

Frequently asked questions

The quick answers, if you just need the gist.

What does “How to Prompt OpenAI Codex” cover?
It has 11 sections, starting with “Know where Codex runs”, “Set up AGENTS.md”, “Structure every 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.
When was this guide last updated?
It was last updated in October 2026.

Keep reading

More free guides you might like. Still no signup.

Free Notion database

1,100+ ways people are making money online

Real online businesses, creators and projects, broken down by how they make money: apps, online stores, AI tools and more. Free on Gumroad.

Get the free database

Free Notion database

399+ ways to make money online

Hundreds of online income methods in one place, so you can compare options and pick one to try. Free on Gumroad.

Get the free list

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.

Join the newsletter

You sign up on Gumroad, which stores your email to send the newsletter. See our Privacy Policy.