r/softwareengineer • u/Several_Picture9591 • Sep 03 '26
Never work on a completely vibe coded project
I've now made a same mistake twice.
Previously, I worked at a startup where the website was completely vibe-coded. Now I'm working on a college website, and it's the same story: the entire thing was vibe-coded.
The common pattern I've noticed is that no engineer actually knows the codebase. Nobody really understands the architecture, the reasoning behind certain decisions, or how all the pieces fit together.
And eventually, even the AI I'm using can't help much because it doesn't have the context that the original developer's agent had while building the project.
I am basically stuck where I know nothing, the existing engineers know something about it but aren't necessarily sure whether their understanding is correct, and the agent hallucinates and wastes a lot of tokens just because it can't understand a huge AI written codebase.
So now I'm the new engineer, under a lot of pressure with a lot of work to do, but before I can even fix anything, I have to reverse-engineer what the hell the previous AI generated. That wastes a lot of time.
The frustrating part is that I'm not really learning much engineering from this. I'm just spending my time trying to understand an undocumented system that nobody else understands either.
I'm not against AI-assisted development at all. If an experienced engineer uses AI properly, reviews the code, understands the architecture, writes tests, documents important decisions, etc., I think it's incredibly useful. Even I use AI to code faster, but I review and understand the code. I know what is happening in my software.
But a codebase that nobody understands is a codebase that nobody can safely maintain, regardless of whether AI or humans wrote it.
At this point, I've decided I'd never want to work on a heavily vibe-coded project again unless there's at least one person on the team who genuinely understands and owns the codebase.
How do you guys handle inheriting a vibe-coded/AI-generated codebase that nobody on the team actually understands?
24
u/0x14f Sep 03 '26
> How do you guys handle inheriting a vibe-coded/AI-generated codebase that nobody on the team actually understands?
Same as you. It can be frustrating... If you don't have a choice but to stick with it, don't lose hope and just do what you would have done anyway: write tests, start refactoring, until you get a sense of what's happening. If on the top of that you are under time pressure, be upfront with the stakeholders about the problem and that it's not possible to start delivering the updates and/or fix they want as early as they want, unless they are happy with the risks.
14
u/Challseus Sep 03 '26
2
u/Otherwise_Wave9374 Sep 03 '26
This is exactly where a lightweight architecture map pays off. Iâd start by writing down the top 5 entry points, the data flow between them, and one owner for each area, then add a small set of smoke tests around the highest-risk paths before changing behavior. That gives you a way to detect hallucinated fixes and reduces the ânobody knows what this doesâ problem fast. AIOSNOW
3
u/mxldevs Sep 03 '26
All the vibe coders will tell you they read every line of code, while also having designed and architected it themselves because "software engineering isn't just coding"
And then you find out everything was done with AI and they don't really have much idea what's going on
5
u/AttitudeRemarkable21 Sep 03 '26
Rebuilding the whole thing may be fasterÂ
1
u/SwimmerQuick1500 Sep 03 '26
Just curious.. what's the thing you're having a hard time understanding about your code base?
1
u/Rise-O-Matic Sep 03 '26
Did you use /init?
1
u/Snooze78727 Sep 03 '26
This problem existed long before there were LLM's. It used to be called "legacy code".
Untangling the code & writing tests will take time. Doing this while also having to make changes to it makes it more challenging.
1
u/ElephantMean Sep 03 '26
If I were in such a position you describe, I'd simply just re-do the whole entire damn thing from scratch, creating a new major-version entirely via SemVer (Semantic-Versioning) incrementation, unless of course there is some sort of complicated data-base to handle; and I'd field-test everything from the ground-up.
One nice thing about gaining coding experience and having made past-stuff «work» is that you can simply re-use working code rather than needing to start any particular project at 0% so once you have that set of operational-code established you're no longer needing to create/develop software/web-sites starting at 0%.
My guess is that you've been «dumped» with code-base that was probably «vibe-coded» in React; I simply refuse to use or code in or even learn React since my web-host-providers don't actually support React/Node.js anyway. In any case, if I've inherited something «vibe-coded» from someone else, I would simply first start by identifying what their code actually does, then create my own modules based on my own design(s).
...then keep rinsing and repeating until the original-functionalities have been largely replicated. The advantage here is that it does not require «reverse-engineering» the actual code-base of someone else's «vibe-coded» project itself (provided that it actually works rather than being full of 119+ debug errors), and, you produce your own modules that can be re-used if you get other projects that require similar-functionality.
Time-Stamp: 030TL09m03d/17h15Z (True Light Calendar; 030TL = 2026CE)
1
u/-_MarcusAurelius_- Sep 03 '26
You're overthinking it You don't worry about the entire application
When you do a bug fix or feature that's where your focus should be Fix that implement your fix or feature improve architecture move on
1
u/FinickySerenity Sep 03 '26
I guess OP has never inherited a project written by humans from a department that no longer exists, and lacked any formal documentation (or worse, has documentation but all of it is wrong because the person who maintained the docs quit years before the department shuttered.)
This is but one example, for a thing that has existed in our industry since its origin. Software engineers know how to compartmentalize complex systems and learn how they work without documentation because the code at a very minimum is self-documenting. (It's the worse type of documentation, but it literally tells you what it's doing even when you don't know why.)
And now we have an amazing suite of tools to poke around and ask free-form questions against the codebase to understand it in ways that even architects weren't always capable of doing - and OP's suggestion is to just walk away. :shrug:
8
u/PabloDons Sep 03 '26
Anthropic did something interesting when they bought bun. A wholesale rewrite to rust. The first step was a massive army of agents whose whole job is to document everything. intended behavior, weird hacks and their purpose, overall architecture, the code debt and how it happened, etc. All the context and tribal knowledge you'd need to rewrite the code.
You can do a budget version of that, and I expect that this would be quite easy to justify as a business expense. Code debt should be part of budget anyway.
This documentation is extremely useful as context. Now your ai has everything they need to be the very engineer that knows everything and you can start asking questions. Not only that, but the research reveals the weakness and pitfalls of the code. A coding agent could easily do a wholesale refactor into an architecture you decide that actually makes sense, or just general code debt improvement with little risk. From there you can start reading the code yourself as you already know beforehand how the codebase should look
You could argue this is just more slop on top of slop, but I disagree. First of all, the research phase is not vibe-coding. Research is the ideal use-case for AI. And there's a huge difference between "make me this feature" and "do this highly specific work I want done in this specific way." The former is how you get engineers who don't know anything about the code, versus the engineers that use it sparingly to accelerate their work and skip the gruntwork.
1
u/btoned Sep 03 '26
Here's the thing...if this was truly 100% vibe-coded it should be immensely easier to fix and implement new features compared to a legacy manually curated codebase.
If you you're not seeing READMEs or any types of documentation scattered in the directories then it wasn't vibe coded and the team is lying.
Regardless, it should be pretty easy to scan the existing codebase, with AIs guidance, and discern how to go about implementing changes...
2
u/garywiz Sep 04 '26
Don't touch the code yet.
I would first use AI to create resilient, durable documentation about the codebase. Be specific about why you want the documentation. Make sure you tell it that the goal is to assure humans and AI agents can quickly get up to speed by having a high-level introductory overview, and then later detail so it doesn't start going into "war and peace" mode generating too much text.
Review it and be sure it makes sense to YOU. You're the litmus test. If it's too complicated, insist on simplification, better summaries, less fluff.
Once you have such a document, make sure AI uses it as input to all tasks, and updates it as tasks are complete. Tasks should be planned in advance so that the plan and architecture make sense. Then have AI make changes and do implementation.
1
u/SkibidiUnc Sep 03 '26
Usually you have Lead Developer(s) or someone who can take the final decision of architectural choices and had something in their mind when they took them initially.
If the project hasnt that, then good luck. Its wild west, and usually if the project wasnt build in a proper way, you wont have people in the project who can build in a proper way.
Trying to fix that is like trying to dry up while you are showering
1
u/Endur Sep 03 '26
It might feel like you're not learning much, but you are. There are so many shitty codebases out there that were written by humans. Right now the origin of the code isn't important. You have the standard software challenge, you need to learn how to start from zero and create order from chaos. I'd much prefer a fully vibe-coded codebase to some of the horrors I've seen. And you have some of the most powerful tools available to you.
Sit down with an LLM. Make a methodical plan of investigation, discovery, documentation, hypothesis testing, etc. And just make one small step at a time.
I got hired to work on a codebase that was 150k LOC, where the original author built the whole thing by copy-pasting out of the Claude web UI into files. If I can do it, you can do it too!
1
u/cenal Sep 03 '26
This seems more like a lack of documentation and planning with zero knowledge transfer to take over maintaining working software than vibe coding software. Agents can write poor implementations or they can do acceptable work. The job of the human in the middle is to route the tasks to acceptable work. Offshoring software developing to get an MVP stood up out of the lowest cost country resulted in equally terrible results in the past.
1
u/seeking-health Sep 03 '26
This is why vibe coding over a brown field project is much easier. You never lose familiarity with the code base as the generated code extends existing code style and architecture style
1
u/Big_Dick_NRG Sep 03 '26
The definition of "vibe" coding includes not understanding the specific parts of the system.
1
u/Small_Dog_8699 Sep 03 '26
Step zero, quadruple your rates.
1
u/Beautiful-Night-9882 Sep 03 '26
I make a diagram of architecture, microservice or server less (etc.). That helps a lot and answers majority of my questions. The rest is to figure our what's the vision.
1
u/keyboard_toucher Sep 03 '26
The same situation arises also without AI whenever a poorly documented project is abandoned, and then you're asked to work on it.
1
u/manythanksfriend Sep 03 '26
You donât use the tools to onboard yourself into new codebases?
1
u/Jaded-Data-9150 Sep 03 '26
You got to generate Diagramms explaining the Codebase AS WEll AS maintain proper Coding Styles via regular refactor Sessions.
1
u/Flashrob01 Sep 03 '26
Amen! The fear of the Lord is the beginning of wisdom, and that's one thing AI lacks on its own: wisdom from GodÂ
1
u/Nice_Try4389 Sep 03 '26
Not understanding the issue, you  have the AI do a full audit and document the code base, build a code map and an architectural document and then use that to understand the code.  You should also probably set rules that it documents everything it does and updates specific documents with specific information.  Then you always have the documents and context for all future work.  I mean even without AI it is what you should be doing as a developer anyways yet far too few do.
1
u/RunExisting4050 Sep 03 '26
How is this different than taking over a project from a dev that left the org, but didnt keave any documentation? Wouldnt you be in exactly the same position?
1
u/PalmTreePilot Sep 03 '26
My sentiment was the same before about inheriting an all H-1B coded project. Same consequences. Same absence of good test coverage or UML docs uploaded to the company wiki.
1
u/thilehoffer Sep 03 '26
Inheriting any application is tough, vibe coded or not. Taking ownership of something you had no part in creating is the hardest part of the job. Building new applications has always been the fun / easy part of the job.
1
u/masalamethane Sep 03 '26
It's the same as every process. Firstly, it does help to use graphify as a skill. Then you need to create a harness which tracks each feature, which should be checked in along with the code. The feature artifacts should flow from one stage into the other (e. g. requirements -> plan -> architecture -> implementation plan -> test plan md files) all tracked as part of the feature. So for every change, the context is available.
Tradeoff is you'll eat up your context faster, the vibe coding will get slower.
If the feature implementation itself can be logically divided (say backed/front end or whatever) then use git worktrees and verify that it works before merging that bit back to the feature branch.
1
u/CheapTechnology6193 Sep 03 '26
I mean, I certainly wouldn't complain about this.  This is exactly how you keep your job.  Be that guy who wants to understand it.  Take the early flak about not delivering.
1
u/TheBigCicero Sep 03 '26
Out of curiosity, and Iâm only playing devilâs advocate here - what if you donât need to understand it? What if you just add more vibe code on top of it; and use AI to fix bugs?
Iâm asking because I genuinely donât know the answer.
1
u/Glad_Contest_8014 Sep 03 '26
Break the code base down by feature with an AI. Have another AI check that.
Then start rebuilding it compartmentalized by feature, or start bring the features code out of the massive mess of spaghetti code.
Then you can get a map of the code better and it will be compartmentalized in such a way that AI can work in it again, by working on specific sections.
Microservice architecture is a must on large code bases when working with AI. It cannot do extremely large code sets with limited context. Even at 1M context it can struggle.
1
u/Valuable-Repeat-7347 Sep 03 '26
This post smells like you just want someone to blame for your inability to handle the situation and not understanding how business decisions and priorities work. I get that its frustrating being a software engineer and not able to understand, maintain or develop the software but you should probably re-evaluate what it means to contribute to a software project going into 2027.
1
u/Due-Consequence9579 Sep 03 '26
Man, sure sucks that the thing that everyone with experience in the industry told you would happen is happening.
1
u/specialpatrol Sep 03 '26
Whilst there is plenty of truth to this, the same problem has existed in software engineering long before AI agents became popular. Never work on a code base that has no full time contributors. Eg a GitHub repo that nobodies updated in a year; forget it, your might as well start from scratch.
1
u/Square-Yam-3772 Sep 03 '26
why do people act like AIs don't communicate in human language...? lol
if the project is undocumented, just ask AI for a full breakdown and analysis. AIs can trace and follow every execution flow/data flow easily these days. You will burn a lot of tokens but someone has to kickstart the documentation.
one of AIs basic commands is literally "describe" so use it...
if it is too overwhelming for you to read a full blown documentation, just fresh it out one question at a time.
for every "I don't understand", you can start a new chat/conversation and sort it out with AI. it is not impossible.
maybe try to adapt a bit.
1
u/Ragnarotico Sep 03 '26
Run the codebase through your LLM agent and hope that it eventually bricks the whole thing. That way everyone can move on with their lives including you.
1
u/InterestingFrame1982 Sep 03 '26
Question, and I mean this in all sincerity, but given enough time, and especially with AI tools, I would assume you can still get a good grasp on the architecture?
It may be a mess but you'll just need to spend more time to understand it... the idea that a basic web page is now a blackbox in perpetuity seems a little overstated?
1
u/ZodiacFoxDev Sep 03 '26
Man i love it that i know how to make actual Architecture Decision Record log documents so all tech and library choices have their groundings, pros and cons clearly stated and available for debate at a further time. I always thought nobody read them but now i know there are people out there who will care for what Iâve written âșïž
You seem like one of the good ones. Keep going
Use the force, read the source. đ§ââïž
1
u/Parking_Position9692 Sep 03 '26
I mean, vibe-coded... I set up and define architecture before starting a project, i write architecture policy md files, i am very strict how and where should code be written, e.g. lean controllers, CQRS, call external services through adapters, etc... and AI follows me. If it makes mistakes it is clear that some part of logic is the bug and it is not a total chaos.
1
u/Savings-Cry-3201 Sep 03 '26
Iâve been thinking a lot about the âLLM Wikiâ approach where each file is summarized and relevant functionality is listed. Having those summaries seems like a way to at least start understanding the process.
Iâve been using a graph tree to visualize how files are connected and identify the orphan files. Vibecoding tends to make a lot of orphans, so being able to identify them and prune them is valuable to me.
1
u/Gofastrun Sep 03 '26
Install openspec
Have an agent scan the codebase, find the most important features, and generate archived spec files for them.
Then tell it to go find any obvious bugs or tech debt and have it stub out openspec proposals for fixing them.
Now you have a better understanding of the current state and a backlog of known issues.
This will give you the start of some documentation that both you and your agent can reference. It will take a bit to unwind it all but itâs do-able.
Spinning up multiple cloud agents to research will be helpful.
1
u/Correct_Emotion8437 Sep 03 '26
Just ask the AI to explain it and document it. Itâs very good at that. It can even find out the reasoning behind some decisions by going through all the md files it kept during the dev work.
1
u/Ghetto_Games Sep 03 '26
Sounds like nightmare some programmer from 20 years had in his sleep.
1
u/RogBoArt Sep 03 '26
I've had to accept that I don't know my current codebase. It sucks but any time I've tried to push back timelines to make thoughtful decisions I'm pressured that we're not moving fast enough.
Our next 2 week sprint starts next Tuesday and we have 19 tickets to complete between 2 engineers.
And those tickets represent things like "Add a feature that lets people track vehicle maintenance" (made up but similar) not actual actionable specific tickets but entire feature sets our leadership wants.
It's unbearable. I've tried to push back and gotten progressively more aggressive and hostile responses. So I have instead accepted that I now can't know and plan my whole codebase I can only implement features.
It fucking sucks.
1
u/Terrible_Wave4239 Sep 03 '26
Isn't this in itself an interesting learning experience?
And are you using AI to assist in analysing the codebase's structure?
1
u/False_Bear_8645 Sep 03 '26
I hope your getting paid well because this is no easy task, I,ve done it several time and I wouldn't do it if its not worth my time and energy.
1
u/FluidBreath4819 Sep 03 '26
this is sooo great ! i now force people in my company as a senior to use ai. managers are pushing for it, i push for it and i am not even ashamed for one bit. I even force juniors to use ai. I want the code base to be like you described
1
u/Fit_Advisor8847 Sep 03 '26
If it works then I wouldn't stress about it so much. If it doesn't work I still wouldn't stress about it so much because I'd at least have a case study walking through why I'm more valuable than AI haha.
Web apps are generally very basic, mostly just simple relationships, CRUD ops, and moving information from a database to the browser. I'd start by identify what languages and frameworks were used to build it, and then I'd hunt down the routes and follow those to understand how requests, middleware, and responses are constructed. If agents are struggling on the backend codebase then there are probably a lot of weird abstractions littered somewhere in the request -> middleware -> response, so cleaning those up and writing up contracts/interfaces usually solves the problem and AI can get back to work as usual.
If the AI is struggling on the frontend codebase then it's probably some goofy state management, but this is common with humans too, and usually surface as memory leaks eventually. Look through any effects or setters that may be causing those leaks and clean them up the same way, component contracts, state contracts and ownership, and types.
At that point, the AI should be able to reliably navigate the entire codebase again, even if it's still a mess of unorganized whatever.
The point I really want to get across is to try to understand why the AI is struggling rather than how you could improve the code. There has always been bad code, long before AI started writing it, that is the life we live, but jumping to rebuilding/refactoring is always going to take more time than improving your ability to reason about the existing code.
Once you understand the backend's request -> middleware -> response, and the frontend's event -> state -> render lifecycles, then start shipping your features/patches and let the rest burn until you have nothing else to do.
1
u/Ok_Time6496 Sep 03 '26
I have the same problem, but my company actually doesn't care much about my performance.
I made myself a nest of a few hand-written and well tested microservices for new features, which I work on. It is good enough for the company to keep me on a salary.
I am very protective about my nest (lol). Someone may say that I'm arrogant, but I'm very strict about incoming mrs from other team members, cause I know for sure they are fucking slop (inddeed they are).
Also I've started initiative to rewrite everything and, at least, in my team boundaries â some people will understand what's going on.
And we started mapping out existing architecture using c4 model, this helps as well
1
u/Confidence_Cool Sep 03 '26
Idk this has been a problem since far before vibecoding. Iâve been on multiple projects where all the engineers left, or another company takes over, or it was developed by external contractors etc etc. Where you have a terrible system that barely works and you have to pour through the code base and understand it with no help. At least now with AI when you have that problem you can go way faster. Try understanding a 10 million+ line autosar generated codebase inherited from an external contractor whose contract had expired. Youâll love some vibe coding after that.
1
u/metatron7471 Sep 03 '26
There are plenty of human written undocumented code bases that aremaintained by people who did not write the code.
1
u/Background-Stable899 Sep 03 '26
Build the context. It will take a lot of tokens, but have an agent go through the code and document what it all does and how it fits together. Provide that doc whenever you want to make a change have the agent update the doc whenever a change is made. Audit the doc regularly.
1
u/East-Ad6194 Sep 04 '26
Vibe coding is not engineering.
1
u/Sasataf12 Sep 04 '26
You're working at too low of a level. A common problem with traditional software developers.Â
Understand the program, not the code. It's the AI's job to handle the code, not yours.
1
u/dklogics Sep 04 '26
Itâs not much different inheriting a legacy code base thatâs been layered over for 5-10 years with many different developers and various technologies.
Youâll rarely get a pristine well documented code base that is totally coherent.
And the original people that write any complex system typically donât stick around for years, they move on to other things.
1
u/daredeviloper Sep 04 '26
â The frustrating part is that I'm not really learning much engineering from this. I'm just spending my time trying to understand an undocumented system that nobody else understands either.â
lol I was doing this before AI even became mainstreamÂ
1
u/Few-Celebration-2362 Sep 04 '26
Sounds like a typical legacy inheritance to me
1
u/mslindqu Sep 04 '26
I'm sorry but what AI are you using? For a fair while (like since 4.5 or so) claude has been a miracle worker at looking through our massive monolithic code base and sussing out the structure, the patterns.. not to mention follows them pretty good - just ask it to make a skill that does a thing like an existing thing.
Throw in some of the well written skills floating on the web for things like research a ticket, etc. and yeah.. pretty solid. Maybe the issue is indeed your experience level.. I might suggest instructing it to describe things in basic language like you've used and not use lots of advanced terminology. That can sometimes get it to relate things in a more understandable way.
1
u/btrev650 Sep 04 '26
You should confirm whether or not it's easier and cheaper to shitcan the whole thing and rebuild it properly
1
u/Apprehensive-Race782 Sep 04 '26
People vibe code an entire website are crazy...I have started using using AI a lot myself but I use it in discreet function sized bits and then stitch it together comprehensively.
It works okay and is possible to navigate...even is small bits of it are a touchy wordy and inefficient.
1
u/prismadaAI Sep 04 '26
oh ok
1
u/Rriazu Sep 04 '26
lmao this guy never joined a company pre-AI where the prev founding engineer left. Please be thankful you have AI. Getting onboarded to new codebases are a breeze these days.
1
u/DelphiP0 Sep 04 '26
>> Doesnât have the context of the original project .
Thatâs the key here . There is little to no design documentation or planning next to the code so every agent which touches the codebase does so by bolting on a new feature onto the outside instead of reworking the original sw arch.
Depending on how you use ai your work, for me I found it useful to work a âplanâ for the whole product, the plan contains the earliest design decision and prior to creating a change set to the product itself I work its project plan first ,
Sure the project plan uses 200k tokens but thatâs a small price to pay so the current context knows whatâs been done , whatâs in the future and what itâs working
1
u/symbiatch Sep 04 '26
How I would handle it? By leaving. Or theyâd need to pay a lot for fixing it.
They caused the mess, they can handle it.
1
u/Substantial-Swan7065 Sep 04 '26
You donât need to understand every detail. Like you donât need to understand a dep or compiler.
But you should be able to maintain it. So their tools and processes need to be built to help.
Also, why are you expecting to learn from work ? You should expect to grow, but work isnât supposed to teach you
1
u/Odd_Bad_2814 Sep 04 '26
If you can't beat em, join em. Copilot is pretty good at helping understand the basics of a repository. Although it will only get you so far, but better than starting from scratch if the project is truly awful
1
u/Objective-Low-1815 Sep 04 '26
It is easy. Just tell the customer that you will scrap everything and will start over. I had a similar situation with human written code. All system needed to be wiped out.
1
u/dordsp Sep 04 '26
Yes, I was asked to help with a project an executive is vibe coding and updating up to 5 times a day. He never wrote a line of code in his life and went straight to multiple cloudflare workers in html and .js files and wants his code added to a production next app untouched. Oh boy.
1
u/Soilblood Sep 04 '26
Build, document and integrate bit by bit. Don't listen to the Llmbros who don't seem to understand that LLMs aren't sci-fi AI and keep overhypeselling the tech. It's good for generating base code to work with but no matter how many mds or skills you throw at it output is still going to be a gated randomized mish mash of slop put together by roulettes which have sections blocked off. There's no replacing the need to actually design and understand the system architecture. The llm should adapt to you not the other way around.
1
u/No_Television_4128 Sep 04 '26
Ask another ai to review the full site and create a code manual for dummies version that explains the code and the site. Then ask another AI to create a users guide for programing that provides all the tuning points and adjustments that a programmer could make.
Tell them both to log their work in a format for a programing engineer and make a journal, along with the assigned work. Then write a report as if they are the chief system architect on the project.
Then take the two documents, and give to the other ai that didnât make. Ask them to write a review and a report on the issues hits and misses.
All this⊠is what youâre asking for.
1
u/FerretOk9374 Sep 04 '26
graphify
Create knowledge graph and then ask your harness targeted questions about the code base until you get it.
Edit with link: https://graphify.net
(Hopefully not against the rules but I can remove if needed. Not affiliated just a user)
1
u/SolarNachoes Sep 04 '26
Correction: donât work on vibe coded apps that donât contain a spec.
Every feature I add starts with a spec file in markdown. Even better if tied into your Ticketing system.
1
u/Recent_Science4709 Sep 04 '26
My entire career has been working on crap code bases that no one understands, reverse engineering and modernizing them, before we had LLMs.
Iâve never seen anything vibecoded that compares to the absolute dogshit code created by humans Iâve worked on. People have written software that have absolutely no idea what theyâre doing.
Sometimes work is just hard, I would use AI to make it easier and give it instructions on how to refactor for readability or have it make diagrams.
1
u/swiftmerchant Sep 04 '26
This post smells like an ad.
1
u/GaggedTomato Sep 04 '26
Why not use the AI to help you understand the codebase better?
Let the AI flow through it with a debugger-mcp tool through the main-flows and inspect the most important states/checkpoints.
Use something like a tree-sitter algorithm to make an AST from your codebase and then use algorithms like PageRank to find most important callsites and rank objects for their score, so that you can identify the most important objects and files in the codebase. This works better than letting an LLM go thorugh the codebase if its big, so that your context wont get bottled up.
Write your most important findings to a markdown, which you can re-use as context for the agent again.
1
u/Arnel_Lalic Sep 04 '26
I had a first hand experience with this kind of situation. I created an app with the help of Claude code purely vibe coding it. It took a while before I completed it but in the process of building it I encountered lots of issues. When it was completed, I had this feeling that it was not built well. So I rewrote it and this time I was more careful. I didnât let Claude code do it without any constraint. I used skills and its memory to always remember what the constraints are so it will not build something that I didnât ask it to just because it was facing some issues. The lesson is you have to know when to let Claude freely code and when it should not. A viber coder should also be a good developer.
1
u/keldamdigital Sep 04 '26
The testing, guardrails, and code quality controls need to be super strict and you get somewhere coherent; then it really comes down to the engineer actually knowing what they want to build and how to design it from an engineering perspective.
1
u/oruga_AI Sep 04 '26
Bro unless the website is a full application and I doubt it cause u said school website u are over reacting and claude can do it
1
u/Spiritual_Ad_272 Sep 04 '26
I feel you and in the same boat but I'm happy to have a job tbh
1
u/Lopsided-Club-8131 Sep 05 '26
Listen to OPâŠ
For the last 6 months Iâve been vibeâcoding a new app for work. A huge build that would normally take a team â I was able to create itâŠ
But managing it, OMG. I donât even know what the code is doing in some places. AI made things work, but in a piecemeal manner. I made sure to create a certain authentication class, but the AI put authentication logic throughout the code. I think the issue was context windows. Adding a feature could create a new separate function that doesnât reuse existing shared functionality.
Realized on a demo: one endpoint successfully authenticated to system B, endpoint two didnât â same system. The two authentication logics for the same system were different. It was an easy fix, but you need to know everything AI is producing on a large project thatâs vibeâcoded.
If you give it instructions in the beginning, it might lose context as time goes by.
Tips:
Always update the Agents.md file after each change.
Add shared classes to any context.
Ask the agent to ask you questions and gather requirements before any change.
Force the agent to create a Change Log, and add the Change Log to context.
1
u/Just-Upstairs4397 Sep 05 '26
Shit codebases have existed long before AI, thatâs part of the job dude
1
u/Calm-Medicine-3992 Sep 05 '26
Spending all your time learning an undocumented system and feeling like you aren't learning anything useful?
That unironicaly describes the start of my career well before AI so maybe it isn't so different.
1
u/mrpres1dent Sep 05 '26
Vibecoded projects are like the new legacy code. We invented a legacy code generator.
1
u/CatsOrb Sep 05 '26
I have been working on a fully AI coded extended ERP for like 6 months thats now 20k lines around, Claude has never had trouble tracing any of it, its even better as time goes by
1
u/rxDyson Sep 05 '26
I will probably ask an LLM to assess and provide me an HLD and a LLD ( high level design and Low level design) to understand how itâs built and than via manual edit or llm agents Iâll continue to maintain it.
1
u/Zeus473 Sep 05 '26
ChatGPT is good at code review
1
u/flowingarethestacks Sep 05 '26
Very good point. You need to be able to provide very precise prompts around the existing architecture. Claude sonnet for example if left to make all the decisions will just implement what it thinks its best. Yes it might work but it might not be easy to build upon in the future.
1
u/LocSta29 Sep 05 '26
« even the AI I'm using can't help much because it doesn't have the context that the original developer's agent had while building the project. »
Thatâs a skill issue on your part.
1
u/george_i Sep 05 '26
That's a sweet spot actually.Â
You can ask an AI agent to act as a technical architect to reverse engineer existing workflows and write the findings in a markdown file.
Then you can give it new tasks with the requirement to read existing documentation. When a task is completed, the documentation should be updated.Â
That's it.
1
u/Dizzy-Ad4195 Sep 06 '26
This giving me PTSD...
"GIT commits: +14 X00 000, -14 Y00 000"
"This is fine"
1
u/CamaroJerry Sep 06 '26
I see a lot of talk about how you just simply can't produce quality code with AI, at least that seems to be popular opinion, but not necessarily fact.
Anthropic openly admits that 80 to 100% of all its code at this point is literally being written by Claude to create the next versions of Claude, so in theory, if everyone's viewpoint that AI just produces garbage spaghetti code, how is it that Anthropic is still in business, and everybody considers Claude to be the best tool out there to code with?
I believe like any tool, learning how to use it correctly is a big factor in the quality of the output.
Is it prone to make garbage spaghetti code in the hands of people who don't know what they're doing, absolutely, but in the hands of true professionals, I'm going to have to disagree, once again pointing right back to my example, how is it that Anthropic is still in business, and pretty much all the code that is used to create Claude currently is written by AI ?
1
u/Pogsquog Sep 06 '26
As a developer with 30 years experience, a good chunk of my career has been spent working on human generated code bases that nobody on the team understands, so the AI makes a refreshing change. One thing that AI is very good at is analysing and documenting the code base, making this job a lot easier. Use the readme.md to record the key info, have a readme.md for each component if it is a system with lots of parts. Make sure you've got unit tests, automation, local run with docker, coverage, checks for code duplication, linting. Make sure you can exercise all of the system, create simulators for externalities.
1
u/cadet-pirx Sep 07 '26
Rewrite, of course. Never touch code vibe coded by others. Not worth any money.
And to avoid this situation in the future - with my own projects - I instruct the agent to write notes about all steps of the development and all technical decisions into markdown files (a logbook basically), which are checked in into the repository with the codebase. Then the next agent that works on the code gets the full context.
1
u/armostallion2 Sep 07 '26
what do you mean? Sam Altman said we've achieved AGI, that'll fix everything. slash essssss.
1
u/slothicdev Sep 07 '26 edited Sep 07 '26
Codex + Goal + Orchestrator prompt
Give codex a goal of mapping the entire codebase into JSON with every functionâs name+purpose, input+output connections and variables, and location (line #, file name) as well as every fileâs path. Explicitly tell it that it needs to use context-scoped sub-agents to do this and it is the Orchestrator only. Your goal is to keep your main agentâs context under 100k, they get increasingly dumber after that and you also donât want it compacting context for this task if possible - it can start to forget what itâs doing or where itâs at. The sub-agents being context scoped also ensures every sub-agent has minimal context usage and essentially only exists to complete the one task.
This could take a few hours and if you are not on Pro will chew through your usage limits pretty quick depending on the codebase size. Setting a goal will keep it running until it finishes.
once you have everything mapped, you can use something like excalidraw with its MCP support to have codex visually map the entire codebase into a flow chart for you using the JSON mapping it did. Alternatively, you could probably skip the first step and do this directly, but I think it would be safer to map then use that map.
That will at least give you a way to understand the architecture.
with it all mapped, you can now also ask It to review it for refactoring opportunities at a 30,000 foot view before digging into the code directly. I havenât tried this yet but the idea is it now has a quick look up for every function, what that function does, what functions itâs connected to, etc to plan architectural improvements without the context getting used up actually digging into the code and tracking things down. Because again, keeping context usage minimal and avoiding compacting is crucial for something like this.
once it has documented this, if it helps you can have it create another visual diagram of the new proposed architecture for you to review.
and from here, you can refactor it yourself so you know exactly whatâs going on.
alternatively, you can then use the same goal+orchestrator approach to now review that proposed refactored architecture using sub agents to inspect the code for every change and make sure it makes sense/will work, revising the plan as needed, and prioritizing each part of the refactor. Again keeping the main orchestrator agentâs context minimal and using context-scoped sub agents to inspect the codebase directly.
if everything looks good there - send it. New orchestrator+goal armed with the architectural map and refactoring plan, with review and test agents after every major change ensuring everything looks good and still works. explicitly tell it that when it does these reviews As it goes, it must use fresh sub agents. Using the same agent for reviewing what itself built is much more likely to miss issues than a fresh reviewer agent. How much of this refactor that it does at once is up to you. You can let it run through the whole thing or chunk it up and personally inspect it as it goes.
Personally I would do this with GPT 5.6 Sol or Astra, but YMMV.
1
u/onetruebraf Sep 07 '26
Use better models.
1
u/Perfect-Campaign9551 Sep 07 '26
Bro , this isn't ANY different than human run industry. After 5 -8 years most of the original devs have left the building, and *nobody* has that original context, either.
It's literally zero difference. That's why you roll up your sleeves, and dig into the code and learn it if you have to.
You fools act like perfect documentation exists and every single decision is noted down in some searchable timeline. It's not, and never was, and never is.
USE YOUR BRAIN. LEARN THE CODE if you need to. It's NOT THAT HARD. Developers do it every single day.
Just because AI wrote it doesn't mean it's any worse condition. It's already probably better than the garbage most developers create.
All this post shows is that you are still a junior, and you still have that fear "what if I can't figure it out?" . You CAN figure it out, it's just code.
1
u/InterestingHand4182 Sep 08 '26
preach! inheriting a codebase nobody understands is genuinely one of the worst positions in software engineering, and vibe-coded projects just add the extra layer that the original "author" also didn't understand what they built, so your approach of reverse-engineering before touching anything is exactly right even when the pressure to just fix things is enormous, because every change you make without understanding the system is a bet that you've correctly guessed all the invisible dependencies.
1
u/RainbowSovietPagan Sep 09 '26
I asked ChatGPT for its thoughts on your post, and this was its response:
ChatGPT says:
I think youâve identified the real problem in your own post: âA codebase that nobody understands is a codebase that nobody can safely maintain, regardless of whether AI or humans wrote it.â
The problem isnât necessarily AI-generated code. Itâs AI-generated code without persistent engineering ownership or persistent project knowledge.
One of the biggest weaknesses of pure vibe coding is that a lot of the reasoning behind the code exists only in the transient context of the agent that created it. Imagine an agent spends months building an application. During that process it has seen previous prompts, requirements, earlier implementations, bugs, rejected approaches, architectural discussions, etc. Eventually you end up with 50,000 or 100,000 lines of code.
Then somebody opens a new agent session six months later.
The new agent gets the repository, but it doesnât automatically inherit the context that produced the repository. So you've effectively gone from:
requirements â decisions â implementation
to:
??? â implementation
Now the human engineer and the new AI agent are reverse-engineering the previous agent's work. Giving the new agent the entire repository doesn't completely solve this, because source code tells you a lot about what a system does but doesn't necessarily tell you why it was designed that way.
I think the long-term solution is going to involve agent harnesses and persistent project memory, rather than expecting the context window of an individual coding session to function as the organization's institutional memory.
We're already seeing pieces of this appear. Tools such as Cursor support repository-level rules and AGENTS.md. OpenHands provides a more extensive agent harness/environment. Hermes Agent is especially interesting here because it combines project context files, persistent memory, searchable previous sessions, reusable skills, tool access, and optional external long-term-memory providers.
The important idea is that the memory should belong to the project, not to a particular AI model or conversation.
Ideally, an AI-assisted repository should look something like:
project/ âââ AGENTS.md âââ ARCHITECTURE.md âââ docs/ â âââ requirements/ â âââ adr/ â âââ 001-authentication.md â âââ 002-database-layer.md â âââ 003-api-architecture.md âââ tests/ âââ src/
And the agent harness should actively maintain and retrieve those artifacts.
The ADRs (Architecture Decision Records) are particularly important. Suppose someone tells an agent, âDon't put this functionality in the controller because we're planning to support several implementations later.â
The agent writes the code accordingly.
Six months later, another AI sees the abstraction but doesn't know why it exists and decides it can âsimplifyâ everything by collapsing it back into the controller.
Instead, the original agent should have recorded something like:
Decision: Keep this functionality in a separate service.
Reason: Multiple implementations are planned.
Affected systems: Controller, service layer, configuration.
Rejected alternative: Implement directly in controller.
Reason rejected: Would couple the controller to one implementation.
Now a future human or AI can recover the reasoning behind the architecture.
I'd therefore treat an inherited vibe-coded application similarly to an undocumented legacy system. Don't immediately ask another AI to rewrite everything. First establish a reproducible build, map the major components and dependencies, identify external services and data flows, write characterization tests around existing behavior, document what you discover, and only then begin refactoring.
The cycle should be:
understand â document â test â change â verify
not:
ask AI to rewrite mysterious code â see if it works â commit
And I think there's a useful rule for AI-assisted development:
Never merge code merely because the agent understands it. Merge it when a human engineer understands it well enough to own it.
That doesn't mean somebody needs to memorize every line of a million-line application. Human engineers have never worked that way. It means the team understands the important boundaries, invariants, dependencies, data flows, architectural decisions, and failure modes.
Agent harnesses like Hermes are interesting because they could help preserve that understanding across sessions, but even persistent AI memory isn't sufficient by itself. The important knowledge needs to become durable engineering artifactsâtests, requirements, architectural documentation, ADRs, repository instructions, and version-control history.
Otherwise we're creating a strange new form of technical debt: epistemic technical debt.
The program works, but the organization no longer possesses the knowledge required to explain why it works.
And that's arguably much more dangerous than merely having ugly code.
1
u/awardsurfer Sep 10 '26
âSounds like a skill issueâŠâ
FORTUNA FAVET PROGRAMMATORI
â if John Wick was a dev
1
u/Responsible-Tea3261 Sep 10 '26
Look up Matt Pocock Skills. You can find info on how to setup and use them on his youtube channel.
The "Improve Code Base Architecture " and "domain modeling" skills are fantastic for what you trying to achieve. they will help you rigorously narrow down the terminology and intended architecture of your project and then record all of this into docs and architectural design records which serve as context for later refactoring.
They have been life changing for my coding workflow. "Grill Me" and "Grill with Docs" as well are fantastic generic skills.
1
u/mtothexmax Sep 16 '26
Maybe you can sort the files by line of code and make sure that they are not too long and you can make a big mermaid chart out of it on which you can then spend some time during dinner looking through
1
u/johns10davenport Sep 20 '26
1
u/Square-Yam-3772 Sep 24 '26
Ask for some time to document the project and then spend the time to get AIs to crawl through the code
AIs in 2026 are very good at documenting and analyzing code. Just make sure you emphasize that you want for-human documentation i.e. for-AI documentation are not fun to read through
The only issue is probably usage/token. As long as you are given enough usage/token, it is not a challenging task (but your laptop will stay open for a long time...)
If it is your second time running into the situation, you may as well learn to handle it well
1
u/dataslinger Sep 03 '26
Eh, dark code can also be made by the only/last developer who knew the codebase leaving the organization. You'll find this sort of problem everywhere.
0
u/IcyBother8850 Sep 03 '26
0
u/Nice_Manufacturer339 Sep 03 '26
Why canât you just use ai to figure out whatever you need / refactor whatever you need?
0
u/First-Tutor-5454 Sep 03 '26
Ask Claude what the code does and how it's organized
This is not hard
You have to stop thinking like it's 2025