Sooner or later, most vibe-coded apps reach the same moment. The prototype works, people are using it, and then each new prompt seems to break something that worked yesterday. The AI fixes one bug and creates two more. Someone suggests starting again "properly", and someone else points out how much time has already gone in.
This guide is for that moment. It sets out the three realistic options, the signals that point to each one, a decision table you can use with your team, and the incremental approach that lets you replace the weak parts without switching the app off. The short version, which matches our guide to what vibe coding is and where it breaks: most apps need fixing, not rebuilding. But not all of them.
- You have three options: fix in place, refactor in stages, or rebuild using the prototype as the specification.
- Fix loops, missing tests and a tangled data model point to refactoring; a broken data model or platform limits can point to a rebuild.
- Escape's 2025 scan of 5,600+ vibe-coded apps found 2,000+ vulnerabilities and 400+ exposed secrets, so check security before anything else.
- The strangler fig approach replaces one part at a time while the app stays live.
- Even a rebuild should keep the prototype's screens, flows and data as its specification.
What are your options with a vibe-coded app?
There are three, and they are not as far apart as they sound. Each one keeps something from the prototype; the difference is how much of the code survives.
- Fix in place. Keep the code and the platform. Close the security gaps, repair the specific bugs, add a few tests around the paths that matter and carry on building. This suits apps whose structure is basically sound.
- Refactor in stages. Keep the app running while you restructure it piece by piece: untangle the data model, pull duplicated logic into one place, move risky work to the server, add tests as you go. This suits apps that work but have become fragile.
- Rebuild using the prototype as the specification. Write a new codebase, often on a different stack or outside the original platform, with the existing app as the reference for every screen, flow and rule. This suits apps whose foundations cannot carry the next stage of the business.
A full rewrite that ignores the prototype is not on the list. It throws away the most valuable thing a vibe-coded app gives you: months of product decisions that real users have already tested.
Why do vibe-coded apps get harder to change?
Because AI tools are better at adding code than at reorganising it. Every prompt tends to solve the problem in front of it, often by writing a fresh copy of logic that already exists elsewhere. After a few hundred prompts, the same rule can live in five places, and a fix to one copy leaves the other four unchanged.
The research on AI-assisted code points the same way. GitClear's AI Copilot Code Quality 2025 research analysed 211 million changed lines of code written between January 2020 and December 2024. It found the share of changed lines associated with refactoring fell sharply while copy-pasted code rose, describing "4x more code cloning". GitClear sells code analysis tools, so read it as vendor research, but the pattern matches what we see in vibe-coded projects.
- 211m changed lines of code analysed, from 2020 to 2024
- 25% to under 10% fall in changed lines associated with refactoring, 2021 to 2024
- 8.3% to 12.3% rise in changed lines classified as copy-pasted, over the same period
Developers feel this too. In the Stack Overflow Developer Survey 2025, the most common frustration with AI tools, named by 66% of respondents, was "AI solutions that are almost right, but not quite." Almost half said debugging AI-generated code takes more time.
All respondents to the Stack Overflow Developer Survey 2025.
| Survey answer | Share |
|---|---|
| Frustrated by AI answers that are almost right | |
| Distrust the accuracy of AI tools | |
| Find debugging AI code more time-consuming | |
| Trust the accuracy of AI tools | |
| Highly trust the accuracy of AI tools |
"Almost right" is exactly how a fix loop starts. The preview looks fine, the edge case fails, and the next prompt patches the symptom rather than the cause.
Will another round of prompting fix it?
Sometimes, but it is worth testing the assumption. A 2025 randomised trial by the research group METR gave 16 experienced open-source developers 246 real tasks on large, mature codebases, and randomly allowed or disallowed AI tools on each one.
- 24% faster is what the developers expected AI tools to make them
- 20% faster is what they still believed afterwards
- 19% longer is how much more time the tasks actually took with AI allowed
Source: METR, Early-2025 AI and experienced open-source developer productivity, 2025
Tools have moved on since then. METR's February 2026 update says it is "likely that developers are more sped up from AI tools now", while calling its newer data "only very weak evidence" of how much. The lesson for a business owner is narrower: how fast prompting feels is a poor guide to how fast it is. If you have spent a week asking the AI to fix the same area, the problem is probably structural, and more prompts will not reach it.
Which signals point to fix, refactor or rebuild?
Look at the app's foundations, not just its bugs. A long list of bugs can still be a fix-in-place job; one deep problem in the data model can justify a rebuild. These are the signals we weigh:
- Fix loops. If the same feature has broken and been re-prompted several times, the structure underneath it is the issue. That points to refactoring that area.
- No tests and no version control. Common, and fixable. Connect the project to Git and add tests around sign-up, payment and the core workflow before changing anything else.
- Data model problems. Duplicated tables, columns that mean different things in different screens, or records with no clear owner. Small problems can be refactored; a model that cannot represent how the business actually works may need a rebuild.
- Security exposure. Open database tables, secret keys in the browser and missing access rules are usually fixable in place, but they come first, whatever you decide next.
- Platform limits. A requirement the platform cannot meet, such as a hosting, compliance or integration need, can make moving off the platform the only route.
- Real usage and data. The more customers and records the app already holds, the stronger the case for changing it in stages rather than replacing it in one go.
| Signal | Fix in place | Refactor in stages | Rebuild from the prototype |
|---|---|---|---|
| Problems are specific and repeatable | Best fit | Not needed yet | Overkill |
| Every change breaks another feature | Short-term only | Best fit | Only if the data model is also wrong |
| No tests, no Git history | Add both first | Add both first | Build them in from day one |
| Data model cannot represent the business | Poor fit | Possible, table by table | Often the cheaper route |
| Open tables or exposed secrets | Fix now, whatever comes next | Fix now, whatever comes next | Fix now, whatever comes next |
| Platform cannot meet a hard requirement | Not possible | Move parts off the platform | Strong case |
| Many live users and records | Good fit | Good fit | Needs a careful data migration |
| Prototype only, no real users yet | Good fit | Rarely worth it | Cheapest moment to rebuild |
If you want to know what each route tends to involve in time and budget, our guide to how much it costs to fix a vibe-coded app breaks it down.
Why does security come before the decision?
Because a security gap is live today, and the decision about the codebase can take weeks. In October 2025 the security company Escape published a scan of publicly available vibe-coded apps, most of them built with Lovable, with smaller samples from other builders. Escape describes its results as "lower-bound estimates".
- 5,600+ publicly available vibe-coded apps analysed
- 2,000+ vulnerabilities found
- 400+ exposed secrets, such as API keys
- 175 instances of exposed personal data, including medical records and IBANs
Source: Escape, How we discovered vulnerabilities in apps built with vibe coding, 29 October 2025
Most of these problems, such as missing Row Level Security or a secret key in front-end code, can be fixed in place in days. Do that first, then decide what to do with the rest. The UK's National Cyber Security Centre puts the principle simply: "Different code deserves different levels of oversight," in its vibe coding spectrum guidance. Our vibe-coded app security checklist lists the checks, and a vibe-coded app security audit is the formal version.
How do you replace parts of an app without switching it off?
Use the strangler fig approach. Martin Fowler named it after a vine that grows around a host tree until it can stand on its own. In his article on the Strangler Fig Application, he describes building new parts alongside an old system and moving behaviour across gradually, until the old code can be retired. He warns that the simple-sounding plan of a complete replacement tends to "go down in flames most of the time."
For a vibe-coded app, that usually looks like this:
- Put the code in Git and add tests around the critical journeys
- Close the security gaps in the current app
- Pick the most fragile area, such as payments or bookings
- Build its replacement beside the old version, behind the same screens
- Switch traffic over, watch it, and keep a way back
- Remove the old code, then move on to the next area
The benefit is that the app keeps earning while it improves. Customers do not see a launch day, and if a new part misbehaves you roll back one area rather than the whole product. Often, after two or three areas, the team realises the rest of the code is fine, and a planned rebuild quietly becomes a refactor.
When is a rebuild actually cheaper?
A rebuild is cheaper when the cost of working around the foundations is higher than the cost of replacing them. In practice that tends to mean one of four things:
- The data model cannot represent how the business works, so every new feature needs a workaround and every report needs a manual clean-up.
- Security or compliance has to be designed in, for example strict separation between client accounts, and the current structure fights it at every step.
- The platform cannot meet a hard requirement, and moving piece by piece would take longer than starting again outside it.
- The app is still a prototype with no real users or data, so there is nothing to migrate and little to lose.
Even then, a rebuild is not a blank page. The prototype has already answered the hardest questions: what users need, which screens they understand and which features they never touch. A good rebuild is faster than the original build because the specification already exists and has been tested on real people.
How do you keep the prototype's value?
Treat the prototype as the specification, whichever option you choose. Before anyone changes the code, capture:
- Screens and flows. Record every user journey, including the awkward ones such as password reset and cancelled orders.
- Business rules. Write down the rules hidden in prompts and code: who can see what, how prices are calculated, what happens when a payment fails.
- Data. Export the schema and a sample of real records. These show how the business actually uses the app, which is often different from how it was first described.
- Wording. Keep the labels and messages users already understand.
- The prompt history. Where the platform keeps it, it explains why features exist and which ones were abandoned.
This is also how AI-assisted development works best on the professional side. Circlemount built The Study Room's Portal, Dentorb and ORBQ with AI-assisted development using Antigravity, Claude Code, Codex and Lovable, with every change reviewed. The tools are the same as in a vibe-coded app; the specification, review and tests are what differ. Our guides to taking a Lovable app to production and a Claude Code app to production cover the platform-specific steps.
What should you check before you decide?
Spend a few days on evidence before committing to any route. This list will usually make the answer obvious:
- Is the code in Git, and can you build it outside the platform?
- Which features have broken more than once in the last month, and where do they live in the code?
- Is Row Level Security on for every table, and are any secret keys in the browser?
- Does the data model match how the business works today, and how it will work in a year?
- How many live users and records would a change affect, and do you have restorable backups?
- Is there a hard requirement the platform cannot meet?
- Are there tests on sign-up, payment and the core workflow?
If most answers are reassuring, fix in place. If the trouble clusters in a few areas, refactor those areas in stages. If the data model or the platform is the problem, plan a rebuild from the prototype. Marcus (founder) and a team of 12 specialists do this assessment for businesses across the UK from Telford, including teams in Shrewsbury, Wolverhampton and Birmingham. See how we fix vibe-coded apps, including apps built with Claude Code and Codex, or how app MVP development handles a rebuild.
Frequently asked questions
Should I rebuild my Lovable app or fix it?
Fix it first in most cases. Close the security gaps, sync the code to Git and add tests around the critical journeys. Consider a rebuild only if the data model cannot support the business, the platform cannot meet a hard requirement, or the app is still a prototype with no real users or data yet.
What is vibe code cleanup?
Vibe code cleanup is the work of making AI-generated code safe and maintainable without throwing it away. It usually covers closing security gaps, removing duplicated logic, tidying the data model, moving secret keys to the server, adding tests to critical paths and putting the project under version control so changes can be reviewed.
Can you refactor AI-generated code?
Yes. AI-generated code is ordinary code once it is in a repository, and it can be refactored like any other. The safe order is to add tests first, then restructure one area at a time, checking that behaviour stays the same. Coding agents can help, as long as someone reviews every change.
What is the strangler fig approach?
It is a way of replacing software gradually, named by Martin Fowler after a vine that slowly replaces its host tree. You build a new version of one part alongside the old one, switch traffic to it, then retire the old code. The app stays live throughout, and each step can be rolled back.
How do I take a vibe-coded app to production?
Start with security: access rules on every table and no secret keys in the browser. Then sync the code to Git, add tests to sign-up and payment, set up your own email sender, backups and monitoring, and test every key journey on the live domain before real customers rely on it.
Is it cheaper to rebuild a vibe-coded app from scratch?
Rarely, once real users and data exist, because a rebuild must recreate every working feature and migrate live records. It is usually cheaper only when the data model or platform blocks the next stage of the business, or when the app is still a prototype with nothing to migrate.
Sources
Checked on 20 November 2026. Product features and figures change quickly, so check the current source before you rely on a detail.
- Escape: How we discovered vulnerabilities in apps built with vibe coding (2025)
- GitClear: AI Copilot Code Quality, 2025 research
- Stack Overflow Developer Survey 2025: AI
- METR: Early-2025 AI and experienced open-source developer productivity (2025)
- METR: Uplift update (February 2026)
- Martin Fowler: Strangler Fig Application
- NCSC: The vibe coding spectrum approach to AI-assisted software development (2026)
Not sure whether to fix or rebuild?
Circlemount reviews vibe-coded apps built with Lovable, Bolt, Replit, Cursor, Claude Code and Codex, and tells you plainly whether to fix, refactor or rebuild. The initial app assessment is free, project work starts from £1,000 + VAT, and ongoing support plans start from £125 a month + VAT. See how we fix vibe-coded apps, or Join the Circle for a free business analysis and proposal.





