OpenAI Engineer Rodrigo Roim Shares Practices and Prompts for Cleaning Codebases with GPT-6 Family Models
An engineer from OpenAI's Core Experimentation team, Rodrigo Roim, details the use of GPT-6 Astra and GPT-6.1 Sol within Codex for code maintenance tasks, including dead code removal, stale experiment cleanup, and CI optimization. The article provides specific prompt examples, comparative cost and accuracy data (e.g., GPT-6.1 Sol Ultra achieving 92% of Astra's findings at 14% of the cost), and quantified benefits from over 1,400 merged PRs (such as a 48% reduction in container image size), while emphasizing the critical role of human review and prioritization in automated cleanup.
ImportanceMaterialEvidenceE3 inspectableWrite-upQuick
As codebases grow, maintenance tasks such as removing unused code, cleaning up completed experiments, and fixing flaky tests become increasingly burdensome. Traditionally, engineering teams have relied on complex static analysis systems to detect dead code, but these systems often struggle with edge cases like reflection calls or dynamically enabled paths, leading to accidental deletions. An engineer from OpenAI's Core Experimentation team, Rodrigo Roim, recently shared their practices for using GPT-6 series models in the Codex environment to perform more intelligent, context-aware code maintenance.
The team initially tested GPT-6 Astra on vague dead code cleanup requests. Unlike traditional tools requiring precise instructions, Astra autonomously investigated Slack discussions, internal project trackers, and production performance profiles to gather evidence and justify each deletion. This capability allowed five engineers to merge over 1,400 pull requests and delete more than 800,000 lines of code during two weeks of spare-time collaboration. These cleanups yielded measurable infrastructure benefits, such as reducing a service's container image from 3.31GB to 1.72GB (a 48% decrease) and removing approximately 400 visual snapshot variants from the test suite.