Iterative Refinement
This task is mostly workflow practice. Doc-backed facts are marked verified; the techniques are design guidance consistent with Anthropic's Claude Code workflow recommendations.
Techniques (design guidance)
- Concrete input/output examples. When prose instructions get misread, show two or three before/after pairs (for example a raw log line and the exact parsed output you want). Examples pin down format and edge cases better than adjectives.
- Test-driven iteration. Write or provide tests first, run them, and give Claude the failures; it fixes until green. Tests are an objective definition of done.
- Interview pattern for unclear requirements. Ask Claude to question you before it builds. Claude Code has an
AskUserQuestiontool (verified) that asks multiple-choice questions to gather requirements or clarify ambiguity. - Small increments. Refactor and commit in small, testable steps; verify after each.
- Reproduce first for bugs. Give the command that reproduces the failure and the error or stack trace; say whether it is intermittent (verified in common workflows).
- Feed back specifics. "Line 42 returns null when the list is empty" beats "it's wrong".
Practical loop
Describe the goal and acceptance criteria, then run: attempt, check against tests or examples, give targeted feedback, repeat. When one approach keeps failing, restart with a clearer spec or a plan instead of patching the patch.
Verified supporting facts
- Reference files with
@pathso content is included directly; images and screenshots can be pasted for UI work. - Claude examines existing test files to match style and frameworks; be specific about the behaviour to verify.
- Resume work across sittings with
claude --continueor--resume.
Exam traps
- Re-describing the problem in more adjectives when an example would settle it.
- Accepting generated code without running the tests.
- Large multi-purpose requests instead of incremental ones.
- Skipping the interview when requirements are genuinely ambiguous.
References
- Common workflows — checked Oct 16, 2026
- Tools reference — checked Oct 16, 2026
Check your understanding
Claude keeps misformatting the output despite your description. Best fix?Show answerHide answer
Answer
Provide concrete input/output examples.How do you make "done" objective?Show answerHide answer
Answer
Tests Claude can run and fix against.Requirements are vague. Approach?Show answerHide answer
Answer
Have Claude interview you first (clarifying questions) before building.