Workflows
Proven loops: plan, implement, verify, and review.
Claude Code works best when you follow a consistent loop: explore the code, plan your approach, implement with Claude's help, then verify the result. This lesson shows you the proven patterns that keep that loop tight and your sessions productive.
Explore first, then plan
Before asking Claude to change anything, let it read the relevant code. This gives Claude accurate context and prevents it from guessing at structure it hasn't seen. Once you understand the territory, switch to plan mode — Claude proposes a written plan and makes no file edits until you approve it.
# Option 1: start in plan mode from the terminal
claude --permission-mode plan
# Option 2: toggle plan mode mid-session
# Press Shift+Tab to cycle through permission modesTest-driven workflow
Writing tests before or alongside implementation keeps Claude honest — passing tests are proof the code actually does what you intended, not just that it compiles. Claude reads your existing test files to match your project's style and framework.
find functions in UserService.ts that are not covered by tests
add tests for the uncovered functions
add edge cases for invalid input and empty states
run the new tests and fix any failuresReview the diff before moving on
After Claude makes changes, always read the diff before continuing. Claude shows you proposed edits and asks for approval — use that moment. You can also ask Claude to summarize what changed and why before you commit.
summarize the changes you just made and flag anything I should double-checkClear context between tasks
Every message you send sits in Claude's context window. After you finish one task and move to an unrelated one, run /clear to start fresh. This prevents earlier conversation details from confusing Claude's understanding of the new task.
/clearResume sessions across sittings
Claude Code saves every conversation locally. You never have to re-explain your project from scratch when you come back after a break.
# Resume the most recent session in this directory
claude --continue
# Open a picker to choose from previous sessions
claude --resumeDynamic workflows for large jobs
For tasks that span dozens of files or need many simultaneous investigations — a codebase-wide audit, a 500-file migration, deep research with cross-checked sources — Claude Code can write and run a dynamic workflow: a script that orchestrates many subagents working in parallel while your session stays responsive. Run /workflows to see running and completed workflow runs.