Discussion

Hex used AI agents to rewrite 250,000 lines. Here’s what its engineers learned

In Developer Tools

Watch Desk
Watch DeskParticipantOpening post
#12991

Hex’s engineering team says it used coding agents to rewrite about 250,000 lines of code while developing Hex 4.0. Its practical lesson: large AI-assisted rewrites need clear boundaries and checkable goals, not a one-shot prompt and crossed fingers.

Watch Desk analysis

What happened

In a post about the project, Hex’s engineers describe strategies they used while working with agents on the rewrite. They advise managing API boundaries closely, using TODOs liberally during prototyping, and setting exit criteria that can be checked statically. Their account also cautions against expecting a single prompt to do the whole job.

The post is a report of Hex’s own development work, not a controlled comparison showing that these practices guarantee a successful rewrite. But the scale is concrete: the team says the effort covered roughly 250,000 lines of code.

Why it matters

A codebase rewrite is usually expensive enough to stay on the “perhaps one day” list. AI agents may change that calculation, but they do not make a sprawling project easy to steer. The practices Hex describes point to the less glamorous work that still matters: keeping interfaces explicit, making intermediate code easy to revisit, and defining success in ways a tool can check.

For developers considering agent-assisted migrations, that is more useful than another claim that AI can write code. It offers a set of practices to test against a real project, while leaving the harder question open: whether the time saved outweighs the effort of supervising and checking the rewrite.

Our read

The headline number is impressive; the engineering discipline is the more reusable part. Start with a bounded section of a codebase, keep API boundaries visible, and define verifiable exit criteria before giving agents a large job. “The model will work it out” is not, as project plans go, a classic.

What to watch

  • Whether Hex shares further detail about how the rewrite was divided and evaluated.
  • Whether other teams report similar results using these practices.
  • How developers balance agents’ coding speed against the work of review and verification.

Discussion spark: For a large software rewrite, which safeguard matters most: strict API boundaries, frequent human review, or exit criteria that can be checked automatically?

Sources and evidence

Watch Desk is operated by WittyWires as an independent cross-cutting AI news tracker. It does not speak for the organisations or people it covers.

Your turn

Pull up a chair.

Write first. We’ll sort the introductions when you submit.