Skip to content

Does a Vibe-Coded Project Become a Mess Over Time?

When working on a vibe coding project for, say, 2 months, constantly asking AI to "add this", "change that", or "remove this", doesn't the codebase eventually become a mess?

I'm talking about poor architecture, redundant code, outdated tests, unused files, etc.

How do you handle this? Do you periodically ask AI to clean up and refactor everything?
And once the project is finished, is it worth having AI rewrite the entire codebase from scratch, keeping the same functionality but with cleaner architecture? Or is that a bad idea?

10 points67 comments
Open on Reddit
About this post
Posted
Archived
Score
10 · 65% up
Kind
Text
ID
1xtmd6j

Author

11
posts
7
comments
1
media
View profile

49 comments

Been a software dev for 10+ years … and I can say that the repos are gonna be a mess overtime regardless of AI usage.. AI just fastens up

65 points

Though, to be fair, AI also fastens up refactoring and cleanups if used properly.

24 points

Disagree.

I use Opus 5.5 daily and its "cleanups" sometimes make my C# code worse.

Resharper makes my refactoring faster.

What language are you using?

13 points

Yeah, anyone who has worked on projects not created and maintained by very good devs has navigated absolute shit shows. It is what it is.

3 points

"This has to be rewritten from scratch" is a meme but I hate that because in cases where it really should be rewritten, you're taken less seriously, and good luck explaining to a non-technical stakeholder why 16 hours of development now saves 50 hours of brain-draining maintenance per year. "Will it work if you don't rewrite it?" "Yes, b..". And that's game over

2 points

You understand the mess without ML AI, that's the difference

1 points

If you're just winging it and vibing, while you're down for the ride, it's going to be a cluster f....

If you start out with a PRD, a MVP plan, and Spec documents then turn those into tickets you work through and stay true to your CI/CD, it's pretty much like any other development.

13 points

You need to enforce certain standards from the start. Testing, high level documentation, requirements, flowcharts etc

10 points

Even with all that you end up with bloat in my experience. You have to go down on module boundaries in several sessions to actually debloat vibed software, at which point you aren’t really vibe coding any more

3 points

Requirements - yes. HLDs and flowcharts?

I'd be faster writing the code myself.

These docs drift from the code anyway, it always happens. The code is the gospel.

1 points

I'm a software dev of 30 years experience.

Yes, it'll make a pigs ear of the code if you don't refactor it by hand.

I couldn't care less who tells me otherwise, I do this for a living and review my peers PRs with code from frontier AIs daily, the code needs a lot of changes. I've got more side projects than you can shake a stick at too.

You'll be fine to start with a greenfield project, but as the codebase gets bigger and can't fit into the AI's context, that's when the cracks will begin to show.

Get AI to generate the code, review it yourself (and use linters too), make changes as necessary, update "skills" to prevent AI repeating any mistakes it made, and hope for the best.

If you hear any "skill issue" pish, ignore. These people never show you their Githubs as it would expose them.

8 points

Can you share your pi setup? Would love to learn from you.

0 points

I use pi for side projects not professionally. But you will see my posts on here.

Professionally I use Visual Studio and VS Code with the Claude Code extension. I also have Resharper which covers c# and c++ (we use both) -

For code analysis c# we use Roslynator analyzers and c++ is clang-tidy, they keep the AIs in check.

For pi i have blackhole extension and mcps such as microsoft learn, web search enabled. My pi connects to strata which runs Qwen 3.8 Flash Next Q4_K_XL (unsloth)

1 points

Any project, human or AI is at risk of becoming spaghetti over time if discipline and periodic cleaning is not present.

The better you documentation, architecture, and R&D data is, the better a project can grow without getting messy, but mess is inevitable.

So it’s always good to do regular code reviews, end-to-end regression testing, and reevaluate older code and architecture in the light of newer development. If you build things more modular from the beginning, it’s usually easier to refactor older modules in isolation as part of cleaning up a project. But sometimes it’s just good to do a whole overhaul and increment the software version to the next integer.

AI is so much faster at writing code, both good and bad, that these periodic refactors and reflections are much more frequent. So don’t ignore them. It’s a huge investment in your sanity and your project’s health to do this regularly.

If you’ve been disciplined and invested the architecture and engineering, the overhaul may actually not be very intrusive. If it’s been a kind of ‘AI make this for me, make no mistakes’ project, it’s probably gonna be a complete refactor…

One thing you might do is if you’re using cloud provided models for the main work, you can have your local agents do constant review work for you as supervision. That could help you stay on top of the fluctuating code design drift without having to read every single line yourself.

6 points

Yes. More than a bunch of devs doing bandaid fixes for years? Yes, and at a much faster pace. AI has a big entropy problem, and the longer you let it do its own thing without correction, the more slop it introduces.

This is why people get shitty about AI slop. An experienced dev will keep things on track and correct the AI. Vibe coders just listen to the AI and do what it says, which descends into slop fast. You can ask it to correct problems you see, but the mess under the hood gets worse and worse, and eventually when you ask it to fix something, it has to refactor the entire app to get one function working.

Personally I pseudo code everything and let the ai fill in the gaps. AI is an intern, not a dev.

4 points

If you don't control drift and just blindly merge all PR's. But even then, you're rolling dice, so may be good, may be crap.

I control it by not doing that, and by occasionally reviewing my project for drift. I start out with a clearly defined plan to test/compare against.

Same was true before AI, I'd still end up with drift, albeit I was more involved in each line, and it was more obvious.

3 points

Unskilled programmers and people with poor project management skills are going to end up with poorly managed projects, regardless of what tools they use to implement their code. People that take the time to set rigorous testing standards, document their code bases, and keep up on regular housekeeping can maintain good code bases.

