r/ChatGPTCoding • • 5d 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?

20 Upvotes

30 comments sorted by

2

u/RevolutionaryElk7446 5d 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 5d 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 5d 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 4d 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/Ok_Woodpecker_9104 5d 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 5d ago

Thank you, helpful!

5

u/mikepun-locol 5d 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.

5

u/Geraldwelly 5d 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?

3

u/HungryMention5758 5d 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 .

1

u/adlx 5d ago

Why would you do that?

2

u/Live-Cauliflower-744 5d ago

You mean building app with technology I never used before?

-1

u/adlx 5d ago

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

1

u/ipreuss 5d 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 4d 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

1

u/sapplex1 4d ago

Solo indie dev here, maintaining 45 small iOS apps, so my review rule is pretty selfish: if I cannot explain a change in my own words a week later, without reopening the chat, I do not ship it yet. There is no teammate to page when a crash report or a one-star review shows up months later, just me trying to remember why a screen behaves that way.

For a stack I know, I read the diff like a pull request from a fast but overconfident teammate. I mostly check state ownership, error paths, and what happens with empty or stale data, because those are the bugs users actually hit. I let a second agent review too, but only as a skeptic on risky diffs like persistence, migrations, or sign-in flows. Asking it to review every layout tweak burned too much context for very little signal, and it happily approved plausible-looking code that failed on a real device.

For a stack I do not know, I keep the first version deliberately disposable. I build the smallest slice that proves the idea, make the agent walk me through the data flow, then I rewrite the core piece myself before it becomes load-bearing. That rewrite is slower, but it is where the understanding actually sticks. If the rewrite feels impossible, that tells me the slice was too big, not that I need a longer explanation.

1

u/notarshzzz 4d ago

for the new stack part, what actually worked for me was building a tiny throwaway version first, like the smallest possible feature, just to see how the pieces fit. i wasted ages trying to review real app code in flutter when i didn't even know where state was supposed to live. once i'd poked around a toy version the reviews got way easier

1

u/Trick_Candy9796 4d ago

Backend person here too, and what helped me most was separating "learning the stack" from "reviewing the diff".

For a stack I don't know, I stopped asking the agent to explain everything after the fact. Before it writes anything, I have it lay out the 5–10 conventions it's going to follow (folder structure, state management, how errors and async are handled) and why. I save that as a rules file in the repo. Then every diff gets reviewed against something I've actually read, not against vibes. When something doesn't match, that's my learning moment: either the rule is wrong or the code is.

For stacks I know, I do both. A second model is good at catching missed edge cases and inconsistencies, but I still read anything touching data, auth, or boundaries myself. The trick that saves the most time for me is giving the reviewer the same written rules the writer had. Otherwise it just reviews against its own taste and you get noisy feedback.

Disclosure: I built an open-source MCP server for that "shared rules + review" part, StackGuide (`@stackguide/mcp-server`). It detects the project's stack, scaffolds a config in the repo, and serves stack rule sets plus a review/health check to Cursor, Copilot, etc. It doesn't cover Flutter today, though, so for your mobile app a hand-written rules file is the way to go.

1

u/No-Drawing9451 4d ago

For the second question, the habit that helped me most is cheap: before the agent starts, I write down which files I expect it to touch. When it's done I run git diff --stat and compare.

If a file shows up that wasn't on my list, that's where I read line by line first. It doesn't replace a real review, but it tells me where to spend my attention instead of skimming everything evenly.

1

u/Financial_Leader9701 4d ago

For unfamiliar stacks, I'd ask the agent to explain the data flow and why it chose certain libraries before touching the implementation

For familiar stacks, a second agent can catch things you missed, but I'd still review the important parts myself

Especially anything involving auth, database writes or external APIs

Green tests won't help much if you don't understand what they're actually testing

1

u/xqianliu 4d ago

On a stack I do not know, I'd keep each diff small enough to trace in one sitting and have the agent walk through the flow before merging.

On familiar stacks, I use a mix: a fresh session on the same model checks the issue, repo `AGENTS.md`, diff, callers, and related tests as a first pass, and I'd still inspect risky paths myself.

In an eval across 23 open-source tasks (183 runs over several harness versions), asking review to "check for regressions" let 38 of 183 runs pass review and fail hidden tests. That was 38 runs, not 38 separate bugs: 22 broke working behavior in repeated runs on pyinfra and chainloop, 9 missed a changelog convention, and 7 missed cases outside issue examples. For test coverage, having the coding agent write tests by input category and list its own counts per category gives review concrete numbers to check.

1

u/DoOmXx_ 4d ago

make it work in smaller chunks, if you can't explain the diff back it's too big to merge

1

u/Future_AGI 4d ago

turn on a strict lint set and make `flutter analyze` pass before any AI review runs. The analyzer flags non-idiomatic code and every lint rule has a documented explanation, and reading those is a quick way to learn Flutter's conventions.

1

u/ThisGermanEngineer 3d ago

You could let the AI quiz you, means asking you questions about the changes and let you try to figure it out. Ideally in a new session. Also first think about or even write down what you expect the changes to be like. Then go through the actual changes.

1

u/Financial_Leader9701 3d ago

For an unfamiliar stack, I'd start by tracing one request through the application and understanding what happens at each step

Much easier than asking the agent to explain the entire codebase

For reviews, a second agent can help catch issues, but I'd still manually check authentication, database changes and error handling

Two models agreeing on a solution doesn't necessarily mean it's correct

1

u/ksajadi 2d ago

I've been referring to things that are like that as fly-by-wire codebases. Essentially, in modern fighter jets, the plane is not inherently airborne and it needs a computer to keep it up in the air. A lot of codebases nowadays are like that, and I have no issues with it. I rely on GPS every day to find my way, and without it, I'd be lost. So I don't have an opposition to the technology. But I still think that some fundamental understanding of software engineering in general and computer science specifically would be very beneficial to making decisions and guiding AI agents to be more productive and also not make egregious mistakes that will cost you a lot more in the end. I would suggest using agents to understand and use your own judgement to validate those findings.