Skip to main content

RepoPrompt Pair Programming Guide

RepoPrompt is a powerful MCP (Model Context Protocol) server that enables sophisticated AI pair programming workflows. This guide explains how to use RepoPrompt with Claude Code for complex development tasks.

Overview

The pair programming mode allows Claude Code to collaborate with other AI models (like OpenAI’s O1/O3 or Google’s Gemini) by:
  • Claude Code acts as a context manager - gathering files, managing tokens, and handling tools
  • Another AI model acts as the planner/executor - providing deep reasoning and implementation
  • Both models work together continuously throughout the task

Key Benefits

  1. Leverages Model Strengths: Claude excels at tool use and navigation; reasoning models excel at complex problem-solving
  2. Optimal Context Management: Reasoning models work best with complete context upfront rather than incremental discovery
  3. Continuous Collaboration: Maintains conversation state and file context between messages
  4. Higher Quality Output: More considered implementations for complex tasks

Installation

Prerequisites

  • Claude Code with MCP support
  • RepoPrompt MCP server installed

Quick Setup

Basic Workflow

1. Select Your Working Files

First, identify and select files relevant to your task:
Tips:
  • Keep total context under 100K tokens (ideally ~60K)
  • Select only directly relevant files
  • Use get_code_structure to preview large files efficiently

2. Set Your Task Description

Write a clear prompt describing what you want to accomplish:

3. Start the Pair Programming Session

Begin with planning mode to have the AI create a detailed implementation plan:

4. Execute the Plan

Switch to edit mode to implement the changes:

Advanced Features

File Discovery Workflow

Before starting, use these tools to find relevant files:

Context Management Strategy

  1. Start Minimal: Begin with core files only
  2. Add Dependencies: Include related files as needed
  3. Monitor Token Count: Check with manage_selection action="list" include_stats=true
  4. Update Between Tasks: Use replace when switching focus

Working with Multiple Models

RepoPrompt supports various AI models. List available presets:
Choose a specific model for your task:

Practical Examples

Example 1: Adding a New Feature

Example 2: Debugging Complex Issues

Example 3: Refactoring

Best Practices

1. Context Selection

  • Start with minimal context and add as needed
  • Include test files when modifying code
  • Add configuration files for system-wide changes
  • Remove files that are no longer relevant

2. Prompt Writing

  • Be specific about requirements
  • Include constraints (e.g., “maintain backward compatibility”)
  • Mention relevant technologies and patterns
  • Specify testing requirements

3. Mode Selection

  • Use plan mode for:
    • Complex architectural decisions
    • Multi-file refactoring
    • New feature design
  • Use edit mode for:
    • Direct implementation
    • Bug fixes with clear solutions
    • Following an established plan
  • Use chat mode for:
    • General discussions
    • Code exploration
    • Understanding existing code

4. Session Management

  • Continue existing chats for related work:
  • Start new chats for unrelated tasks
  • Name your chats for easy identification:

Troubleshooting

Common Issues

  1. Token Limit Exceeded
    • Check current usage: manage_selection action="list" include_stats=true
    • Remove unnecessary files: manage_selection action="remove" paths=["large-file.ts"]
    • Use code structure instead of full content for large files
  2. Model Not Responding
    • Reasoning models can be slow, especially on complex tasks
    • Wait for completion before sending follow-up messages
    • Consider breaking large tasks into smaller chunks
  3. Context Lost Between Messages
    • Ensure you’re continuing the same chat session
    • Verify file selection hasn’t changed: manage_selection action="list"
    • Check chat history: chat_tools action="log"
  4. Edit Mode Not Working
    • Ensure you have write permissions for target files
    • Verify files exist and are selected
    • Check for syntax errors in previous edits

Getting Help

  • Use chat_tools action="log" to review conversation history
  • Check file selection state with manage_selection action="list"
  • Verify model availability with list_models
  • Ensure RepoPrompt is running: claude mcp list

Advanced Workflows

Multi-Stage Development

For complex features spanning multiple components:
  1. Stage 1: Architecture Planning
  2. Stage 2: Core Implementation
  3. Stage 3: Integration

Collaborative Review

Use RepoPrompt for code review and improvements:

Tips for Success

  1. Let Models Play to Their Strengths
    • Claude: File navigation, tool use, quick edits
    • O1/O3: Deep reasoning, complex algorithms, architecture
    • Gemini: Large context analysis, pattern recognition
  2. Maintain Clear Separation
    • Planning: High-level design and approach
    • Execution: Actual code changes
    • Verification: Testing and validation
  3. Use Appropriate Context
    • Include enough context for understanding
    • But not so much that it overwhelms the model
    • ~60K tokens is often the sweet spot
  4. Iterate Thoughtfully
    • Start with planning before jumping to implementation
    • Review plans before execution
    • Test incrementally

Conclusion

RepoPrompt’s pair programming mode enables sophisticated AI collaboration for complex development tasks. By leveraging multiple models’ strengths and maintaining careful context management, you can tackle challenging problems more effectively than with a single model alone. Remember: The key is using Claude Code as an intelligent context manager while letting reasoning models handle complex problem-solving. This division of labor produces higher quality results than either model working alone.