Principle
Pair programming with AI is synchronous collaboration: you hold context, intent, and accountability; the model holds stamina for boilerplate, search, and first drafts. It is not autopilot. The quality ceiling is still your judgment; the floor rises when you run tight loops.
The habit that separates productive pairs from messy repos: small diffs, explicit intent, immediate verification.
The decision
DEC_010
Intent (ticket + constraints)
│
▼
Model proposes diff
│
▼
You review ──► reject / edit / accept
│
▼
Verify (run, test, read)
│
▼
Commit with message that states whySession hygiene
- Start from a clean tree — know what is already dirty; stash unrelated work.
- Point at files —
@path, selections, or “only editsrc/auth/.” - State non-goals — “do not add dependencies,” “no schema changes.”
- One concern per session — auth fix ≠ sidebar redesign.
- Run the verifier — build, test, or manual repro before you move on.
- Commit — chat history is not version control.
Review what the model writes
| Check | Why |
|---|---|
| Does it match the ticket? | Scope creep is the default |
| New dependencies? | Each one is a maintenance bet |
| Error handling | Models love happy paths |
| Names and types | Garbage names hide wrong logic |
| Secrets | Never accept pasted keys |
| Tests | Did it assert behavior or itself? |
If you cannot summarize the diff aloud in thirty seconds, split the task.
Workflow
- Write or paste the spec stub — outcome, non-goals, acceptance checks.
- Open pair session with repo context (rules file, relevant files).
- Implement → review → verify loop until acceptance passes.
- You commit; message references the decision, not the model brand.
- Note surprises in the ticket — fodder for
AGENTS.mdupdates.
Tooling
Cursor, Claude Code, Copilot, Cody — interchangeable if the loop is disciplined. Terminal access helps; blind acceptance does not.
Common mistakes
- “Fix everything” prompts that touch twenty files.
- Merging without running anything because it “looked right.”
- Letting the model rewrite working code for style mid-feature.
- No
AGENTS.md— every session reinvents conventions.
Artifacts
templates/spec-stub.md— before implementation.templates/pair-session.md— intent, verify, outcome log.
Further reading
- Chapter 08 — Owning the codebase
- Chapter 10 — Agentic development
- Chapter 12 — Testing and maintainability