AI Coding Basics

AI Pair Programming: The New Way To Write Code

AI Pair Programming: The New Way To Write Code

Most developers now keep an AI assistant open next to their editor. Google’s 2025 DORA report, based on nearly 5,000 technology professionals, put AI adoption among software development professionals at 90%, up 14% from the year before.

AI pair programming is the name for working that way on purpose. The assistant suggests, writes, explains, and reviews code while you set the direction and approve every change. GitHub Copilot, Cursor, Claude Code, and Aider are the usual tools, reached through inline completion, chat, and agent mode, inside editors and terminals.

The name borrows from human pairing, but what the assistant brings is speed and recall. It doesn’t build shared ownership of the code the way a human partner does. Pairing is one way of doing AI coding, and the one where the developer stays most involved.

What Is AI Pair Programming?

YouTube player

The developer keeps ownership of the goal, the design, and whatever gets merged. The assistant takes the second seat and produces, explains, or checks code when asked.

The term comes from pairing as extreme programming practiced it. That technique goes back to the 1990s and became a core practice of the Agile method. In the classic version, two developers share one computer. One drives and types, the other navigates and watches the overall direction, and they swap roles every few minutes.

The term stuck because people use the tools. In the 2025 Stack Overflow Developer Survey, 84% of respondents said they use or plan to use AI tools, up from 76% the year before, and 51% of professional developers use them daily.

Plenty of things get called pairing that aren’t. Autocomplete on its own is one mode of the practice, not the practice itself. And if an agent runs unattended and nobody reads the diff, nobody is pairing.

Vibe coding sits at the far end of that line. The vibe coding approach accepts generated code without reading it, which removes the navigator completely.

Who Drives and Who Navigates?

With a human partner, the roles swap on a timer. With an AI, they follow whatever mode you’re working in.

In inline completion and agent runs the assistant drives, since it’s the one producing the code. When you’re editing by hand and the assistant only explains, reviews, or answers questions, you drive.

You navigate either way. Direction, scope, and acceptance never leave the human seat.

How AI Pair Programming Works

Your prompt goes to a language model along with context (the open file, selected code, and parts of the repository). What comes back is a completion, an explanation, or a set of edits. You accept it, reject it, or redirect, and the correction becomes your next prompt.

The context window sets the ceiling. How much of your codebase the assistant can reason over depends on what the tool selects and how large that window is.

Inline Completion

Suggestions show up as you type, and some tools will also propose your next edit.

It’s low commitment and fast. If the ghost text is wrong, ignore it and keep typing.

Chat

Workspace chat is an agent scoped to your current workspace, so it works beside the editor, the terminal, your tests, and the debugger. Inline chat is smaller. You ask for one focused edit without leaving the file.

Chat suits design questions and explanations, where you want an answer rather than a diff.

Agent Mode and Terminal Agents

YouTube player

Here the assistant uses a model and tools to find relevant code, make changes, and run checks, while you set the goal and review the results. Most people call this style agentic coding.

  • Multi-file edits arrive as a diff you validate before committing
  • Terminal commands run under permission rules, and stopping a request does not undo steps already taken

External tools connect through Model Context Protocol, an open-source standard for linking AI applications to outside systems.

Terminal agents follow the same loop outside the IDE. Aider launches from your project directory with a model and API key, and it commits each change with a generated message, so review and undo run through ordinary git.

How AI Pairing Differs From Human Pair Programming

The assistant is there at any hour and recalls far more than a person can, and a human partner can’t match that. What it can’t give you is what stays with a team once the session ends, like shared knowledge and joint ownership of the code, plus a group that has actually practiced working together.

Birgitta Böckeler, a Thoughtworks distinguished engineer, made that case on martinfowler.com in August 2023. She found assistants useful for getting unstuck and speeding up lookups, yet she objected to presenting them as a replacement for pairing.

DimensionHuman pairingAI pairing
AvailabilityNeeds a second person’s timeOn demand, any hour
Tacit knowledgePasses between partners in conversationUnavailable when it was never written down
Team effectBuilds shared ownership of the codeLifts individual output
AccountabilityBoth partners own the resultThe developer decides what reaches the codebase

Thoughtworks placed “replacing pair programming with AI” on Hold in its Technology Radar in October 2024. Its reasoning was the missing team-level benefits, such as low work in progress and collective code ownership.

The research is thinner than the marketing line suggests. A 2023 paper by Ma, Wu, and Koedinger (Carnegie Mellon) reviewed the literature and found the effectiveness of both forms of pairing mixed, with the measures used for AI pairing less comprehensive.

My own split would be simple. Use the assistant for lookups and boilerplate, and for first drafts if you like. Keep a human pair for onboarding and risky changes, and for design disagreements.

