Codex put tagged unions into Go, then cut 5k+ lines in about an hour
Go lacks tagged unions and an early return operator, so they had Codex add both, then refactor the Go source to use them. Within about an hour it removed 5k+ lines and found real bugs. They haven't reviewed it much yet.
Done withCodexSpotted· by HN user jordan_bonecut· Oct 23, 2026
Result Found a potentially nil error return in plan9 code
“it easily (within about an hour) removed 5k+ lines of code from the go source.”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
Wanting tagged union types and an early return operator in Go, they had Codex implement both language features, using about 10% of their weekly Codex limit on the $100/month plan plus a few rounds of review. They then asked it to refactor the Go source to use the two new constructs.
How it went
Within about an hour, the refactor removed 5k+ lines of code from the Go source and found some real bugs, like a potentially nil error value being returned in some plan9 code. They haven’t looked much at that branch themselves, and wouldn’t use the features in production in their current state.
Try it yourself with Codex
Have your coding agent add [a specific language feature, e.g. tagged unions and an early-return operator] to a large existing codebase, then ask it to refactor the existing source to use the new constructs. Review each change before merging, and don't ship it to production until it's proven itself across the whole codebase.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
A Tauri webview that sometimes went blank on user devices sent them to Codex to rewrite the project in GPUI. Codex dropped the Windows cross-build toolchain and wrote a layer to the existing Rust backend.
Their own Next.js orchestrator launches headless Claude Code and Codex sessions, reacts to GitLab and Linear, fixes CI failures, rebases and reviews. Built in 1-2 weeks of prompting, it leaves them refining tickets.
Building a social media management tool in layers, they ran each independent stream as its own Claude Code worktree, with Codex reviewing on GitHub. Four at once was the most their brain could handle.
Asked for a customer demo, the team had agents clone RollerCoaster Tycoon 2: geometric space, lots of art and animation, complex interactions. On just Claude Max and Codex Max plans, it took ~48 hours.
A draining test for a worker in a parsing engine: Claude Code spent 1 hour on high effort at 1 AM and left it broken. After sleeping, the writer tried Codex, which fixed it in 5 minutes.
On top of a paid code-review tool, they built a /meta-review skill that asks Codex, Cursor and Gemini to review code written with Claude Code. It keeps finding small things Claude and the writer both missed.