Skip to main content

Buyer guide

Codex Workflow Playbook: From AGENTS.md to a Verified Merge

Brief Codex before work, size the model to the task, and check its diff before it reaches the main branch.

Reading time
3 min read
Sources
10 cited

The call

Give Codex an AGENTS.md with exact build and test commands and a task brief that names its acceptance check.

Run /review before pushing, and keep CI and a human approver on every Codex branch.

Codex returns work reviewers accept when the repository spells out how to build and test, and when each task has a check that proves it is done. Simon Willison's HTML5 parser port ran mostly unattended on that setup, and engineers who read every line still catch misses. This playbook covers the instructions to write before work, the local review during work, and the evidence to require before merge.

When you need this

  • Engineers use Codex every day, but the quality of what it returns depends on who asked.
  • Codex diffs reach pull requests without the test and lint runs your reviewers expect.
  • Plan limits run out mid-week because every task runs on the largest model at high reasoning effort.
  • Reviewers spend their comments explaining repository conventions when they should be reviewing logic.

Worked example: a port that ran mostly unattended

  1. The task

    Simon Willison ported the JustHTML HTML5 parser from Python to JavaScript with Codex CLI and GPT-5.2, on his ChatGPT Plus plan.

  2. What defined done

    An existing test suite, html5lib's tests, told Codex when the port worked, so the brief carried its acceptance check from the start.

  3. The result

    About four and a half mostly unattended hours produced roughly 9,000 lines that pass the html5lib tests, within the Plus plan's limits.

  4. The counterweight

    Wayne Joubert plans each change and reviews every line, and he still found missed cases in a Codex type-hint sweep. Keep the human review step even when tests pass.

Evaluation criteria

  1. Before work: write AGENTS.md

    Does Codex know the repository's build and test commands before it starts?

    Look forPut exact commands in the root AGENTS.md. Add nested AGENTS.md or AGENTS.override.md files for service-specific rules. Codex reads the global file in the Codex home, then files from the repository root to the working directory, up to 32 KiB combined by default. Run codex --ask-for-approval never "Summarize the current instructions." to check what loaded. Temporal's sdk-java AGENTS.md lists the module layout and format, test, and build commands. Its review checklist requires spotlessCheck and the full test suite.

  2. Before work: size the model to the task

    Is each task running on a model and reasoning effort sized for it?

    Look forOpenAI recommends GPT-6.1 Sol for complex coding and agentic work and Luna for focused, repeatable tasks. Start at the default reasoning effort and raise it only when a task needs deeper planning. On Plus and Business, OpenAI estimates 15 to 160 local messages per five hours on GPT-6.1 Sol and 350 to 3,000 on GPT-6 Luna. GPT-5.5 retired from Codex for ChatGPT sign-in on October 14, 2026, while API-key sessions keep it. Replace it in saved settings, custom agents, scheduled tasks, and scripts.

  3. Before work: state what done looks like

    Can the engineer name the files in scope and the check that proves the change?

    Look forWrite a short task brief that lists the files in scope and the acceptance check. An existing test suite is the strongest check, because Codex can run it without asking.

  4. During work: review the diff locally

    Who reads the change before it leaves the engineer's machine?

    Look forRun /review in the CLI before pushing the branch, and review the plan first for changes that span more than one service. Local reviews draw on general plan usage, and GitHub reviews count as Code Review usage. One Hacker News commenter caught a Codex refactor that had silently rewritten most of 40 link URLs only just before deployment.

  5. Before merge: verify the result

    Does a Codex pull request carry the same evidence a human change would?

    Look forRun CI on every Codex branch and require human approval. Add @codex review for another pass. On GitHub, Codex flags only P0 and P1 issues. OpenAI states that review rules guide Codex while tests, branch protections, and required approvals remain in force.

Questions to ask vendors

  1. Which models are enabled in our workspace today, and which retire in the next quarter?
  2. Where does each engineer see remaining limits before starting a long task? The CLI shows them with /status, and the usage dashboard shows reset times.
  3. Where our repositories already carry other agents' instruction files, do we point Codex at them with project_doc_fallback_filenames or write AGENTS.md?
  4. What evidence must a Codex-authored pull request include before a reviewer opens it?

Red flags

  • No AGENTS.md, or guidance past the 32 KiB default so later files are cut off.
  • Every task runs on the largest model at the highest reasoning effort.
  • Codex pull requests merge on a clean @codex review alone.
  • Formatting and lint checks written into review rules when CI should run them.

Products in this piece

Sources

Official documentation
6
Public source
4
  1. Codex docs: AGENTS.mdOfficial documentationlearn.chatgpt.com
  2. Codex docs: ModelsOfficial documentationlearn.chatgpt.com
  3. Codex docs: PricingOfficial documentationlearn.chatgpt.com
  4. Codex docs: Codex CLIOfficial documentationlearn.chatgpt.com
  5. Codex docs: GitHub code reviewOfficial documentationlearn.chatgpt.com
  6. Codex docs: Non-interactive modeOfficial documentationlearn.chatgpt.com
  7. Ryan Cox, Temporal blog: Improving our Java SDK with Codex by OpenAI (published May 17, 2025)Public sourcetemporal.io
  8. Simon Willison: I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in 4.5 hours (published Dec 15, 2025)Public sourcesimonwillison.net
  9. Wayne Joubert on John D. Cook's blog: Experiences with GPT-5-Codex (published Oct 16, 2025)Public sourcejohndcook.com
  10. rossant on Hacker News: a Codex CLI refactor that rewrote link URLs (published Oct 9, 2025)Public sourcenews.ycombinator.com