Stop Arguing with the Agent: The Single-Pass Coding Paradigm
Over the last few weeks, working with AI coding tools like Codex and Claude Code has been a real eye-opener. But if I am being honest, it has also brought a fair share of frustration.
The biggest headache? These tools love an arbitrary code dump. You ask for a quick fix in one place, and before you know it, the agent has rewritten half the project, altered adjacent files you never asked it to touch, and left you with a massive cleanup job. It makes you realize that while we might be moving away from line-by-line manual coding, we are spending just as much time policing the agent's side effects.
Flipping the Approach: From Chatting to Compiling
Instead of layering correction after correction in a long, messy chat thread—where the AI gets confused and loses the plot—I've been thinking about a much cleaner paradigm:
- Run a test prompt: Let the agent have a crack at the problem in a clean sandbox or branch.
- Spot the missing constraints: Look closely at where it went off the rails. Did it touch the wrong files? Did it break an interface? Did it make assumptions about the database?
- Excavate the chat log: Take all those unstated rules and edge cases discovered during the mess, and feed them back to extract a "golden" initial prompt.
- Re-run from scratch: Reset the code, feed in the refined prompt, and let it run afresh in a single pass.
Treating the prompt like source code and the AI like a clean compiler stops context drift and gives you a repeatable spec you can actually use again.
It is definitely a shift in mindset, moving from constant back-and-forth patching to deliberate prompt design. It feels like the right way forward to keep side effects low and retain full control over the codebase.
Note to self: Next time a coding agent goes wild, don't keep arguing with it in the chat. Review the output, refine the base specification with the missing boundaries, reset the branch, and try the fresh single-pass run.
Comments
Post a Comment