Repair Contract

Repair contract is an AI UX pattern that turns a failed or weak answer into an explicit retry brief: what to change, what to keep, and hard constraints for the next run. Users steer the model with a delta instead of rewriting the whole prompt from scratch.

Share

Interactive demo

Needs repair
Is invoice 4412 overdue?
Invoice #4412 for Globex is past due by 14 days. I can draft a reminder using the Globex billing contact.

Wrong account (Globex). Capture what to fix for next time.

Overview

The design problem

How might we design repair contract so people can trust and act on AI output?

Use this pattern

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.

Avoid this pattern

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

ProductImplementation
CursorFollow-ups that cite the prior diff and ask for a targeted fix.
ChatGPTRewrite and continue prompts that scope the next answer.
ClaudeRetry with user-stated constraints in the same thread.
GitHub CopilotInline 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.

Weekly AI UX in your inbox

Weekly AI interface UX notes and resources on Substack, no spam, unsubscribe anytime.

Subscribe on Substack