Apply Mode
Apply Mode is a powerful feature that lets you take code changes suggested by external AI services (like ChatGPT web interface or Claude) and apply them directly to your local files.
When to Use Apply Mode
Apply Mode is ideal when:
- You're using a web-based AI interface rather than RepoPrompt's integrated chat
- You have existing conversations with AI services that you want to implement
- You prefer using specific external AI services for certain tasks
The XML Diff Format
For Apply Mode to work, the AI response must use a specific XML format that includes:
<plan>: Overall explanation of the changes<file>: Container for changes to a specific file<change>: Individual edit within a file<search>: The original code to find<content>: The new code to replace it with
Asking the AI for the Correct Format
- In the "Apply" tab, select the files relevant to your task
- Enter your instructions in the "Instructions" text area
- Click the "Copy with Diff Edit Prompt" button
- Paste the complete prompt into your external AI service
- This prompt includes special instructions that ask the AI to respond using the required XML format
Applying AI Suggestions
- Once the AI responds with XML-formatted changes, copy the entire response
- In RepoPrompt, click the "Apply" tab
- Paste the AI response into the "AI Response" text area on the right side
- Click the "Merge Changes" button
- RepoPrompt will parse the XML and display the proposed changes in a diff review screen
- Review each change carefully
- Click "Accept All Files" to apply all changes, or review and accept individual files
- Click "Reset All Files" to discard all changes
- Click "Exit Review" when done
Troubleshooting Apply Mode
If the AI response doesn't parse correctly:
- Ensure the response contains the proper XML tags (
<plan>,<file>, etc.) - Check that file paths in the response match your actual project structure
- Verify that the
<search>blocks exactly match portions of your actual files - Try using the "Copy with Diff Edit Prompt" button again to generate a clearer prompt
tip
Tip: For complex edits across multiple files, you may get better results by breaking your request into smaller chunks, focusing on related files in each request.