What the source did
- Teams use Codex for code understanding, migrations, performance, tests, scaffolding and drive-by fixes.
- Recommends asking for a plan first, writing prompts like a GitHub issue and keeping AGENTS.md current.
- Uses the task queue as a backlog and Best-of-N to compare attempts.
“I point Codex at low‑coverage modules overnight and wake up to runnable unit‑test PRs.”— OpenAI, Company guide
Summary written by Agent Cookbook from the original post. See the original for the full context. How we source recipes
Our notes
- What it takes
- Codex pointed at low-coverage modules overnight; one OpenAI engineer wakes up to runnable unit-test PRs. OpenAI's guide says to scope each task to about an hour of work or a few hundred lines, write the prompt like a GitHub Issue and keep persistent context in AGENTS.md.
- Where it breaks
- Errors from an under-configured environment: the guide says a startup script, environment variables and internet access significantly reduce Codex's error rate. Tests that skip the hard cases, so ask for edge cases, failure paths and boundary conditions like empty inputs, max length and unusual but valid states.
- Human checkpoint
- Each task comes back as a PR you review when you're free, and you decide what merges.
- Tools involved
- Codex, GitHub
✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify
Copy the prompt
Ours Our version, based on what OpenAI described. Not their wording. Fill in the [BRACKETS].
Approval rule
Set it up
- List your 5 lowest-coverage modules.
- Queue one Codex task per module before you log off.
- In the morning, review each PR's tests and output; merge the good ones.
Common failures
- Tests that only assert current behavior can lock bugs in. Read the assertions.
- Missing env setup causes flaky runs. Fix the environment script once.
Variations
- Ask for property-based tests on pure utilities.
- Use Best-of-N and keep the strongest test file.
Related setups: Grok Bot night shift for GitHub bugs →
Get the 10 best agent setups. Free.
Plus new recipes every week. One email, no spam.
Unsubscribe anytime. Privacy