,

Pair Programming With Your AI Agent

A pair of chairs, one leather one glass.

This post explains how to treat a session with a local AI agent as a pair programming session, and how the four classic pairing styles map onto working with one. I’ll use Antigravity CLI for the concrete examples, though nothing here is specific to it. Swap in whichever agent sits in your terminal.

The idea is simple. You already know how to work alongside another engineer on one problem. That body of practice has twenty-plus years of writing behind it, and most of it transfers directly to AI agent usage, i.e. the thing you’re doing every day now.

You are already sitting down with someone

Think about what actually happens when you open an agent in your project directory. You have a shared context (the codebase), a shared goal (the ticket), one place the code lands, and a conversation running alongside the typing. That’s a pairing session. The only unusual part is that your pair reads faster than you and never needs coffee.

Once you name it as pairing, the useful question stops being “what prompt gets me the answer” and becomes “what kind of session are we having”. This question makes you decide who is holding the intent, who is holding the keyboard, and how often you two check in with each other.

A refresher on the pairing styles

Most teams do one of four things, whether or not they call it by name. The canonical write-up is On Pair Programming by Birgitta Böckeler and Nina Siessegger, and the names below are theirs.

  • Unstructured. Two people, one problem, no assigned roles. The keyboard moves when it feels right and the talking is continuous. Böckeler and Siessegger treat this as the baseline that the other styles emerge from, rather than a technique in its own right.
  • Driver/Navigator. The Driver has the keyboard and works on the immediate small goal. The Navigator reviews as the code appears, thinks a level up, and keeps the direction compass.
  • Strong-Style Pairing. Llewellyn Falco’s rule: for an idea to go from your head into the computer, it must go through someone else’s hands. The person with the idea never touches the keyboard. It’s the style most people mean when they say “backseat navigator”, which is the informal name for it.
  • Ping Pong. Test-driven, taking turns. You write a failing test, your pair makes it pass and writes the next failing test, and back it comes to you.

There’s a fifth idea in that article worth mentioning, which Böckeler and Siessegger call Pair Development: pairing is not only the typing. Planning, research, reading docs and writing things down all count. That framing matters a lot with an agent, because a good chunk of the value shows up before any code is generated.

Is the agent an expert or a novice?

Here’s a thought exercise I keep coming back to without landing anywhere.

In Pair Programming Illuminated, Laurie Williams and Robert Kessler devote half the book to skill-level combinations: expert-expert, expert-average, expert-novice, novice-novice, with a chapter each. The right way to pair depends on who the two of you are / what you consider AI as.

So label yourself first, and be honest about it. On a codebase you’ve lived in for three years you’re the expert. Dropped into someone else’s service to fix one bug, you’re a novice for the afternoon. Greenfield, you might be somewhere in between, expert in the language and a novice in the domain.

Now label the agent, relative to you on that specific task. At coding it is plainly an expert: it has read more code than you ever will. On your codebase it has fresh eyes and no history, which is the classic novice position, and fresh eyes are exactly what catches the thing everyone else has stopped seeing. On standing up a framework from scratch it’s back to being the expert, because that’s a well-trodden path it has seen a thousand times.

Both labels are defensible for the same agent in the same session, which is why I’m leaving the question open. What you should take from it is narrower and still useful: decide which one you’re treating it as before you start, because that decision picks your pairing style for you.

What the framing actually buys you

You can get working code by issuing commands. Treating it as a pairing session gets you things that commanding does not.

  • You learn the implementation. If the agent has to explain its intent before it writes, you finish the session knowing how the thing works. Come back in three months and that difference is what makes you be able to jump straight back in.
  • You remember it. Code you talked through sticks. Code that appeared while you read Slack does not.
  • You catch the edge cases. The back and forth surfaces the input nobody considered, usually because one of you says “what happens if that’s empty” out loud.
  • You say the unspoken. Pairing forces you to articulate the assumption you were carrying silently. Half the time you discover it was wrong as you’re saying it.
  • You get documentation for free. The transcript of a good session is already most of an ADR or a decent PR description. Read it back and you’ll find the reasoning you’d otherwise have to reconstruct.

That last one surprised me the first few times. The conversation is an artefact, so treat it as one. Also, when you work like this, if you get asked questions afterwards by colleagues (or on bug reports) you’ll have much more success and/or confidence answering them.

Standing on the existing literature

The nice thing about framing this as pairing is that you inherit decades of thinking. Everything worth reading on the subject was written before AI agents existed, so none of it is grinding an AI axe:

And here’s the part that makes it practical: the model has absorbed all of it. Say “let’s do this strong-style” and it knows what you mean, because that vocabulary is in the training data. You’re not teaching it a new protocol, you’re picking one you both already know.

The four styles, applied

Same four styles, aimed at an agent. For each one: how to think about it, what it’s good and bad at, one tip and one gotcha.

1) Unstructured

Probably how you work now. You type a request, the agent does something, you react to it, repeat. No roles, no ceremony.

How to think about itAn open conversation where the keyboard belongs to whoever has momentum. Fine for exploration and small changes.
ProsMaximum flexibility. Fastest for throwaway work, spikes and “just tell me where this is configured”. Zero setup.
ConsDrifts. Twenty minutes in, neither of you knows who decided the current approach, and the diff has grown a second unrelated change.
TipBring the pairing mentality even without the structure. Ask “why that approach” before you accept the code, every time. That single question turns commanding into pairing.
GotchaUnstructured with an agent decays faster than with a human, because the agent never pauses to check in. A person would look up and ask if you’re happy. It won’t. Put the checkpoints in yourself.

2) Driver/Navigator

The agent drives, you navigate. It writes, you’re reading every line as it lands and steering the direction.

