Iterative Refinement Techniques
CoreApply iterative refinement techniques for progressive improvement · Difficulty 2/5
0%
iterative-refinementtest-driveninterview-patternexamples
Iterative refinement is the practice of progressively improving Claude's output through structured feedback rather than trying to get perfect results in one shot.
Concrete Input/Output Examples
When prose descriptions are interpreted inconsistently, provide 2-3 concrete examples:
Input: "2024-01-15T10:30:00Z"
Expected: "January 15, 2024 at 10:30 AM UTC"
Input: "2024-12-31T23:59:59Z"
Expected: "December 31, 2024 at 11:59 PM UTC"This eliminates ambiguity more effectively than prose like "format dates in a human-readable way."
Test-Driven Iteration
The Interview Pattern
Have Claude ask questions before implementing in unfamiliar domains:
Batched vs Sequential Feedback
Edge Case Handling
Provide specific test cases with example input and expected output to fix edge cases (e.g., null values in migration scripts). Abstract descriptions of edge cases lead to incomplete fixes.
Key Takeaways
- ✓Concrete input/output examples beat prose descriptions for communicating transformations
- ✓Write tests first, then iterate by sharing test failures with Claude
- ✓Use the interview pattern in unfamiliar domains to surface design considerations
- ✓Batch interacting issues in one message; fix independent issues sequentially