The AI Gazette

OpenAICoding agents

OpenAI's experimentation team removed 800,000 lines of dead code with one loosely worded Codex prompt and a rule to show evidence

Five engineers ran variations of a short Codex prompt across repositories and merged more than 1,400 pull requests that deleted over 800,000 lines. The prompt told the agent to confirm with live data that code was unused before removing it.

Illustration: three labelled cards, Remove unused code, Review stale flags and Speed up CI, with arrows leading into a code editor window, on a blue and violet gradient.
Image: OpenAI Developers (opens in a new tab)

The starting prompt was a single casual sentence asking the agent to find dead code and to check Slack, the feature flag platform or any other source needed to confirm it was unused. With GPT-6 Astra the agent read past pull requests, Slack threads, project trackers and production profiling tables, then explained the reason for each deletion in the pull request. The work was done part-time over two weeks, and reviews were fanned out to the teams that owned the affected code. One service image shrank from 3.31GB to 1.72GB, and about 400 visual snapshot variants were removed from a test suite.

The same pattern handled stale experiments, which static analysis handles poorly because the code may still run. The prompt asked the agent to verify live flag configuration, check git history and overlapping pull requests, keep killswitches and operational safeguards, and open one small draft pull request per cleanup with a link to the flag configuration. A follow-up /goal prompt then audited the whole repository and produced a report grouped into parallel workstreams, with CPU cost per flag. It surfaced a years-old override flag that fanned out to every other flag; because the flag was marked permanent, the agent escalated it for human review rather than deleting it. Removing it saved an estimated 0.42% CPU in the main affected service.

On model choice, the team ran the same stale-experiment audit over more than 6,000 files in four languages. GPT-6 Astra at its highest effort found 142 items for $109.06. GPT-6.1 Sol at its highest effort found 131 for $15.12, which is 92% of the findings at 14% of the cost. GPT-6.1 Sol at medium effort found 86 for $5.27. The author reviewed the discrepancies between runs by hand.

Preserve production behavior, operational safeguards and gates/configs intended as killswitches or similar.
The guardrailMaintaining software with the GPT-6 family, OpenAI Developers

From other editions

Say hi.