How to think about itYou hold the intent and the architecture. It holds the syntax and the boilerplate. The keyboard is its problem, the plan is yours.
ProsPlays to the actual strengths on both sides. Fast, and you stay in control of shape and structure.
ConsNavigating properly is tiring, and agents produce code faster than you can genuinely review it. Skim once and you’ve stopped navigating and started rubber-stamping.
TipCap the size of each leg. One function, one file, one behaviour, then stop and read. If a diff arrives too big to hold in your head, you asked for too much.
GotchaWatch for silent scope creep. It’ll refactor a neighbouring function because the change “made sense”, and buried in a large diff you will approve it without noticing.

3) Strong-Style Pairing

The agent has the keyboard, and nothing reaches the code that you didn’t ask for. Every idea of yours goes in through its hands, described in words first.

How to think about itFalco’s rule, inverted for the machine: you are the navigator and you never take the wheel. Instruct in the order intent, then location, then detail. “Let’s extract this”, “in the loop in the request handler”, “call it buildRetryPolicy“.
ProsThe highest-comprehension style there is. You can’t instruct what you don’t understand, so the gaps in your model surface immediately. Best knowledge transfer of the four.
ConsSlow, and deliberately so. Overkill for renaming a variable. Demands sustained attention for the whole session.
TipState intent before location. If you lead with the line number, you’ve skipped the part where you explain why, which is the part that catches a bad idea before it’s code.
GotchaAgents are eager. Ask for one thing and you’ll often get that thing plus two improvements you never requested. Say explicitly that it should do only what you asked and nothing else, and then check that it obeyed.

4) Ping Pong

You write a failing test. The agent makes it pass and writes the next failing test. You make that one pass. Round it goes.

How to think about itRed-green-refactor with the turns split between you. The test suite is the shared contract, so the conversation happens in code.
ProsEvery step is verified by construction, and you get a real suite out of it. The tightest feedback loop available, and the style where subtle mistakes are least likely to survive.
ConsOnly works where tests are cheap to write and fast to run. Wire it to a suite that takes eight minutes and the rhythm dies.
TipWrite the first test yourself, always. It sets the shape of the API, the naming and the assertion style, and the agent will follow that lead for the rest of the session.
GotchaGiven a failing test, an agent will make it pass, and sometimes that means special-casing your exact input rather than implementing the behaviour. Read the implementation as well as the test result.

My opinion: navigate, and keep a way to run the whole thing

I’m very much a Strong-Style navigator, and it’s a choice about risk.

With an agent you’re trying to avoid mistakes, and pairing gives me a good way to understand what we’re building and steer the solution into the space I want. The agent still makes mistakes, and they are subtle. Not a compile error you’d spot in a second. A plausible-looking line that’s wrong in a way you’d have to already know the domain to catch.

Even stringent pairing (even with a human) will not catch all of those without a test suite or a test harness. Agents write good unit tests now. Where they still slip is integration: each piece defensible on its own, the sum of them broken. So keep a way to execute the full end-to-end environment, and use it. I tell my agent to build throwaway test harnesses in my /tmp/ folder, then we run the system as a whole and confirm the parts still add up. Those harnesses get deleted afterwards, they’ve already paid for themselves.

If you take one thing from this post, take that. Pairing gives you comprehension. Only running the thing gives you confidence.

Or get the same outcome from skills

You can also reach the same place by installing it rather than by talking. There’s a growing ecosystem of agent skills that bake this behaviour in, most visibly Jesse Vincent’s Superpowers, and plenty more scattered across GitHub and the various skills marketplaces.

What those skills mostly do is impose the structure that pairing gives you socially. They break work into explicit steps, they gate on a design before code gets written, they ask you questions about the implementation as they go, and they explain what they did at the end. The brainstorm-then-plan-then-execute flow is recognisably a pairing session with the checkpoints written down. In Antigravity CLI these arrive as plugins, which are bundles of skills, subagents, rules and hooks, and you install one from a git URL:

agy plugin install https://github.com/obra/superpowers.git

Call it a different interpretation of the same framing. The skill is doing the job that a good pair does by instinct: slowing you down at the moments that matter and making you say the plan out loud.

You can just ask for it

The simplest version of all of this: tell the agent how you want to work. Ask it to pair strong-style, or to ping pong with you, and it will stop more often, describe its intent before it writes, and walk scenarios with you. Have it roleplay the navigator and it holds the role well, because it has read everything ever written about the role.

Or don’t. Work fluidly and adhoc, and it’ll be productive anyway. That’s true of pairing with people too. Sometimes you and your pair agree up front that this piece of work needs a specific approach, and sometimes it’s loose and improvised while one or both of you quietly holds a style in mind. Both are fine. Knowing which one you’re in is what matters.

Wrapping up

The reasons to pair haven’t changed: shared understanding, fewer defects, knowledge that lives in more than one head, and better decisions because someone made you justify them out loud. Every one of those still applies when the other half of the pair is an AI agent. Some points actually get stronger, because your pair is infinitely patient 🙂 and will explain its reasoning as many times as you ask.

What’s new is that you can pick your pair’s style at the start of every session, and that the cost of pairing has collapsed. There’s no scheduling, no negotiating, no one else’s afternoon to book. So the only real question left is the one at the top: what kind of session are we having today?

If you want to try it, Antigravity CLI is one command on macOS and Linux:

curl -fsSL https://antigravity.google/cli/install.sh | bash

On Windows it’s irm https://antigravity.google/cli/install.ps1 | iex in PowerShell. Either way you get a binary called agy, so agy in your project directory starts a session. If you’re coming from Gemini CLI, your GEMINI.md still gets read and agy plugin import gemini brings your old extensions across.

Happy pairing!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *