Rescue or Rewrite? A Synthesized Framework
The four perspectives here aren't as contradictory as they first appear. Three advisors (Architect, Philosopher, Explorer) recommend a paid diagnostic before deciding. The fourth (Maverick) says skip the diagnosis and just rewrite. But look closer: Maverick's real argument isn't "never audit" — it's "don't let a rescue audit turn into an open-ended rescue engagement." That's compatible with the other three, not opposed to them. The synthesis below resolves this: audit fast, decide fast, and go in with a bias toward skepticism.
The Core Insight Everyone Agrees On
AI-generated code has a specific failure signature, and all four advisors are describing the same phenomenon from different angles:
- It's internally inconsistent because it was generated in disconnected sessions with no persistent mental model (Philosopher, Explorer)
- It looks plausible on the happy path but has no "why" behind its decisions — no one can explain the intent, only the output (Explorer's "Winchester Mystery House")
- The real cost of rescue isn't fixing bugs, it's reverse-engineering intent — figuring out what the code was supposed to do before you can safely change it (Maverick, Architect, Explorer all independently land here)
This last point is the crux of the whole decision. Rescue is expensive not because the code is bad, but because understanding bad code someone else (or something else) wrote is inherently slow — and when the author is a model with no accountability or continuity, there's no one to ask.
The Actual Decision Test (Do This, Not a Coin Flip)
Don't decide from your gut. Don't decide from a full audit either — that's overkill. Do a time-boxed, cheap stress test, borrowing the sharpest diagnostic tools from across the advisors:
1. The "Change One Thing" Test (Explorer)
Ask an engineer to spend a few hours attempting one non-trivial change — swap a data model, add a new auth flow, change a core dependency. If it requires touching 20+ files or nobody can predict the blast radius, the architecture is broken. That's a scrap signal, fast and cheap to obtain.
2. The Explainability Test
Can the engineer read the code and explain why it's structured this way within an hour or two? If they keep hitting "I don't know what this is for," you're not looking at messy code — you're looking at a black box. That's a scrap signal.
3. The Size/Value Check (Philosopher)
Rescue economics scale with size and embedded value. A 2,000-line prototype with confused core logic: rewrite is almost always faster. A 50,000-line system with real usage, integrations, and a workable-if-ugly architecture: rescue economics improve a lot, because you're not just saving code, you're saving discovered business logic, edge cases, and integration knowledge that took real time to accumulate.
4. The "Black Swan" Check (Explorer)
Is there one piece of logic in there — an algorithm, an integration, a gnarly business rule — that would take a human real time to rediscover from scratch? If yes, that specific piece is worth extracting even if everything else gets rebuilt. If no (it's just a CRUD app done messily), there's nothing precious to preserve.
Total cost of this test: a few hours to a day. This is exactly the "audit" the Architect and Philosopher recommend — just scoped tightly enough that it can't turn into the archaeology project Maverick is warning against.
Resolving the Real Tension: What the Audit Usually Reveals
Here's the honest empirical claim underneath Maverick's response, and it's worth stating directly: when you actually run this test, it comes back "scrap" far more often than intuition suggests. AI-generated codebases tend to fail the explainability and change-tolerance tests specifically because they lack the single authorial intent that makes human codebases legible. So the disagreement isn't really about process — it's about priors. Go into the audit expecting to scrap it. Let the evidence talk you out of that, rather than going in hoping to be talked into a rescue.
This matters practically: default to skepticism, but don't skip the test. A day of diagnostic work that confirms "yes, rewrite" is still cheaper than either (a) guessing wrong and paying for a doomed rescue, or (b) guessing wrong and throwing away something that had 60% of the value already built.
Watch for These Two Biases (Philosopher's contribution — don't skip this)
- Your sunk-cost attachment: you paid for this code (in time, money, or both), so you're inclined to want it saved regardless of whether that's economically rational.
- The engineer's incentive: engineers often prefer the more interesting, higher-fee rewrite over tedious cleanup — or occasionally the reverse, if they want an easy retainer doing endless "fixes." Get the audit from someone who commits upfront to giving you both estimates (fix-cost and rewrite-cost), ideally someone who isn't only paid if you choose one path.
Decision Checklist
Lean Rescue if:
- The stress test shows changes are localized, not system-wide
- The engineer can explain the code's intent without much struggle
- There's substantial size/usage/integration value already built
- There's at least one genuinely hard-won piece of logic worth preserving
- You're not planning to rebuild most of the product logic anyway
Lean Rewrite if:
- One structural change breaks everything
- No one can explain why the code does what it does
- It's small enough that regeneration is genuinely faster than untangling
- There's no test coverage and no reliable way to verify behavior
- What's "good" about it is generic scaffolding you could regenerate in an afternoon
Bottom Line
Pay an engineer — but pay them for a half-day to one-day stress test, not an open commitment to "rescue" or "rewrite." Frame the deliverable explicitly: change-tolerance result, explainability result, and a two-path estimate (fix vs. rebuild) with a recommendation. That's cheap, fast, and removes the guesswork.
Go in expecting the answer to be "rewrite" — that's the way to bet given how AI-generated code typically fails — but let the actual test decide, because the cases where rescue wins (large systems, real usage, one hard-won piece of logic, localized architecture) are common enough that scrapping blind is also a real risk. Either way: keep the requirements and lessons learned, even if you scrap the code. You're never starting from zero.