Question 1 · choose 1
You asked Claude Code to write a function that normalizes customer phone numbers, described in two paragraphs of prose. Each revision handles a different subset of formats, and extensions and country codes keep coming out wrong. What should you do next?
- ASwitch to plan mode and ask Claude to design the function again
- BGive two or three concrete input and output pairs, including an extension and a country code
- CRewrite the description at greater length, adding a sentence for each format that was handled wrongly
- DAsk Claude to be more careful and to double-check its work against the description before answering
Show the answer and why
ASwitch to plan mode and ask Claude to design the function again
Incorrect
The problem is an unclear specification, not a missing plan.
BGive two or three concrete input and output pairs, including an extension and a country code
Correct
Concrete examples remove the ambiguity that prose leaves, so Claude sees exactly which transformation is expected.
CRewrite the description at greater length, adding a sentence for each format that was handled wrongly
Incorrect
More prose is open to the same inconsistent readings that caused the problem.
DAsk Claude to be more careful and to double-check its work against the description before answering
Incorrect
Asking for care does not tell Claude what the correct output is.
When prose descriptions are read inconsistently, a few concrete input/output examples are the most effective way to show the expected transformation.
Anthropic documentation