AI code review and pair programming: what stays human, what goes to the LLM

Confident bearded man in blue shirt with arms crossed against bamboo wall background

Mirgen Hoxha, Founder & CEO – Motomtech | May 2026

The teams shipping the cleanest AI-augmented code in 2026 aren’t the ones using AI most aggressively. They’re the ones who have drawn the line clearly: here is what we hand to the LLM, here is what we keep on a senior engineer’s screen, and here is the rule that decides which side of the line any specific task falls on.

This post is that map. Where AI tools are a real productivity multiplier in pair programming and code review, where they aren’t, and the one rule that keeps the workflow accountable when the boundary is ambiguous.

The rule that decides everything else: the human owns the diff

Before any list of tasks, the governing principle: whoever submits the pull request owns the diff. Not “the AI wrote it.” Not “Claude generated this part.” The engineer’s name is on the commit, and the engineer can defend every line in code review.

This sounds obvious. It is not how a lot of teams are actually shipping AI-assisted code in 2026. The common drift pattern: engineer asks Cursor to implement a function, accepts the output without reading it line by line, runs the tests, and submits the PR. The function works for the cases the tests cover. The engineer cannot explain why the function is structured the way it is, because they didn’t write it.

This breaks down at the first edge case the tests didn’t cover, and it breaks down badly. The engineer doesn’t understand the code well enough to debug it. The reviewer sees a PR signed by an engineer who can’t answer questions about it. The bug ships, and the postmortem reveals that nobody on the team actually understood the change.

The “human owns the diff” rule is the antidote. If the engineer can’t explain a line in the PR, that line gets rewritten, with the engineer driving and the AI assisting, until the engineer understands every choice. The output might be identical to what Claude produced the first time. The engineer’s relationship to it is different.

This rule shapes the rest of the boundaries below.

Where AI is a real productivity multiplier

These are the tasks where Claude, Cursor, GitHub Copilot, or Aider produce meaningful acceleration on a properly staffed team. The pattern they share: the engineer can verify the output quickly by reading it, the task is well-bounded, and the consequences of a subtle mistake are low or caught by tests.

Boilerplate. CRUD endpoints against a known data model, DTO mapping between layers, form validation against a defined schema, request and response serializers, configuration scaffolding. The shape of the code is determined by patterns the LLM has seen many times. The engineer’s job is to verify the output matches the shape, not to invent it.

Mechanical refactoring. Renames across a codebase, extract method or function, inline a temporary variable, convert a callback chain to async/await, migrate from one named pattern to another. The intended behavior is unchanged; the surface form is changing. AI tools handle these confidently because the rewrite is deterministic at the level of meaning.

Test scaffolding given expected behavior. When the engineer can articulate what the function should do under specific inputs, the LLM can write the test cases. The engineer provides the contract; the AI generates the harness. The trap to avoid: don’t let the AI infer the expected behavior from the implementation. That produces tests that pass by tautology. The expected behavior comes from the human; the AI fills in the assertions.

Documentation. Docstrings on existing functions, README sections for established modules, architecture decision records that document choices the human has already made, code comments that explain non-obvious logic. The engineer makes the decision; the AI writes it down. This is where the time-savings compound across an engagement, because documentation is the thing teams skip when they’re under pressure.

Translation between languages or framework versions. Porting a TypeScript function to Python with equivalent behavior, migrating from React class components to hooks, updating a Django app from one major version to the next. The semantic meaning is stable; the syntax is changing. AI tools are reliable here when the engineer can spot-check the translation.

Where AI is not a real productivity multiplier

These are the tasks where pushing harder on AI tools produces worse outcomes, not better ones. The pattern they share: the right answer depends on context the LLM doesn’t have, the consequences of a subtle mistake are severe, or the work is structural rather than implementation.

Architecture decisions. Where the system’s boundaries should sit, who owns which data, how services communicate, what gets cached and where, what’s eventually consistent and what isn’t. These are judgment calls that depend on team capacity, regulatory context, customer expectations, and the next 18 months of roadmap. The LLM doesn’t have access to those inputs. It can suggest patterns it has seen, but it can’t tell you which one is right for your specific system.

