This playbook guides you through using pair programming mode where an AI agent handles implementation while you supervise.
Before starting, ensure you have:
-
persona-switchingconfigured (seeskills/persona-switching/SKILL.md) - GitHub CLI (
gh) installed and authenticated - Git worktrees enabled (standard Git feature)
- Agent has repository access
-
Configure persona-switching
# Source the persona config source ~/.claude/persona-config.sh # Verify setup persona_health_check
-
Create worktrees directory
mkdir -p ../.worktrees echo ".worktrees/" >> .gitignore
-
Set notification preferences (optional)
Add to your repository's
docs/ways-of-working/pair-programming.md:## Notification Preferences - notify:checkpoint - Alert on phase transitions - notify:blocked - Alert when agent is blocked
Each session, verify configuration:
# Check current persona
show_persona
# Check for active pair programming sessions
gh issue list --label "pair-programming:active"# Assign agent to specific issue
gh issue edit 123 --add-assignee @agent# Start pair programming on issue
/pair #123
# Process next priority item
/pair --next# Process all P1 issues
/pair --backlog --priority p1Check active work:
# View agent's current assignment
gh issue list --assignee @agent --state open --limit 1
# View all active pair programming sessions
gh issue list --label "pair-programming:active"Read status updates:
- Agent posts status comments to assigned issues
- Draft PRs show work in progress
- Labels indicate current state:
pair-programming:active- Workingpair-programming:blocked- Waitingpair-programming:review- Ready for review
Request status:
gh issue comment 123 --body "@agent status"Pause work:
gh issue comment 123 --body "@agent pause"Provide guidance:
gh issue comment 123 --body "@agent note: Consider using the existing validation helper"Resume work:
gh issue comment 123 --body "@agent continue"-
Create well-defined issue with acceptance criteria
-
Add priority label (
priority:p1,priority:p2, etc.) -
Add
readylabel when Definition of Ready met -
Assign to agent:
gh issue edit 123 --add-assignee @agent
-
Agent will:
- Acknowledge in comment
- Create plan document
- Begin implementation
- Post progress updates
-
Review PR when agent completes
- Create issue describing bug and expected behaviour
- Include reproduction steps if available
- Add
bugand priority labels - Assign to agent
Agent will:
- Reproduce the bug
- Write failing test first (TDD)
- Implement fix
- Verify fix passes
- Create PR
When agent is blocked:
- Agent posts blocker details to issue
- Agent adds
pair-programming:blockedlabel - Agent switches to parallel work if available
To unblock:
- Provide needed information in issue comment
- Resolve external dependency
- Comment
@agent blocker resolved
Agent will resume blocked task automatically.
If you need to take over:
gh issue comment 123 --body "@agent I'm taking over this task"Agent will:
- Post current state summary
- List in-progress work
- Note uncommitted changes
- Remove itself from assignment
Partial takeover:
# Take specific aspect
gh issue comment 123 --body "@agent I'll handle the database migration, continue with API work"After your changes:
-
Commit and push your work
-
Update issue with current state
-
Comment to hand back:
gh issue comment 123 --body "@agent please continue from current state"
Check:
- Is agent assigned to issue?
- Does issue have
readylabel? - Is another session active?
Resolution:
# Check agent's current work
gh issue list --assignee @agent --state open
# Re-assign if needed
gh issue edit 123 --remove-assignee @agent
gh issue edit 123 --add-assignee @agentIf agent keeps iterating on review feedback:
# Check iteration count in comments
gh issue view 123 --comments
# Override if needed
gh issue comment 123 --body "@agent proceed to human review despite pending items"If worktrees have conflicts:
# List all worktrees
git worktree list
# Remove stale worktrees
git worktree prune
# Force remove specific worktree
git worktree remove ../.worktrees/wt-backend-123 --forceTo reset pair programming state on an issue:
# Remove all pair programming labels
gh issue edit 123 --remove-label "pair-programming:active"
gh issue edit 123 --remove-label "pair-programming:blocked"
gh issue edit 123 --remove-label "pair-programming:review"
# Remove agent assignment
gh issue edit 123 --remove-assignee @agent
# Close any draft PRs
gh pr close <pr-number>- Review skill documentation:
skills/pair-programming/SKILL.md - Check agent's issue comments for context
- Contact repository maintainers
| Action | Command |
|---|---|
| Assign work | gh issue edit N --add-assignee @agent |
| Check status | gh issue comment N --body "@agent status" |
| Pause work | gh issue comment N --body "@agent pause" |
| Resume work | gh issue comment N --body "@agent continue" |
| Take over | gh issue comment N --body "@agent I'm taking over" |
| View active work | gh issue list --label "pair-programming:active" |
| View blocked work | gh issue list --label "pair-programming:blocked" |