afterbuild/ops
Resource · Decision framework

Rewrite, or rescue?

A written framework for deciding which scope your vibe-coded app actually needs — with nine rescue signals, six rewrite signals, and fixed-fee costs for each.

By Hyder ShahFounder · Afterbuild LabsLast updated 2026-04-15

TL;DR (55 words)

Rescue if the schema is coherent, the UI works for users, and the failures are localised to specific seams — this is most vibe-coded apps. Rewrite if the data model is incoherent, there are multiple conflicting UI patterns, or a new engineer can't orient in the code in a day. Rescue: 3–6 weeks, $7.5k–$15k. Rewrite: 8–16 weeks, $25k+.

By Hyder Shah · Published 2026-04-15 · Updated 2026-04-15

Why this decision is hard

The rescue-vs-rewrite decision is the single most expensive decision a vibe-coded app founder makes, and it's made hardest by the fact that AI-built apps are visually finished. The UI looks done. The demo is convincing. It's deeply counter-intuitive that a working demo might need to be thrown away. Conversely, some apps that look broken are actually fixable in three weeks, and founders over-scope to a rewrite they don't need.

Published founder accounts underline the stakes. One Bolt.new founder reported burning 20 million tokens on a single auth bug before realising the app needed a human to make the decision, not more prompts. Industry benchmarks — see our 2026 vibe-coding research and Veracode's State of Software Security — put AI-code vulnerability rates close to half. Most of those can be fixed in place (rescue), but some are architectural and require replacing the code (rewrite). The framework below is how we scope it.

The single most important question

Can a new engineer orient in your codebase in under a day?

If yes, rescue. If no, rewrite. Every other signal below reduces to this one, because the cost of a rescue scales with how fast your next hire (or our team) can ramp up. If the code is unreadable, every hour of rescue work costs what three hours would cost on a conventional codebase — and the rewrite shortcut gets cheaper.

Nine signals that point to rescue

  1. The UI works for users.Sessions are clean, conversion is reasonable, the founder's taste is visible. The UI is often the best thing about a vibe-coded app and the last thing you want to throw away.
  2. The schema makes sense.You can explain every table in five minutes. Relationships are coherent. No duplicate tables, no fields with content that doesn't match their name.
  3. Failures are localised.The bugs have names: “auth breaks on mobile”, “Stripe double-charges”, “the dashboard is slow.” A rescue can close a known list of issues.
  4. You have paid users. Live revenue creates a strong preference for in-place fixes over anything that risks downtime.
  5. Time pressure is high. An investor is in diligence, a pilot launch is booked, a regulator is asking questions. Rescue is 3–6 weeks; rewrite is 8–16.
  6. Integration count is bounded. Fewer than eight external integrations (Stripe, Supabase, an email provider, a CRM) means each one is individually fixable.
  7. You want to keep the current platform. Lovable, Bolt, v0 — the app runs on a platform the founder understands and wants to stay on for now.
  8. Founder bandwidth is limited.A rescue needs less founder attention than a rewrite, because the UI and data model aren't being redesigned.
  9. Code readability is okay. A senior engineer can scan the repo and identify the shape of the app in an afternoon.

Six signals that point to rewrite

  1. The data model is incoherent.Three tables that should be one. A users table with 40 unused columns. Foreign keys that don't match names. This is the single strongest rewrite signal.
  2. Three (or more) conflicting UI patterns. Different prompting sessions produced different component systems. Half the app uses a design-system-looking thing and half uses raw Tailwind. Modals, forms, and tables behave differently in every feature.
  3. Code is unreadable.Duplicated logic across eight files. `any` types everywhere. Pattern inconsistency at the function level, not just the component level. A new developer can't orient in a day.
  4. Platform lock-in with no export. Base44, Bubble, and similar platforms have one-way exports or none. If you need code ownership, the only path is a rewrite on a portable stack.
  5. The app does something the tool was never meant to do.Real-time collaborative editing, heavy numerical computation, offline-first mobile — these aren't in the sweet spot of any vibe-coding tool, and AI-generated attempts at them are usually unsalvageable.
  6. You're planning to sell or raise seriously.Acquirers and Series B+ investors will do code reads. A rewrite that a buyer's technical diligence passes is worth more than a rescued codebase that barely does.

The hybrid option: partial rewrite

