Pair Programming with AI Agents
2026-03-30
If you're like me, you want to understand how something works before you commit to a workflow built around it. This is how you get under the skin of AI agents — and a natural stepping stone to spec-driven development.
The default approach
When a new problem appears, the instinct is to open a chat with your agent and describe what you want built. It feels natural. You have a goal, the agent can code — so you describe the goal and wait.
And something comes back. Often quickly. Often plausible-looking.
But if you haven't thought the problem through yet, neither has the agent. It fills gaps with assumptions. You end up debugging generated code instead of refining a clear idea.
How you'd walk a child through a problem
Think about how you'd guide a child to an answer — not by giving them the answer, but by asking questions that lead them there. What do you notice? What does that tell you? What would happen if…?
You're not dictating. You're steering the reasoning, one step at a time.
Agents respond to exactly this kind of approach. Instead of opening with "build me X", you open with a conversation. Point the agent at the codebase. Ask it to look at how an existing feature works. Then introduce the new requirement: if we added this, what would need to change?
From there, you push. Did you consider this edge case? Why is that approach a good idea? What are the risks? You're not just gathering information — you're stress-testing the thinking before any code exists to debug.
This is pair programming. You and the agent, working through the problem together, each catching what the other misses.
Ask first, then ask again
This isn't a single clarifying question at the start. It's a back-and-forth — a joint exploration.
Walk the agent through the problem in stages. Confirm understanding at each step before moving on. Let it propose directions, push back on them, or ask it to consider alternatives. You're thinking alongside it, not just issuing instructions.
This is especially well-suited to the early exploratory phase of a project — when you're feeling your way through something new rather than executing against a plan. The agent becomes a thinking partner, helping you understand the problem as much as solve it.
One thing to watch for: agents are enthusiastic. Left unchecked, a conversation that started focused can drift — more edge cases, more features, more scope than you asked for. When you feel that happening, that's your cue to pull back. Your role in this pairing is to keep things on track. Guide it, focus it, and know when to stop exploring and start building.
Where this fits on the map
This approach is a foundation. It teaches you how agents reason, where they make assumptions, and how to steer them effectively. Spend time here. Get comfortable with the back-and-forth.
When that feels natural — when you're consistently arriving at good implementations through joint exploration — you're ready for the next level: spec-driven development. That's a more structured approach where a written spec drives the agent's behaviour, giving you repeatability and control at scale.
The instincts you build here — asking before building, steering rather than dictating, catching assumptions early — are what make spec-driven development click. Once you understand how the agent thinks, working within a spec feels intuitive rather than prescriptive.
One habit, a solid foundation
You're not changing everything about how you work with agents. You're adding one step at the front: pause, ask, understand.
The code that comes out is better. More importantly, so is your understanding of how it got there.