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
- Leverages Model Strengths: Claude excels at tool use and navigation; reasoning models excel at complex problem-solving
- Optimal Context Management: Reasoning models work best with complete context upfront rather than incremental discovery
- Continuous Collaboration: Maintains conversation state and file context between messages
- 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:- 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
- Start Minimal: Begin with core files only
- Add Dependencies: Include related files as needed
- Monitor Token Count: Check with
manage_selection action="list" include_stats=true
- Update Between Tasks: Use
replace
when switching focus
Working with Multiple Models
RepoPrompt supports various AI models. List available presets: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
-
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
- Check current usage:
-
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
-
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"
-
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:-
Stage 1: Architecture Planning
-
Stage 2: Core Implementation
-
Stage 3: Integration
Collaborative Review
Use RepoPrompt for code review and improvements:Tips for Success
-
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
-
Maintain Clear Separation
- Planning: High-level design and approach
- Execution: Actual code changes
- Verification: Testing and validation
-
Use Appropriate Context
- Include enough context for understanding
- But not so much that it overwhelms the model
- ~60K tokens is often the sweet spot
-
Iterate Thoughtfully
- Start with planning before jumping to implementation
- Review plans before execution
- Test incrementally