The failure mode when teams ask AI tools to make architecture decisions: the LLM gives a confident answer, the engineer treats it as authoritative, and the team is six months into a pattern that doesn’t fit the actual problem before anyone notices.

Security-critical code paths. Authentication, authorization, cryptographic operations, session management, secrets handling. AI tools regularly produce code that looks correct in these areas and has subtle vulnerabilities. The most common pattern: the LLM writes an auth check that handles the happy path correctly and misses a timing attack, a session fixation, or a token-replay window. The engineer accepts it because it passes the tests; the tests didn’t cover the vulnerability because the engineer didn’t know to write that test.

The discipline here is to treat AI-suggested security code as a draft that gets reviewed line-by-line against a documented threat model. If your team doesn’t have a documented threat model for the security-sensitive code paths, don’t use AI tools to write them, because you don’t have the apparatus to catch the failures.

Business logic the LLM hasn’t seen examples of. Novel domain modeling for an industry the AI hasn’t been trained on extensively, organization-specific workflows, internal-tool patterns that are unique to your business. The LLM will generate plausible-looking code that implements a generic version of the pattern. It looks correct because the surface form matches production code patterns. It’s wrong in ways that surface only when the business logic gets exercised by real users.

The signal to watch for: when an engineer asks the LLM to implement a domain function and the output references entities or patterns that aren’t in your codebase, the LLM is hallucinating from training data. That output should not ship without substantial human rewrite.

Novel algorithms. If the work involves inventing an algorithm that doesn’t already exist in the literature, AI tools are not productivity multipliers. They will generate something that looks like an algorithm and doesn’t solve the problem correctly. Stick to human-led design for genuinely new work.

The pair programming pattern that works

The boundary above suggests a workflow. Here’s what it looks like in practice across a typical PR.

Step 1: human writes the spec. Plain language, given/when/then form, explicit on data shapes and edge cases. This is the work the AI cannot do, because the spec encodes business intent.

Step 2: LLM drafts the implementation. The engineer prompts Cursor or Claude with the spec and the relevant context files. The AI produces a candidate. This is the step that compresses the most time.

Step 3: human reviews and tests. Read every line. Ask “why is this written this way?” If the answer isn’t obvious, ask the AI to explain. If the explanation reveals a misunderstanding, rewrite. Run the tests. Run them again with the edge cases the AI didn’t cover.

Step 4: LLM helps debug failures. When something fails, paste the failure into the AI and ask for hypotheses. The AI is genuinely good at this because debugging is pattern-matching against many examples it has seen. The engineer evaluates the hypotheses, picks the right one, and applies the fix.

Step 5: human submits the PR. With the rule from the top of this post: the engineer can defend every line. If the PR comes back with a reviewer question the engineer can’t answer, the engineer doesn’t get to say “Claude wrote that part.” The engineer rewrites with understanding.

This workflow consistently produces shippable code at the velocity AI tooling promises. The workflows that drop step 3 or step 5 produce code that ships and then breaks in subtle ways the team can’t debug efficiently.

AI in code review specifically

Code review is its own surface, separate from pair programming. AI tools in code review are best used as a first pass before the human reviewer, not as a replacement for the human.

Useful in review: linting and formatting checks (auto-fix where possible, fail PR on errors), test coverage gaps on changed lines, obvious dead code, type errors, common security smells (hardcoded secrets, missing null checks, SQL string concatenation), missing or incorrect documentation, deviations from established codebase patterns.

Not useful in review: judgment on whether the architectural choice is right for the system, whether the business logic matches the user need, whether the new code is consistent with where the codebase is heading next quarter, whether the abstraction is at the right level. These are exactly the things a senior engineer should be reading the PR for, freed up by the AI handling the mechanical layer.

The team-level pattern that works: AI runs the mechanical pass automatically on every PR, with results posted as a comment. The senior engineer reads the AI’s findings, dismisses the noise, and focuses their attention on the judgment layer. Review latency drops because mechanical issues are pre-surfaced. Review quality rises because senior engineers spend their time on the things only humans can evaluate.

