I deleted 16,646 lines of AI-generated code and started over

by•

A few months ago, I started building a terminal app with vibe coding.

I spent a week giving AI instructions, asking it to implement features, fix bugs, and keep going. The codebase grew quickly. There were thousands of lines of code, a UI, and what looked like a working application.

Except the terminal barely worked.

The first Electron version wouldn't even launch properly. I moved to Tauri, tried replacing xterm.js with a custom terminal renderer, and ended up dealing with ANSI parsing, screen buffers, Unicode widths, and Vim rendering bugs.

Every fix seemed to introduce another problem. I was spending more time debugging AI-generated code than understanding the system I was supposed to be building.

On August 7, I finally deleted 16,646 lines and started from scratch.

That was when I stopped vibe coding. I didn't stop using AI, though. I still use it extensively, but I started taking responsibility for the architecture, reviewing the implementation, and testing whether things actually worked before moving on.

The project eventually became Vrykell, an open-source terminal with AI agent integration. I shipped the first stable version on November 2, after nearly three more months of development.

Looking back, the biggest lesson wasn't that AI writes bad code. It was that generating code and building a working product are two very different things.

I'm curious how other people handle this.

Have you ever reached a point where throwing away your AI-generated code and starting over felt easier than fixing it?

And if you're still vibe coding, how do you prevent a project from becoming something you can no longer understand or maintain?

37 views

Add a comment

Replies

Best

what kept ours readable was making each step prove itself before the next one.. commit after every step, and when the agent says a test covers something, break that code on purpose and watch it go red. a fair bit of our green turned out to be checking nothing. did any of the old tests survive the restart or did they go with the code?