Skip to content

Field note

Codex on a real repo

Codex is a repo-aware coding agent. Used carelessly it generates churn the team has to clean up. Used with scope and a real review gate, it ships work.

The first time most teams point Codex at a real repository, the result is a lot of diff and not a lot of value. The work shows up in PRs, but reviewers cannot tell which parts to trust.

Then the test suite gets fragile in odd ways, and a week later someone is unpicking it. The pattern is not Codex being bad; it is the absence of three small disciplines that make agentic work hold up.

Scope before prompt

The first discipline is scope. Codex is at its best on a tightly bounded task with a clear input and a clear definition of done. Multi-file refactors with tests, deterministic migrations, and small features where the shape is already agreed are good. Open-ended exploration is bad. The prompt is a consequence of the scope, not the other way around.

A useful test is whether you could write the PR description before the code is written. If you can, the work is the right shape for an agent. If you cannot, you are about to spend an afternoon reviewing speculative work.

Read-only first, write second

The second discipline is access. Codex sees the entire repository on read, but write should be a graduated thing. The first run is read-only. The second run writes inside a working branch. Merge access is a separate decision made by a human, with the test suite as the gate.

This is not paranoia. It is what experienced reviewers already do for human contributors: more trust over time, with the trust earned by the diff and the test result, not by who is writing the code.

The review checklist that holds

The third discipline is review. The most common failure mode is reviewers skim-reading agent diffs because the change is small. The fix is a written review checklist per category of change, named in the PR template, so the reviewer cannot drift past it.

A starting checklist for an agent-authored refactor PR:

  1. Did the test suite pass on first run, or did the agent change the tests?
  2. Are the renames consistent across files outside the agent's stated scope?
  3. Is there any new dependency, new file, or new top-level export?
  4. Does the diff match the PR description, or has the scope quietly grown?
  5. Did the agent leave any TODOs, placeholder values, or commented-out code?

The checklist is short so it gets used. It targets the specific failure modes agents have, not the failure modes humans have.

The merge gate

The merge gate is the test suite plus the checklist plus a named human approver. None of those are negotiable. If the test suite is flaky, fix the test suite before pointing an agent at the repository. If the checklist gets skipped, the rollout is not yet ready to widen.

Used with these three small disciplines in place, Codex stops being a source of churn and starts shipping the work the team agreed to.

Keep reading

Related notes

26 Aug 2026 · 5 min

ChatGPT Google Drive Scope Error: How to Fix It

When ChatGPT says Google needs admin approval, the cause is almost always an OAuth scope that your Google Workspace administrator has not trusted for the OpenAI app. Compare the scopes the connector asks for with the scopes the admin has approved.

26 Aug 2026 · 5 min

Claude Code Hooks: Put Checks Before the Merge

A review gate built from Claude Code hooks runs the same cheap checks on every agent action, so the human reviewer only sees diffs that have already passed the boring tests.