The copilot loop: prompt, run, read, verify, refine
A repeatable loop for building with AI that keeps you in control and in understanding — never pasting code you cannot read.
Beginners using AI tend to do one of two things: paste a huge vague request and ship whatever comes back, or fight the tool. Both fail. The professionals run a tight loop that keeps them understanding every step.
The five steps
- Prompt — ask for a *small, specific* piece with the constraints that matter (next lesson). Small requests are easier to verify than a whole system at once.
- Run — actually execute it on real (or realistic) data. Code you have not run is a guess.
- Read — read every line and make sure you can say what it does. If you cannot, ask the AI to explain *that line* before moving on. This is how you learn.
- Verify — check it does the right thing, not just *a* thing: no look-ahead, correct data alignment, sane numbers, realistic assumptions. Verification is a separate act from running.
- Refine — feed back what was wrong ("this uses the current bar's close — fix the look-ahead") and iterate. Tight feedback beats one giant prompt.
Ask it to teach, not just to type
The loop is also how you *learn*. Every time the AI writes something new, ask it to explain the unfamiliar part, then try to write the next piece yourself and have it review you. You are aiming to *not need it* for the basics — the copilot should be raising your ceiling, not replacing your floor.
You are my coding tutor. I'm learning algorithmic trading in Python.
Explain what a vectorised backtest is in 4 sentences, then show the
smallest possible example on a pandas price Series. After the code,
list the ONE mistake beginners make with it (look-ahead), and how to
avoid it. Keep it concrete — I'll run your example.Notice what that prompt does: bounded length, a concrete deliverable, and it explicitly asks for the failure mode. You will write prompts like this constantly. The next lesson makes them sharp.