# How to use Codex to audit a large codebase overnight

The author ran approximately 800 narrowly scoped auditors overnight, assigning one file per subagent. Later synthesis extracted bugs, identified common causes and grouped findings by priority.

Agent: Codex (via pi with a subagent extension)
Tools: Codex, pi, Subagent extension, JSON task lists
Category: Software & DevOps
Date: 2026-06-23

Outcome: The author reports approximately 800 overnight auditors producing reports for later synthesis. A separate restricted repair run cleared a few thousand lint and type issues over several hours.

## Steps

1. Assign one source file and a report-writing task to each subagent.
2. Launch auditors in batches of 50 through the coordinating session.
3. Collect the recommendations written by the overnight auditors.
4. Synthesize the reports to extract individual bugs.
5. Run another consolidation pass to identify shared causes and priorities.

Human oversight: The author defines worker scope and runs subsequent synthesis; nontrivial repair findings are reserved in a TODO file for human review.

Source: [esperent on Hacker News](https://news.ycombinator.com/item?id=48642750)

Canonical URL: https://agentsinuse.com/use-cases/codex-to-audit-a-large-codebase-overnight/
