Question 31
Open question ↗Scenario: Code Generation with Claude Code
You asked Claude Code to implement a function that transforms API responses into an internal normalized format. After two iterations, the output structure still doesn’t match expectations—some fields are nested differently and timestamps are formatted incorrectly. You described requirements in prose, but Claude interprets them differently each time.
Which approach is most effective for the next iteration?
- A.Write a JSON schema describing the expected output structure and validate Claude’s output against it after each iteration.
- B.Provide 2–3 concrete input-output examples showing the expected transformation for representative API responses.
- C.Rewrite requirements with more technical precision, specifying exact field mappings, nesting rules, and timestamp format strings.
- D.Ask Claude to explain its current understanding of the requirements to identify where interpretations diverge.