Overview
How might we design repair contract so people can trust and act on AI output?
When this pattern fits
- Important for high-stakes chat workflows where users iterate on drafts, analysis, or decisions and need predictable, explainable retries instead of random variation.
When to skip or lighten it
- First-turn prompts where there is nothing to repair yet.
- Creative brainstorming where tight constraints would kill useful variance.
- Fully autonomous agents that already self-correct with clear receipts.
States
State model coming soon
Key UX elements
Key UX elements coming soon
Anti-patterns to avoid
Retry buttons that resubmit the identical prompt with no delta.
Repair UIs that hide the constraints the model will follow.
Forcing users to retype the entire original request to fix one line.
Accepting a repair without showing what will stay unchanged.
How products use it
| Product | Implementation |
|---|---|
| Cursor | Follow-ups that cite the prior diff and ask for a targeted fix. |
| ChatGPT | Rewrite and continue prompts that scope the next answer. |
| Claude | Retry with user-stated constraints in the same thread. |
| GitHub Copilot | Inline fix prompts that reference the rejected suggestion. |
Implementation
Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.
Generate a production-ready implementation of the "Repair Contract" AI interface design pattern.
Pattern Definition:Frequently asked questions
What is a repair contract in AI UX?
A repair contract is a structured retry: the user states what was wrong, what must stay, and constraints for the next generation, so the model repairs instead of guessing.
When is repair better than a new chat?
Use repair when context, files, or tool results from the current thread still matter. Start a new chat when the goal itself changed.
What fields belong in a repair UI?
Keep, change, and constraints are enough. Optional severity or examples help. Show the prior output snippet being repaired.
How does this relate to self-correction?
Self-correction is the agent fixing itself. A repair contract is the user explicitly directing the fix. Products often combine both.