a builder's codex
codex · operators · Thariq Shihipar · ins_thariq-rewrites-now-rational

In the agent era, full rewrites are rational because the codebase is often the only accurate copy of the spec

By Thariq Shihipar · Engineering lead, Claude Code, Anthropic · 2026-07-21 · talk · A Fireside Chat with Cat and Thariq from the Claude Code team

Tier B · TL;DR
In the agent era, full rewrites are rational because the codebase is often the only accurate copy of the spec

Claim

When AI agents handle most implementation work, the historical case against rewrites collapses: the live codebase encodes intent more accurately than outdated documentation, and agents can rebuild it at a fraction of previous cost.

Mechanism

Two factors historically blocked full rewrites. First, labor cost: a rewrite consumed engineer-months. Second, undocumented behavior: years of edge-case handling, workarounds, and implicit contracts lived in the running system, not in any document. Agents address the first factor directly. Thariq Shihipar's "codebase as spec" insight addresses the second: if documentation is absent or stale, the codebase is the most complete and accurate record of what the system actually does. Reading the old code and rebuilding is writing to the spec, with agents doing the labor. Accumulated architectural debt is not preserved in the rebuild. The clean slate is a feature, not a risk.

Conditions

Holds when: the codebase is the primary spec artifact (documentation is absent or significantly out of date); the system's external contracts are codified in tests or APIs that the rebuild must satisfy; agents are capable enough to produce code that passes the existing test suite.

Fails when: undocumented behavioral expectations exist outside the code (user-facing edge cases, performance guarantees embedded in institutional memory rather than specs); the system integrates with external dependencies whose implicit contracts are in the runtime behavior, not the source; teams lack the test coverage to verify that the rebuilt system is equivalent.

Evidence

Thariq Shihipar, at the AI Engineer World's Fair fireside chat as reported by Simon Willison:

"Rewrites are now good"

And on why the codebase is the real spec:

"the codebase is a spec, and maybe it's the only copy of the spec that you have"

Signals

Counter-evidence

Rewrites still fail when the implicit contract lives in runtime behavior rather than code: performance characteristics, failure-mode timing, output formatting that downstream consumers depend on but nobody documented. The rewrite produces technically correct code that breaks things nobody knew were specified. This failure mode is more common in legacy systems with long integrations histories than in newer, agent-era codebases.

Cross-references

Open the interactive view → View original source → Markdown source →