r/ChatGPTCoding • • 8h ago

Question How do you handle understanding and reviewing AI-written code, both in new stacks and familiar ones?

I've been building apps with agentic AI tools, and I've hit two problems.

First, when the agent writes code in a technology I've never worked with, I end up not understanding any of it. It runs, but I couldn't explain it or debug it confidently. I come from a backend background, so I'm used to knowing exactly what my code does. How do you learn in that situation? Do you make the AI explain everything, write a first version yourself, or only use agents for stacks you already know?

Second, even when I use a technology I know well, I'm unsure about the best way to review the code. Should I let AI review it in loops, for example having Claude write it and GPT review it? Or should I always review it myself? Or some mix of both?

For those of you doing vibe coding or vibe engineering seriously, what's your workflow for review, and how do you avoid shipping code you don't truly understand?

14 Upvotes

15 comments sorted by

2

u/RevolutionaryElk7446 8h ago

Most of it's based around my snippets, my code, my templates and the skills it uses are written to keep to that with permissions to keep human checks in the pipeline without creating unnecessary alerts.

I already understand everything it's doing, same way you're suppose to use a calculator and why they have you show your work in math class. It's an ok tool if you know nothing, it's a good tool if you know the concepts, it's a great tool if you're the one leading the majority of the design choices.

1

u/Live-Cauliflower-744 7h ago

The reason that I asked this question is that I wanted to build a mobile app using flutter and I never develop any flutter apps, I am using skills (Matt Pocock's skills) and trying to do the best practices but when I try to read the code, I understand no thing, or just understand what the code does in a high level view.

So, Should I know how a certain framework works and be good at it to be able to create apps using it with the help of AI agents? I heard people say that AI gives me superpower to build anything even if I never use the technology before.

2

u/RevolutionaryElk7446 7h ago

Not really, you could make something and you might find it incredible but as LLMs are rebuilding from things already built, it's not going to be outstanding or in most cases even worthwhile.

What you'd make would be the same as if you created your first sculpture out of clay in art class, you'd have sentimental value for it, but no one is going to buy it.

1

u/CommercialCurrent237 2h ago

the calculator comparison breaks down a bit because a calculator is deterministic, whereas an agent will quietly pull in a deprecated pattern if the context drifts

2

u/adlx 7h ago

Why would you do that?

2

u/Live-Cauliflower-744 7h ago

You mean building app with technology I never used before?

1

u/adlx 7h ago

No sorry, I mean what would you review AI writen code.

2

u/Ok_Woodpecker_9104 7h ago

for the new stack part i ask it for plain words version of why the change works and then have the reviewer check if that explanation is actually true in the code

for the second one i do both, claude writes it, then codex reviews the whole branch diff before i call the pr done, and the prompt asks for bugs, missed cases and anything the pr description claims that the code does not actually do

what made my own review possible was one commit per change. the agent once handed me one commit across 10 files which i could not read, so it got split into 9 and now each one is small enough to read and revert on its own

1

u/Live-Cauliflower-744 6h ago

Thank you, helpful!

5

u/mikepun-locol 7h ago

You can use AI to help you understand code you didn't write. I have a set of skills/tools that I use to analyze my code, or code from others, that walks me thru what's in the repo. It's also what I use to help pinpoint bloat. The coding agents are pretty good at writing code now, but there still be bloat built up over time.

This is useful not just for AI coded stuff. I use it for legacy systems that I have to work with.

What's even better for when you want to make a change. Use the material generated as part of the context for defining the change. I find this improve the outcome.

3

u/HungryMention5758 8h ago

I built custom skills auto invoked on creating or editing file (code) , instructions about code conviction and styles , after AI agent do the work , i always make it verify it work , i still adjusting and enhancing the skills , sometimes i look into the code and ask the agent why he coded this way ( overengineering issue , bad quality... ) and tell him to update the instruction (skills) to do not repeat same mistakes .

3

u/Geraldwelly 6h ago

Coming from backend helps here, because the skill you need is reading code, not writing it. When an agent writes something in a stack I don't know, I have it add a short note per file: what it owns, what calls it, what breaks if it goes away. Then I break one thing on purpose and fix it myself before I ship. On review, a second model is good at catching obvious bugs, but it tends to agree with the first one on design choices. I only trust a review loop when real tests run between passes. Do you have tests in the new stack yet?

1

u/ipreuss 8h ago

I don’t look at the code anymore.

I use Opus as my main agent, some coding tasks are delegated to sonnet, fable and codex do reviews.

1

u/Difficult_Duty2198 1h ago

what helped me was writing a one line summary of each chunk in my own words before accepting it. if i can't do that i ask it to explain until i can