The pattern that doesn’t work: AI tools as the only review. No senior engineer in the loop. PRs ship if the AI says they’re clean. This produces a codebase where the AI’s blind spots become the team’s blind spots, and they compound until the production incident.

What this looks like across a 12-week engagement

For a buyer evaluating an AI-accelerated dev vendor, the practical question is what the boundaries look like across a typical engagement. Roughly:

  • Weeks 1-3 (discovery and architecture). AI tools are minimally involved. The work is stakeholder alignment, scope clarification, system design, threat modeling. Senior engineers are doing the work that AI can’t.
  • Weeks 4-10 (implementation). AI tools are heavily involved on boilerplate, test scaffolding, refactoring, and documentation. Senior engineers are driving the architecture and reviewing every diff. Business logic and security-sensitive code get human-led work.
  • Weeks 11-12 (integration and hardening). AI tools help on test coverage gaps and debugging. Senior engineers are doing production readiness, load testing, security review, observability setup. The hardening phase doesn’t accelerate much because most of the work depends on runtime context.

The compression is real in the middle weeks. The bookend weeks look about the same as they always did. This is consistent with the velocity math in the cornerstone post on AI-accelerated custom software development: 16-24 weeks compresses to 8-12, not 4-6, because the bookends don’t shrink.

FAQ

Q: When is AI pair programming a bad fit for a task?

AI pair programming is a bad fit when the right answer depends on context the LLM doesn’t have, including architecture decisions specific to your system, security-critical code paths where threat models matter, novel business logic without examples in training data, and genuinely new algorithm design. The common failure pattern is the LLM producing plausible-looking output that’s wrong in subtle ways the engineer can’t catch because the surface form matches production code.

Q: What does the “human owns the diff” rule mean in practice?

It means the engineer whose name is on the PR can defend every line in code review. If the AI generated the line and the engineer can’t explain why it’s structured the way it is, the engineer rewrites with understanding before submitting. The output might be identical to what the AI produced; the engineer’s relationship to it is different. This is the rule that prevents AI-generated bugs from shipping unsupervised.

Q: Should AI tools replace human code review entirely?

No. AI tools in code review work as a first pass that surfaces mechanical issues (linting, coverage gaps, common security smells, deviations from codebase patterns), letting senior engineers focus on judgment-layer review (architecture, business logic, abstraction level). Teams that drop human review entirely produce codebases where AI blind spots become team blind spots and compound until a production incident.

Q: What categories of work get genuine acceleration from AI pair programming?

Boilerplate (CRUD endpoints, DTO mappings, validation schemas), mechanical refactoring (renames, extract method, inline variable), test scaffolding when the human supplies the expected behavior, documentation (docstrings, READMEs, ADRs that document already-made decisions), and translation between languages or framework versions. The pattern they share: the engineer can verify the output by reading it, the task is well-bounded, and the consequences of a subtle mistake are low or caught by tests.

Q: How should AI-generated security code be reviewed?

Line-by-line against a documented threat model, treating the AI output as a draft rather than a candidate. AI tools regularly produce auth, authz, and crypto code that looks correct and has subtle vulnerabilities (timing attacks, session fixation, token-replay windows). If your team doesn’t have a documented threat model for the security-sensitive code paths, don’t use AI tools to write them, because the apparatus to catch the failures isn’t in place.

Related reading

Next step

Motomtech runs the human-owns-the-diff rule across every engagement and writes the boundary explicitly into our SDLC documentation. If you’re trying to figure out where to draw the line in your team’s adoption, or evaluating a vendor’s claims about pair programming velocity, book a 15-min discovery call. We’ll walk through what your team is doing now and where the boundary is sitting relative to the failure modes above.

Mirgen Hoxha, CEO, Motomtech.

Ready to accelerate your digital transformation?

Subscribe To Our Newsletter

Subscribe to our newsletter and get the latest case studies to your email address.

Logo icon