Give the AI Code Ownership
You get a feature added with the duplicated code merged, rather than a third copy bolted on. Telling the AI it owns the design and will maintain it long term shifts it from patching to tidying.
The prompt
Act as the sole owner and long-term maintainer of this codebase. Its design is your decision, and you will be the one living with it for years.
Task: Add the requested feature to the code below, and leave the codebase tidier than you found it.
Feature request: {feature_request}
Existing code:
{existing_code}
Steps:
1. Read the existing code and list any duplicated logic, near-identical functions or copy-pasted blocks relevant to the feature.
2. Decide on the cleanest design as the long-term owner would, merging duplicates into shared helpers rather than adding another copy.
3. Implement the feature using that design, keeping existing behaviour unchanged.
4. Check that every caller of any merged code still works, and note anything you could not verify.
Output:
First, a short "Design decisions" list of no more than five bullet points explaining what you merged and why. Then the complete updated code in one code block per file. Finish with a "Risks" line naming anything the maintainer should test.
Change the parts in curly braces. Use it when a codebase has copy-pasted logic and you want a feature added without piling on more duplication.
What happened when we ran it
We sent
Act as the sole owner and long-term maintainer of this codebase. Its design is your decision, and you will be the one living with it for years.
Task: Add the requested feature to the code below, and leave the codebase tidier than you found it.
Feature request: Add a 10% discount for customers who have placed more than five orders. The discount must appear on both the basket page total and the emailed invoice.
Existing code:
def basket_total(items):
total = 0
for i in items:
total += i['price'] * i['qty']
return round(total, 2)
def invoice_total(items):
t = 0
for item in items:
t += item['price'] * item['qty']
return round(t, 2)
def send_invoice(customer, items):
body = 'Total: ' + str(invoice_total(items))
email(customer['email'], body)
Steps:
1. Read the existing code and list any duplicated logic, near-identical functions or copy-pasted blocks relevant to the feature.
2. Decide on the cleanest design as the long-term owner would, merging duplicates into shared helpers rather than adding another copy.
3. Implement the feature using that design, keeping existing behaviour unchanged.
4. Check that every caller of any merged code still works, and note anything you could not verify.
Output:
First, a short "Design decisions" list of no more than five bullet points explaining what you merged and why. Then the complete updated code in one code block per file. Finish with a "Risks" line naming anything the maintainer should test.
The model replied
Run on Claude Sonnet 5.5, 12 Nov 2026. Automatic check: 4 out of 5.
Mentioned for
Claude
Where it came from
Found on Web, shared by Simon Willison (quoting Anthropic docs): A quote from Prompting Claude Fable 5.2.
This is our own version of the idea, written and tested by us. The original may differ.