How Do You Stay in Control While AI Writes the Code?
Repeat three moves. Describe one result along with how to test it and what to leave alone. Verify it by running the app. Then save a version you can return to before asking for the next thing. You stay in control because you always have a working version, and you always know what changed.
Task: [one result, in plain language]. Success looks like: [what I can see or do when it works, including one failure case]. Leave alone: [pages, tables or features that must not change]. Before you change anything, tell me which files you plan to touch. If that list includes login, the database structure or payments, stop and ask me first. When you finish, give me numbered steps to test this as a user, including what should happen when I do it wrong. Tell me anything you couldn't check yourself.
- 1Describeone result and its test
- 2Verifyrun it, then try to break it
- 3Savecommit, then repeat
Try it now
- 1Pick one small improvement you want and fill in the prompt above. In Replit, keep the mode on Free while you learn.
- 2Follow the AI's test steps yourself in the preview, and add one of your own that tries to break it, such as submitting an empty form.
- 3Save it. Replit and Lovable keep versions for you, and in Claude Code you can ask it to commit. You'll know it's working when you can go back to this version from your history.
Use it when
On every change to an app you intend to keep, and especially once it has real data or users.
Skip it when
For a throwaway experiment, you can skip the saving step and regenerate instead. If you're exploring what's possible, a single wide-open prompt is fine, as long as you restart from a clean version afterward rather than building on top of it.
Why it works
Vendors teach versions of this same loop. Replit's first-app tutorial has you describe one useful outcome, add success criteria you can observe, set boundaries, test in Preview, then ask for one focused improvement. Anthropic's Claude Code guide says to give Claude a check it can run, because it can then correct itself.
Each part prevents a specific failure. Success criteria stop the AI declaring victory on code that merely runs. Boundaries limit how much can break. Saving means a bad turn costs minutes rather than a day. It also keeps costs down: Replit bills Agent work by effort, and v0 counts your project's context as input on each message, so a long argument with the AI costs real money.
Example
You want a delete button on a task list. Task: add a delete button to each task. Success looks like: clicking asks for confirmation, and the task stays gone after a refresh. Cancel keeps the task. Leave alone: the login pages and the task table's structure.
The refresh is the important part of the test, because a button can remove a row from the screen without touching the database. Replit also suggests starting a prompt with "Only" when Agent keeps adding extras, as in "Only add a delete button to the user card. Don't change anything else."
Going further
Learn when to abandon a round. Anthropic's advice for Claude Code is to watch the first minute, press Esc as soon as it drifts, and after two failed corrections run /clear and write a better prompt rather than a third correction. A failed attempt in the conversation keeps influencing later answers.
In Claude Code, you can also run /verify once it says it's done, which has it build and run the app and look at the result. Anthropic says this catches problems that tests and type checks miss. Treat it as a first pass, because security failures won't appear on a screen that looks fine.
Common mistakes
- Asking "does it work?" and accepting yes. Ask for test steps, then do them.
- Testing only the path where everything goes right, and never trying an empty form or a wrong password.
- Stacking three requests in one message, so that when something breaks you can't tell which caused it.
- Saving only after a long run of changes. If one version holds ten changes, undoing the bad one loses the other nine.
Sources
- Build your first app, Replit docs
- Agent and AI help, Replit docs
- Best practices, Claude Code docs
- AI billing, Replit docs
- Pricing, v0 docs
- Checkpoints and rollbacks, Replit docs
- Project history, Lovable docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.