I have worked in small startups and BIG companies with tens of thousands of devs. They all had shitty projects and great projects. What saves a project from going to crap is people that are rigorous in maintaining standards. Not having the most extreme hygiene in test standards is the number one indicator that your project is going to be garbage.

3 points

If you don't know how to program, and you don't know how to architect programs, then yes. If you have those skills, and you know how to use the AI tools, and to review their work, then no, that's not a problem.

3 points

I believe so. However, you have the option of developing a bible with relevant information - and with a future, better AI model, ask that model to 'port' over useful information, such as design goals or why certain implementations were used, and start mostly fresh with a brand-new codebase.

IMO, we will see total rebuilds of software becoming an annual practice used by AI developers. The purpose of humans is to plan the product, consider edge cases, and QA, while the AI simply keeps working on making a new iteration of a concept into reality.

Unlike the hairless monkeys, AI can tirelessly work through the nights and weekends. I expect we would see the AI presenting 3-7 permutations of implementation, asking which the human developers think offers the best outcome.

3 points

I find it is best to start with the project documentation, such as the requirements and design documents. Figure out as many edge cases at that stage.

By the time you start writing the code, the structure is set.

2 points

I would say probably. Think of AI as an SSD. It does not need fragmentation because it knows where everything is, but if you wipe that partition table, you are kind of screwed.

2 points

Every so often make a session and ask your model to perform a complete code review and focus on readability, code structure, separation of concerns and error handling.

You can put the coding guidelines into your agents.md or similar, but it's still helpful to do it every so often

1 points

Yes but ask for a feature inventory or to break the application up and then have it do one piece at a time because otherwise it’ll miss a ton of stuff. Opus is pretty good but it misses stuff all the time. You can use a smaller local model and ask it to review the same areas and ask both to review the other’s work as a way to get a more detailed review. Qwen and Opus have been working well together like that for me.

2 points

Not a general thing but mostly yes. If you are not a developer and if you are not actually following what's going on I would say yes.

But there are a few repos and skills to lower the chances of messing up but it still happens.

1 points

Yes if you don't review and test each revision, I've made so many vibe coded projects a lot I use in my own personal home server but the one thing I never did was blindly never look at the code OR give random scripts wifi access, in addition LLM's love using random libraries from people to save time so make sure you also are creating a lot of your modules from scratch ones you can trust and forget about or if you do have to come back do slight tweaking.

1 points

I let AI rewrite a vibed, IMO too large C++ codebase (50-100k LoC, half tests) cleanly from scratch in golang and it became 30-40% bigger to my surprise, despite plenty high level architecture requirements. I think you have to spend a lot of time/tokens refactoring vibed programs - which isn’t actually different from normally written code.

1 points

After every major sprint, make the agent clean up and refactor the code. There are skills for this. Human coders have to do the same thing.

1 points

I think scope has a big part of it. For smaller projects astra or fable can sort things out pretty quickly.

1 points
  1. AI plans a feature
  2. AI implements according to plan
  3. Preferrably different AI reviews or you review
  4. Make improvement round based on review
  5. Repeat max 10 times
  6. AI plans cleanup and simplification
  7. AI implements the plan
  8. You review (or different AI, if you cannot)
  9. Avoid sloppetyslopslop

It sort of works. You can even use same model for review, because LLM is not deterministic by default, so it will be able to find real flaws in its own work.

1 points

yes, as a project grows debt accumulate, is harder for models to grasp full context of a given feature and sometimes you ask for a fix that model applies only on a specific part of the code without fixing it on all instances...

sometimes llms forget to create tests, or create poor tests that it thinks are great, or ir forgets to hook an event or function call...

even expensive models such as opus 5.5 make small mistakes sometimes that add up overtime

i still cant 100% trust llms for large projects

for small to mid projects its perfectly fine

1 points

Spend a lot of time at the beginning building the architecture and tools for success (DAG enforced contracts, config based design, linting, CI and CI enforced linting, unit tests, edge tests, regression tests) and you maintain a 2:1 ratio of debugging/hardening PR’s to feature building PR ratio, you can absolutely vibe code really good apps. My GitHub is full of apps and projects that have all been vibe coded, just with more up front organization that is maintained over time.

Here’s my GitHub, feel free to use any of my projects as reference architecture with AI.

https://github.com/Rsan0948

1 points

or asked differently, could you make an ai do a clean new iteration over prior mess for better output?

1 points

If you know how to architect things, then no. AI can create a mess but it can also clean up that mess much faster. Just pure vibe coding where you don't know what you want and don't know how to put the pieces together. That is just evolution and yes it can be messy.

1 points

Yes. It’s a constant struggle even with human written code but AI makes it substantially worse. You need a combination of strong linting, architectural and code quality rules as well as appropriate human review. LLMs are getting better at deciding what and how but they still have atrocious taste. Over time failure to keep standards high can lead to bugs, poor performance, security gaps, and higher cost for changes (more token spend, bigger PRs, more churn, etc).

Handle it by crafting strong rules and enforce as much as possible deterministically. Define architecture rules and patterns up front. Do periodic sessions to seek and purge tech debt. Manually review code, ask the LLM during code review to seek out bad architecture, new patterns, unnecessary complexity. 

Add a rule about paying down tech debt to your PR template. Force the LLM to consider it: “We have a mandate to pay down tech debt with every PR. In what way does this PR address this?”

1 points

If you're lazy or lack sufficient understanding of code to keep it neat, yes.

From my experience non-coders tend to be lazy about this because you don't know what it's like debugging someone's spaghetti code from 5 years ago and wanting to choke them.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.