Böckeler goes further and argues that the risks of LLM-assisted coding are best mitigated by using the tools in a pair, so the assistant should make pairs better rather than stand in for them. Whatever the setup, generated code still passes through your team’s normal code review process.

Which Tools Fit Which Workflow?

YouTube player

Start from the mode you use most. If that’s inline completion, an IDE extension does the job. Multi-file edits fit an AI-native editor better, and bigger tasks that you’d rather delegate and review afterward fit a terminal agent.

The four tools below cover those groups, and plenty of tools built for pairing with an AI assistant sit beside them. Among Stack Overflow 2025 respondents who use or build AI agents, 67.9% named GitHub Copilot and 40.8% named Claude Code.

ToolEnvironment and modePricing, as of November 2026Watch out for
GitHub CopilotIDE extension: completion, chat, agent modeFree at $0 with 2,000 completions a month; Pro at $10 per user a monthFree tier caps completions
CursorAI-native editorFree tier; paid plans from $8 a monthWeekly usage refresh; third-party models billed at API list price
Claude CodeTerminal agentIncluded in paid Claude plans; Pro is $20 a month billed monthlyNot included in the Free plan
AiderTerminal chat with automatic git commitsYou supply a model and API keyModel costs depend on the provider you connect

Read the billing unit before the price. Copilot meters usage in GitHub AI Credits, where one credit equals one cent.

GitHub’s Copilot is the lowest-friction start, because agent mode comes with every plan, not only the paid ones.

The obvious move is to buy the biggest plan first. Don’t.

A $10 inline extension handles boilerplate and tests fine. Agents earn their price once tasks regularly cross several files.

Does AI Pair Programming Make Developers Faster?

YouTube player

Sometimes, and the studies disagree on when. A controlled experiment on a scoped task found a large speedup, while a trial on experienced developers in mature repositories found a slowdown.

Peng et al. (2023) had developers implement an HTTP server in JavaScript, and the ones with an AI pair programmer finished 55.8% faster than the control group.

METR (2025) went the other way. 16 experienced open-source developers completed 246 real issues in their own repositories, and the work took 19% longer with AI. Before starting, those developers predicted a 24% speedup. Afterward they still believed they had been 20% faster, despite the measured slowdown.

Neither result is wrong. They measured different work.

FactorPeng et al. (2023)METR (2025)
TaskA fresh, self-contained buildReal issues averaging about two hours
Codebase familiarityNew code, nothing to knowAbout 5 years of prior experience on the repository
ToolAn AI pair programmerMostly Cursor Pro with Claude 3.5 and 3.7 Sonnet

Why the Results Diverge

Mature projects carry implicit requirements, like documentation and formatting rules and test coverage, that the assistant handles less well.

The METR participants also had only a few dozen hours with Cursor, and METR suggests the benefits may need several hundred. The authors add that AI may help more on unfamiliar codebases or with less experienced developers.

The perception gap is the part that should worry you. Developers felt faster while the clock said otherwise.

What the 2026 Update Changes

METR started a larger experiment in August 2025 with the latest tools. By its own account, selection effects make the central estimate a poor proxy for the real productivity impact.

METR also said it believes developers are likely more sped up now than its early-2025 estimate showed, though its newer data is only weak evidence for the size of that gain. So the 19% figure describes early-2025 tools on one kind of work, and nobody has a clean replacement number yet.

DORA’s 2025 report adds the team-level view. It describes AI as an amplifier that magnifies the strengths of high-performing organizations and the dysfunctions of struggling ones.

DORA’s lead frames it as acceleration that can expose weaknesses downstream, so a faster coder with a weak test suite ships bugs faster.

No published percentage applies to your repository. Time ten of your own tickets with and without the assistant, and trust that over any study.

How to Pair Program With AI, Step by Step

Keep every pass small enough to read and cheap to revert. This is the loop I’d run.

  1. State one outcome per prompt, with constraints and a definition of done. A vague goal returns plausible code for the wrong problem.
  2. Give it context, meaning the relevant files, your naming conventions, and the existing tests. Without them the assistant invents helpers your project already has.
  3. Ask for a plan before any code, especially in agent mode. Agents that skip this step edit files you did not expect.
  4. Write the failing test first, or ask the assistant to draft it and read it yourself.
  5. Accept small diffs and read each one. A 400-line diff gets skimmed, not reviewed.
  6. Run the tests and the linter, then commit after every accepted change so a bad turn costs one revert.
  7. If the output is wrong twice, rewrite the prompt or start a fresh chat. Long threads drift away from your original constraints.

The test-first step is plain test-driven development, and it’s the cheapest check on generated code. It also gives the agent something concrete to run against.

