The AI Pair-Programming Loop
Prompt, generate, review, refine, ship. Click through the loop every vibe coder repeats, over and over, to build real features.
Vibe coding is not one prompt and done, it is a loop. Click each stop to see what happens there.
Prompt
Describe the change you want in plain English, with enough detail to act on: the file, the behavior, the outcome.
Common pitfall: staying so vague the AI has to guess the file or the outcome.
Applied to a real example
Here is the same loop, start to finish, for one small feature.
"Add a dark mode toggle to the settings page that saves the choice in localStorage."
AI adds a toggle component, a theme context, and CSS variables for both themes.
The toggle works, but the theme resets on every page reload.
"The theme isn't persisting on reload. Read the saved value from localStorage on load."
Reload actually keeps the theme now. Commit it.
When the loop stops converging
Most of the time, review leads to a small refine, and the refine fixes it. Sometimes it does not. You send a correction, the AI produces something that is wrong in a new way, you correct that, and three rounds later you are further from working code than when you started, not closer.
The instinct is to keep prompting: rephrase the same request, add emphasis, type “no, actually” and try again. That treats the model as if it just needs one more nudge. Usually it needs something else entirely — a piece of context it never had, or a task that was too large to hold together in one pass.
When you notice you are on attempt three, do one of these instead
- →Stop and read what actually changed each time. If nothing is converging, that is the signal, not a feeling.
- →Give it the thing it is obviously missing: the real error text, the file it has not seen, the failing test.
- →Cut the task in half and ask for just the first part.
- →Start a fresh conversation with one clear prompt instead of the fourth correction inside a long one.
Two chapters ahead cover this properly — steering mid-flight, and knowing when to restart entirely — but the shape to remember now is simple. Re-prompting fixes a prompt that was almost right. A stalled loop needs a different input, not a louder version of the same one.
Key takeaways
- Vibe coding is a loop, not a single prompt. The review step is where the quality comes from.
- Read the diff before you accept it. Skimming is how bugs get committed.
- Refine with a targeted follow-up rather than restarting with a whole new prompt.
- Run it yourself before you call it done.
- A loop that keeps producing new wrong answers needs a different input, not a fourth attempt at the same prompt.
Quick check
Answer these to unlock the next chapter — 2 of 2 to pass. You can retake it anytime.
Answer every question to check.
Make a free account to read on
Every chapter is free — an account is how your progress, XP, and streak follow you from your laptop to your phone, and how you show up on the leaderboard. No payment, no trial.