Sometimes the right answer is neither pure rescue nor pure rewrite. The most common hybrid is: keep the UI, rewrite the backend, migrate the data. This is the scope of our Finish-My-MVP service at $7,499 fixed fee. It's how we handled the v0 prototype-to-SaaS case: the founder's taste on the UI was the product's edge, so we kept every pixel and built a real product behind it.

Hybrid works when the UI is your best work, the backend is missing or broken, and the data model can be designed from scratch because it didn't exist in any real sense.

If you’re past the rescue stage and want a senior engineer on the code instead of another scoped project, see hire an AI-app developer for ongoing engagement options.

Cost comparison: rescue vs rewrite vs hybrid

OptionPriceTimelinePreservesReplaces
Rescue$7.5k–$15k3–6 weeksEverythingBroken seams
Hybrid (Finish-My-MVP)$7,4993–4 weeksUI, dataBackend, auth, payments
Platform Escape$9,9994–6 weeksUI, data, schemaPlatform runtime
Full rewrite$25k–$60k+8–16 weeksProduct scope onlyEverything

A step-by-step self-diagnosis

  1. Open the repo or platform export. Count the tables. Can you explain each?
  2. Look at three randomly-chosen components. Do they share a visual language? A prop shape?
  3. Grep for `any` and `@ts-ignore`. If there are more than 15, code quality is a risk.
  4. List every integration (Stripe, OAuth providers, email, analytics, CRM). Count them.
  5. Ask: could a new senior engineer open a PR in a day? If not, the onboarding tax is high.
  6. Cross-check against the rescue and rewrite signal lists above. Count matches.
  7. If you're still unsure, book the free diagnostic — we'll return a written recommendation inside 24 hours.

A common mistake: over-scoping

Founders see AI-built code, feel embarrassed by it, and scope a rewrite. Two weeks later they realise the UI was fine and the rewrite is a 12-week version of a 4-week rescue. Most vibe-coded apps we see are rescuable. The ones that genuinely need a rewrite are the ones where a senior engineer cannot orient in a day — and that's a surprisingly high bar.

Related reading

FAQ
What's the difference between a rescue and a rewrite?
A rescue keeps the existing codebase and fixes the broken seams — auth, RLS, payments, deploy, performance. A rewrite starts fresh on a conventional stack (Next.js + Supabase + Clerk or similar) and migrates the data and UI. Rescue is 3–6 weeks and $7.5k–$15k; rewrite is 8–16 weeks and $25k+.
When should I rescue instead of rewrite?
Rescue if the schema is reasonable, the UI works for users, and the failures are localised. Most vibe-coded apps qualify — the UI is usually the founder's best work, and the broken parts are auth, RLS, Stripe, and deploy, which are fixable in place. Rescue keeps your paid users live through the fix.
When should I rewrite instead of rescue?
Rewrite if the data model is incoherent, there are three independent UI patterns inherited from different prompting sessions, or the code is unreadable enough that a new engineer can't orient in a day. Also rewrite if the platform has no export (Base44, Bubble) and you need code ownership.
Can I do a partial rewrite?
Yes — and often it's the right answer. Keep the UI (founder taste is the product edge), rewrite the backend, and migrate the data. This is the scope of our Finish-My-MVP service at $7,499. See the v0 prototype case study for a worked example.
How do I know if my data model is salvageable?
Open the Supabase schema. If you can explain what each table is for and how they relate in under five minutes, it's salvageable. If there are duplicate tables, columns whose names don't match their contents, or a 'users' table with 40 unused fields, a rewrite of the data model is cheaper than trying to rescue it.
What if I'm halfway into a rewrite already?
Stop and get a diagnostic. Self-run rewrites commonly stall at 60–70% complete because the founder discovers the second half is harder than the first. Our free diagnostic gives you a written continue-or-pivot recommendation based on what you've actually built, not what you planned to build.
Does a rescue mean I'm stuck on Lovable / Bolt / Base44 forever?
No. A rescue fixes the app on its current platform; a Platform Escape is a separate scope that moves it off. Many founders start with a rescue to stop the bleeding, then do a Platform Escape in quarter two once revenue stabilises. Both are fixed-fee, scoped from a diagnostic.
What's the single most important signal?
Can a new engineer orient in the codebase in under a day? If yes — rescue. If no — rewrite. Every other signal feeds into that one. The cost of a rescue scales with how fast your next hire can ramp up; the cost of a rewrite is bounded by starting from a known-good template.
Next step

Not sure which scope you need?

Book a free 30-minute diagnostic. Written rescue-vs-rewrite recommendation inside 24 hours.

Book free diagnostic →