Let continuous integration act as a second reviewer on every push. It catches what a tired human skims past.

What Are the Risks of AI-Generated Code?

Insecure code and confident wrong answers are the obvious risks, and review fatigue creeps in behind them. All of it gets worse once the developer stops reading what the assistant writes.

Veracode’s 2025 GenAI Code Security Report tested more than 100 LLMs on 80 coding tasks and found 45% of cases introduced vulnerabilities from the OWASP Top 10.

Security performance isn’t uniform, though. In Veracode’s November 2025 update, GPT-5 Mini reached a 72% pass rate on the security tests, while most other models stayed between 50 and 59%.

The July 2025 report had found security performance flat over time. Veracode’s October 2026 edition recorded the first meaningful gain. Across 18 models the average pass rate rose from 56% to 62%, though the weakest models still scored 44 to 50% and the best reached 73%. Which model you pick changes the risk.

Overconfidence Is the Bigger Problem

In a Stanford user study, participants with an AI assistant wrote significantly less secure code than those without one, and were more likely to believe their code was secure.

The assistant in that study was an OpenAI codex-davinci-002 model, so treat it as a direction and not a current benchmark. The finding on behavior still holds up.

Participants who trusted the AI less and refined their prompts more produced fewer vulnerabilities.

Controls That Work

Treat assistant output as untrusted input. OWASP’s 2025 Top 10 for LLM Applications lists improper output handling and misinformation as separate risks.

Read every diff too, since VS Code’s own documentation notes AI can produce incorrect code. Before merge, run a linting pass and a security scanner.

Unread suggestions also pile up as technical debt. The cost shows up months later, in code nobody on the team fully understands.

When Does AI Pair Programming Stop Helping?

It stops helping when you know the code better than the assistant can read it. Same when the work depends on standards nobody wrote down, or when the goal is to learn the material yourself.

Familiar Code With a High Quality Bar

METR’s slowdown came from developers working in repositories they had contributed to for years. The authors suggest AI may help more on unfamiliar codebases.

The reverse is the failure condition. You have deep familiarity and strict conventions, and the assistant has to guess at both.

Learning a New Skill

An Anthropic randomized controlled trial (January 2026) found AI assistance led to a statistically significant decrease in mastery of a new Python library, while the speed gain did not reach significance.

How the developer used the assistant mattered. Three of the six interaction patterns involved cognitive engagement and preserved learning even with AI help.

For students, the evidence is thinner. A systematic review of student-AI pairing found varied results, with positive learning outcomes alongside less social connection, and called for more research.

Decision Rule

The assistant earns its place with unfamiliar frameworks and libraries, as long as you ask it to explain and not only to answer. It also does well on boilerplate, tests, and first drafts, and on explaining legacy code.

Do the rest by hand. That means core software architecture decisions and security-critical code paths. It also means anything you’re trying to learn, not just ship.

The assistant changes how fast you type. It does not change who answers for the result.

AI Pair Programming FAQ

Is GitHub Copilot the same thing as AI pair programming?

No. Copilot is one product, while the practice also runs on Cursor, Claude Code, Aider, and others.

GitHub introduced Copilot as “your AI pair programmer,” but the practice depends on how you work with the tool, not which one you install.

Can an AI assistant write tests and review code?

Yes, and test generation makes a good first task. Read every generated test before trusting it, because a test written from buggy code can lock the bug in.

Keep a human reviewer on the merge. The assistant is a second pair of eyes, not the last pair.

Is it safe to use with private or proprietary code?

Safety depends on the vendor’s data-handling terms for your plan, so read the retention and training policy before pasting in client code.

Aider can connect to almost any LLM, including local models, which keeps prompts on your own hardware.

Will AI pair programming replace developers?

Not on the current evidence. Anthropic’s research on coding skills notes that humans still need the skills to catch errors, guide output, and oversee AI in high-stakes settings.

The assistant writes fast. Someone still has to decide what ships.

How to Tell Whether AI Pair Programming Is Working

Run a four-week comparison on your own tickets, with the assistant on half the work and off the other half. Speed alone can’t settle it, and neither can developer sentiment.

Read together, METR’s timing data and DORA’s delivery findings suggest a simple rule. Count a speed gain only when stability holds beside it.

Baseline your current cycle time first, then match tickets with and without the assistant. Track review rework and failed deployments right next to speed.

The trade-off is a slower rollout, because the baseline weeks produce no gains. As of METR’s February 2026 update, selection effects had made its newer estimate unreliable, so a clean randomized replacement would change this advice.

Teams whose numbers hold can then boost productivity with AI coding by widening the tasks the assistant takes.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.