Show by example
Give AI an example or two and let it infer the shape for yours. Good when you can recognise a good answer but cannot generate one from scratch.
Copy this into your AI chat.
Replace the bracketed parts and paste one or two definitions you think are good. It drafts one in the same shape for your case, which you then run through Sharpen.
Doing this with Claude Code: Show by example
Do not lean on a flowery description of what you want, show the result you expect instead. Plain words get read a little differently each time so the output drifts, and a concrete example removes that room and pins it down. Use it as a fallback first. Start by describing what you want, and if that keeps giving mixed results, stop rewording it and switch to an example. Begin with the happy path, the normal case working as it should, then build from there. Keep each one concrete and narrow, because a broad example pins nothing down.
Vary your examples rather than repeating one shape, because a few genuinely different ones teach the underlying pattern and Claude can then handle a case you never showed it, where near-identical ones only teach that single case. Show the reasoning as well as the result when the call is a judgment one, why you chose this over the obvious alternative, so Claude picks up the principle and not just one answer. If a term in your example is loose, define it by example so Claude works from your meaning and does not invent its own. When you want Claude to judge what is acceptable, show one acceptable case next to one real problem so it learns where the line sits and stops flagging the harmless variation.
It earns its keep on the edge cases too. When the code trips on the odd one, the null, the empty, the boundary, hand over that single case as a worked example, this exact input gives this exact output, and let Claude fix just that. It works the other way as well, when Claude does something you do not understand, ask it to show you with an example.
An example earns its keep in five ways: consistency, generalisation, exact shape, ambiguity and reasoning.
Consistency, hold the shape. Show one recipe card laid out as a title, then ingredients, then steps, and every card comes back in that same shape, run after run.
Generalisation, a dish you never gave it. Show a few genuinely different cards, a dinner, a dessert and a drink, and Claude can write a snack card it never saw, because the spread taught it the pattern and not one layout.
Exact shape, leave nothing to guess. Show one card with every field filled in, so the shape is there to copy rather than described.
Ambiguity, pin down the vague bits. Show what salt to taste means once, a pinch building to about half a teaspoon for this soup, and Claude reads the next loose instruction the same way.
Reasoning, the why and not just the result. Show why a pinch and not a spoonful, because more would overpower it, and Claude picks up the principle instead of copying one amount.
Part of Ways to get to a sharp answer.