PromptingIntermediateClaude API
Examples with their reasoning clear up gray areas
For ambiguous requests, an example with its why shows Claude when to act and when to escalate, better than another paragraph of rules.
Pick 2 to 4 cases where the decision is not obvious and write the input, the expected action and the reasoning. Claude generalizes the pattern to new cases; it does not copy the examples. They also help fix the output format and extract informal units ("two handfuls of rice").
Example
Request: "My order is broken" Action: get_customer -> lookup_order -> check status. Why: "broken" may mean a damaged item; the order has to be checked. Request: "Put me through to a manager" Action: escalate_to_human immediately. Why: they asked for a person; do not try to solve it alone.