From grimoire
Walks through pair programming setup, role rotation, and environment sharing to improve code quality and knowledge transfer. Use for onboarding, complex tasks, or subtle debugging.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:apply-pair-programmingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Two engineers work together at one workstation — one driving (writing code), one navigating (reviewing and thinking ahead) — to produce higher quality code with shared understanding.
Two engineers work together at one workstation — one driving (writing code), one navigating (reviewing and thinking ahead) — to produce higher quality code with shared understanding.
Adopted by: Pivotal Labs (now VMware Tanzu) applied it 100% of the time; Thoughtworks standard practice; Google and Microsoft use it for high-stakes code Impact: Williams et al. IEEE Software study: 15% more time invested, 15% fewer defects, and knowledge spread across two engineers; Cockburn and Williams meta-analysis shows pairing reduces defects by 15-50% depending on task complexity Why best: Real-time code review catches defects earlier (cheapest point to fix); knowledge sharing reduces bus factor; two minds on complex problems produce better solutions
Sources: Beck "Extreme Programming Explained" (1999); Williams "The Collaborative Software Process" UU CS dissertation (2000); Williams & Kessler "Pair Programming Illuminated" (2002)
Select appropriate tasks — Pair on: new feature development in unfamiliar codebase, complex algorithms, security-sensitive code, and cross-team integration points. Don't pair on: trivial bug fixes, mechanical refactors, spike investigations (pair after to share findings).
Define driver and navigator roles — Driver: types code, focuses on syntax and immediate implementation. Navigator: reviews as code is written, thinks ahead about design, spots errors the driver misses, consults documentation. Swap roles every 25-45 minutes (use a timer).
Set up a shared environment — Use a shared screen (in-person) or remote screen sharing (VS Code Live Share, JetBrains Code With Me, tmux for terminal). Both must see the same code. The navigator must be able to take control easily. Ensure both have adequate display resolution.
Align on the task before coding — Spend 5-10 minutes discussing: what you're building, the approach, and expected interfaces. Disagreements resolved before coding are faster than disagreements mid-implementation. Write a failing test or stub signature to anchor the discussion.
Driver: think aloud — Narrate your thought process while typing. "I'm going to handle the null case here because..." Verbalization lets the navigator track intent and intervene early when the approach diverges from the plan.
Navigator: review in real time, not retrospectively — Call out issues as they appear, not after a long sequence is written. "That variable name is ambiguous" or "We'll need to handle the empty list case in that branch." Stay strategic — avoid micromanaging keystrokes.
Swap roles on a timer — Use 25-minute Pomodoro intervals or swap at natural breakpoints (after a test passes, after a method is complete). The person who has been navigating takes over driving. Asymmetric swapping defeats knowledge-sharing benefits.
Take breaks together — Every 90 minutes, take a 10-minute break. Pairing is mentally intensive; fatigue reduces benefit and increases friction. Shorter sessions are more productive than extended fatigued sessions.
Debrief after the session — 5 minutes: what went well, what was frustrating, what did each person learn. This feedback loop improves future pairing sessions and surfaces process issues before they become resentments.
Track outcomes — Log pairing sessions: who, what task, duration, and subjective quality rating. Review monthly to identify: who pairs with whom (knowledge distribution), which task types benefit most, and velocity impact vs. quality improvement.
npx claudepluginhub jeffreytse/grimoire --plugin grimoireStructure effective pair programming sessions for learning, code quality, and knowledge transfer. Use when onboarding, tackling high-risk work, or mentoring through complex problems.
Effective pair programming, driver/navigator roles, tools, and collaboration patterns.
Manages AI pair programming sessions with driver/navigator roles, TDD, real-time code review, and quality verification. Invoke when collaborating on code with role-based workflows.