Make It Cheap for Agents to Discover They're Wrong
My coworker Sarthak cut his frontend iteration loop from three hours to 30 minutes using throwaway Storybook stories.
Make it cheap for agents to discover they’re wrong while the problem is small.
His agents now start with a temporary Storybook story for each page. They iterate on layout, spacing, and states using the Figma and Playwright MCPs, in isolation, without fighting auth or routing. Once it looks right, they wire it into the app. The agent gets it wrong in the throwaway, not in the app.
This is the move that separated my best workflows from my worst over the 440 agent-written PRs I merged last month.
Test-driven development
Agents write a failing test, confirm it fails for the right reason, then implement until it passes. Refactor against the test in place. The tests keep the agent from wandering.
Adversarial review
I plan and implement with Claude Code, then have Codex review each step with fresh context windows. Codex catches things Claude wouldn’t, and vice versa.
Start with the interface
Iterate on the function signature, CLI, or API contract with example client usage. Get the shape right while you’re in the loop. Then have the agent color between the lines.
Tight loops have a setup cost, and they don’t replace judgment about what to build. Choose them carefully: agents are obedient, not skeptical. They’ll satisfy whatever loop you build, including a wrong one.
Without loops, agents ship more code. With loops, they ship better code.