Real Project Patterns
Patterns that work in practice: debugging with Claude, writing tests, refactoring legacy code, adding features to existing codebases, and managing complex multi-file changes.
For debugging: paste the error message and ask Claude to investigate. It will read relevant files, trace the issue, and propose a fix.
Test-first works brilliantly with Claude Code: describe the test cases first, let Claude write the tests, then ask it to write code that passes them.
For refactoring: ask Claude to explain the current code first, agree on the target state, then let it refactor incrementally with tests passing at each step.
Use git branches for experimental Claude Code sessions. If it goes off the rails, you can reset cleanly.
DEBUGGING: 'I'm getting this error: [paste error]. Investigate and fix it'
TESTING: 'Write unit tests for [module]. Cover edge cases: [list]. Then make sure they pass'
FEATURE: 'Add [feature] to [file/module]. It should [behaviour]. Don't break existing tests'
REFACTORING: 'Refactor [module] to [pattern]. Keep all existing tests passing throughout'
DOCUMENTATION: 'Read the codebase and generate API documentation for [module]'
CODE REVIEW: 'Review the changes in the last 3 commits. Flag any issues or improvements'
Always work on a feature branch. Commit frequently. Review diffs before pushing
Build up a CLAUDE.md file with lessons learned — it compounds over time