Quick Reference
| Pattern | Best for | Key benefit |
|---|---|---|
| Plan-Then-Execute | Features touching multiple files | Catches wrong assumptions before any code is written |
| TDD Loop | Utility functions, API endpoints, business logic | Tests drive correct behavior |
| Bug Fix Cycle | Any bug with an error message | Diagnoses root cause, not just the symptom |
| Refactor Cycle | Code reorganization, extracting modules | Safe and incremental with a green-test safety net |
| Code Review | Before every PR | Surfaces edge cases and security issues |
| Exploration | New codebase or unfamiliar module | Builds mental model before making changes |
Plan-Then-Execute
The most reliable pattern for non-trivial work. Separates thinking from doing.Ask Claude to plan
“I need to add user authentication. Plan the implementation — what files to change, what approach to take, what to watch out for.”
TDD Loop
Let tests drive the implementation. Claude is very effective at this pattern.Write the test first
“Write a test for a function that calculates shipping cost based on weight and destination.”
Bug Fix Cycle
A structured approach to debugging with Claude.
When to use: Any bug. The key is giving Claude the actual error output and letting it trace the cause rather than guessing.
Refactor Cycle
Safe, incremental refactoring with a safety net.Describe the goal
“I want to extract the payment logic from the order controller into its own service.”
Code Review Workflow
Use Claude as a thorough reviewer before opening a PR.Ask for review
“Review the changes in this branch compared to main. Focus on correctness, edge cases, and security.”
Exploration Pattern
When you’re new to a codebase or unfamiliar module.Start broad
“Explain the architecture of this project. What are the main modules and how do they connect?”
General Tips
- Be specific about what you want. “Fix the bug” is worse than “The signup form throws a 500 when the email contains a plus sign.”
- Share error output. Paste the actual error, stack trace, or unexpected behavior.
- Review diffs, not just the outcome. Claude may change more than necessary — check what actually changed.
- Use
/compactbetween tasks. Frees context for the next piece of work. - Don’t fight the agent. If Claude is going in circles, step back and reframe the task rather than repeating the same instruction.
← Prev: Maturity Ladder · Next: Context Management →