---
title: "AI Did It in 12 Minutes. It Took Me 10 Hours to Fix It"
url: https://daily.dev/posts/ai-did-it-in-12-minutes-it-took-me-10-hours-to-fix-it-2vzlnj5lr
source_url: https://idiallo.com/blog/it-took-me-10-hours-to-fix-ai-code
type: article
source: "Ibrahim Diallo"
published: 2026-04-06T13:04:57.567Z
updated: 2026-04-06T13:05:21.546Z
tags: ["php", "sqlite", "ai-coding", "vibe-coding"]
reading_time: 8
upvotes: 21
comments: 7
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Did It in 12 Minutes. It Took Me 10 Hours to Fix It

**[Ibrahim Diallo](https://daily.dev/sources/idiallo)** · 8 min read · 21 upvotes · 7 comments

## Summary

A developer shares a firsthand experience using an AI coding agent (GLM-5 via z.ai) to build a PHP media manager for a personal blog. The AI generated ~5,000 lines of spaghetti code in 12 minutes, but it took 10 hours of debugging, restructuring, and rewriting to produce a maintainable 1,254-line codebase. Key issues included incorrect file includes, missing session_start() calls, SQLite permission quirks, and conflicting system prompts causing Node.js code generation. The author reflects on the real cost of AI-generated code: the cleanup and comprehension burden often negates the speed gains, and deploying code you don't understand is a liability.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://idiallo.com/blog/it-took-me-10-hours-to-fix-ai-code>

## Community discussion

Top comments from developers on daily.dev.

**@feforeboot** · 6 upvotes

> For fuck's sake, the guy literally admits to 1) not being sure what he wanted and needing to reason through it, and 2) USING A WRONG AI MODEL.
>
>
> And then the cascading issues from that are pinned on the AI anyway. Why is this post being allowed to waste our time?

**@fabianletsch** · 3 upvotes

> Shit in -> Shit out 😅

**@fabianletsch** · 2 upvotes

> You went through an interesting process but i think you forgot to draw the right conclusions.
>
>
> Instead of questioning vibe coding itself you should have questioned your process.
>
>
> For better results you should have:
>
> 1. Used a more competent model
> 2. Used a better system prompt/agent
> 3. Should have made it possible somehow for the ai to fix its mistakes, for example by it seeing linting and type errors itself
> 4. Spent way more time planning the thing and discussing the architecture with the AI.
>
>
> You may still have ended up wasting lots of time but i believe it would have been less time and...

**@confidentcoding** · 2 upvotes

> _"This reminds me of several non-technical friends who built/vibe-coded apps last year. The initial results looked impressive. Most of them don't have a working app anymore, because they realized that the cleanup is just as important as the generation if you want something that actually holds together. I can only imagine what "vibe-debugging" looks like."_
>
> These are the kind of stories that honestly motivated me to start [confident-coding.com](http://confident-coding.com) and begin teaching people what real troubleshooting and debugging looks like. As these tools make it so easy to get a...

**@rucaua** · 0 upvotes

> AI for small tasks - work amazing. Complex tasks - 50/50. Huge tasks - event do not try.

## Similar posts on daily.dev

- [I Let AI Write My Code for 7 Days. Days 1–6 Were Magic. Day 7 Nearly Broke Me.](https://daily.dev/posts/i-let-ai-write-my-code-for-7-days-days-1-6-were-magic-day-7-nearly-broke-me--ohycaidt0) · Medium · 1 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#sqlite](https://daily.dev/tags/sqlite), [#ai-coding](https://daily.dev/tags/ai-coding), [#vibe-coding](https://daily.dev/tags/vibe-coding)

[View this post on daily.dev](https://daily.dev/posts/ai-did-it-in-12-minutes-it-took-me-10-hours-to-fix-it-2vzlnj5lr)
