Workflows
Patterns for using Claude Code across real engineering tasks — conversation-driven dev, TDD, bug hunts, refactors, code review, long sessions, headless mode.
A workflow is not a feature — it's a way of using the features together to get a job done. The same Claude Code session can be a TDD partner, a code reviewer, a bug-hunting buddy, or a refactor engine; the difference is the loop you run, not the binary you launched.
These pages document the workflows that hold up in production engineering: the steady-state ones (conversation-driven dev paired with mid-task guidance — the Esc-then-corrected-message rhythm), the targeted ones (TDD, bug hunts, refactors, reviews), and the more advanced ones (long sessions, headless CI usage). The shape of each one is the same: state intent, narrow scope, verify after each step, commit when green.
Key concepts
- Intent first — every successful workflow starts with a clear statement of what success looks like
- Guide the conversation as it runs — interrupt when the direction is wrong, let it cook when only the tactics are imperfect
- Verify at every step — the model is wrong sometimes; tests, type-checks, and runs are the disambiguator
- Commit early — small green commits beat one huge unverified diff
- The model can be a reviewer too — adversarial second-opinion calls catch what you missed
- Long sessions need a plan file or memory writes — context decay is a workflow problem, not a feature gap
Reference template
// A repeatable session shape, regardless of the workflow
1. State intent (what done looks like)
2. Choose mode (plan / default / accept-edits)
3. Establish baseline (existing tests pass? type-check clean?)
4. Small step (write or change one thing)
5. Verify (run the thing, read the diff)
6. Commit if green (and only if green)
7. Repeat or hand off (loop the same step, or escalate) Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Loose intent —
make it betterproduces unfocused diffs. Pin scope before starting - Skipping baseline — if you didn't check tests were green before, you can't tell if you broke them
- Letting the diff grow unverified — every commit boundary is a save point you want often
- Treating headless mode like interactive mode — non-interactive sessions need stricter prompts and explicit timeouts
Related topics
Items (9)
- Conversation-Driven Development
The core workflow: state intent, watch Claude propose, accept or redirect. Why this beats prompt-and-hope.
Workflow Foundational - Guiding the Conversation Mid-Task
When to interrupt, when to let it cook, how to course-correct without scrapping context. The Esc-then-corrected-message rhythm.
Workflow Intermediate - Test-Driven Development with Claude Code
Writing tests first, letting Claude implement against them, and the feedback loop that makes it reliable on non-trivial features.
Workflow Intermediate - Bug Hunting and Root-Cause Analysis
Reproducing, isolating, root-causing, fixing, and writing the regression test. The structured loop for not-just-making-it-go-away.
Workflow Intermediate - Refactoring with Claude Code
Small refactors, large refactors, and the heuristics for when to split into a series of PRs versus one bundled change.
Workflow Intermediate - Code Review Workflow
Using Claude Code as a reviewer, getting a second opinion on a migration, and where /ultrareview fits in the cycle.
Workflow Intermediate - Long-Running Sessions and Context Management
How to run a multi-hour session without losing the thread. Summarisation, plan files, memory writes, and the cache-friendly cadence.
Workflow Advanced - Headless / Non-Interactive Mode
Running Claude Code in CI, in scripts, and in cron-style autonomous loops. JSON output, exit codes, and timeouts.
Workflow Advanced - Pair-Programming Patterns
Driver-navigator, ping-pong, and explain-as-you-go. How to keep yourself in the loop while Claude does the typing.
Workflow Foundational