Claude Code · Advanced Chapter 02 / 04

Advanced Track · ~18 minutes

The Advanced Workflows of Claude Code

You've shipped a few prompts. Now it's time to think in systems. This chapter covers planning loops, context engineering, sub-agents, and the discipline of small, reversible changes.

CC
Claude Code Team Updated Apr 2026
18 min read 4 patterns 3 recipes

Four patterns that change everything

Most people use Claude Code as a fancy autocomplete. The pros treat it like a junior engineer with a short memory — very capable, but in need of structure. These four patterns are the backbone of every advanced workflow.

Plan → Act

Plan, then implement

Ask Claude to design the change in plain English before writing any code. You'll catch 80% of mistakes in the cheap phase.

"Before you write code, list the files you'll touch and why."
Small diffs

One thing at a time

Break big tasks into 20–50 line diffs. Review. Commit. Move on. Long-running sessions accumulate drift; small ones stay sharp.

"Change only the auth middleware. Nothing else."
Memory files

Write a project brief

A CLAUDE.md in your repo root is Claude's long-term memory. List conventions, paths, and the commands it should always run.

"Always use pnpm. Tests live in __tests__."
Verify the loop

Make Claude check itself

End every task with "now run the tests, fix anything that breaks, and summarize the final diff." Claude is great at closing its own loop.

"Run tests, iterate until green, then stop."

The advanced workflow, end to end

A single feature, from idea to merged PR, with Claude as a teammate.

  1. Draft the brief

    Describe the feature in 3–5 sentences. Paste it into Claude and ask for clarifying questions before anything else.

  2. Explore the codebase

    Ask: "Map every file related to checkout." Read the map yourself — don't skip this step.

  3. Plan on paper

    Have Claude produce a written plan with file list, risks, and test strategy. Push back on anything that feels off.

  4. Implement in stages

    Commit after each logical unit. Keep each diff under 150 lines when possible. Use /review before every commit.

  5. Self-review + PR

    Ask Claude to write the PR description and a list of things a human reviewer should double-check.

Three recipes to steal

01 The refactor recipe
# Goal: safely rename an exported API

1. Ask Claude to grep all usages and show them.
2. Agree on a rename strategy (codemod vs manual).
3. Run the codemod in a branch.
4. Ask Claude to run tests and summarize breakages.
5. Fix, repeat, commit in logical groups.
02 The bug-hunt recipe
# Goal: fix a flaky test

1. Paste the failing output. Ask for 3 hypotheses, not 1.
2. For each hypothesis, ask what the cheapest experiment is.
3. Run the cheapest first. Let Claude interpret results.
4. Only patch after a reproducer exists.
03 The onboarding recipe
# Goal: understand a new codebase fast

1. claude /init  — generates CLAUDE.md
2. "Tour the repo. Pretend I'm a new hire."
3. "Pick 3 files to read end-to-end. Justify each."
4. "Diagram the request path from HTTP → DB."
5. Save the diagram into docs/architecture.md

Things I wish I knew sooner

⚠ Long sessions rot

After ~1 hour, start a fresh session. Summarize progress into CLAUDE.md first, then /clear.

⚠ Vague beats nothing

"Make it better" is a dead end. Always pair the verb with a measurable target: smaller, faster, simpler, typed.

⚠ Trust, but verify

Claude is confident even when wrong. Always read the diff. Always run the tests. Always.

⚠ Don't skip the plan

The temptation to jump straight to code is strong. Resist. The plan is the feature.

Up next

Chapter 03 — Sub-agents and parallel work

Learn how to fan out work across multiple Claude instances without losing your mind.

Continue →