3.1

The 4-Step Loop

A repeatable process for building with Claude Code

πŸ”„ Framework ⏱️ ~12 minutes

You understand planning. Now let's turn that into a concrete, repeatable workflow. The Compound Engineering Loop is a 4-step process that works for any project, any size.

πŸ”„

4-Step Loop Quick Reference

One-page guide to the compound engineering workflow

πŸ“„ Preview PDF
Download PDF

πŸ€” Two Approaches Compared

Let's see the difference between jumping straight to building vs. using the loop:

Without the Loop (Vibe-Coding) With the Loop (Compound Engineering)
"Build me a contact form" "Before building, create a plan for a contact form"
Claude guesses at what you want You review the plan, refine requirements
Builds everything at once Builds step by step, you approve progress
You discover issues after it's done Both you and Claude assess before moving on
Nothing documented for next time Decisions and patterns saved for future sessions

✨ The Key Difference

The loop adds structure. You're not just asking Claude to buildβ€”you're collaborating through a process that catches issues early and builds knowledge over time.

πŸ”„ The Four Steps

Every productive Claude Code session follows this pattern:

1. PLAN

Claude researches the codebase and/or problem space, then creates a detailed implementation plan.

2. WORK

Claude builds according to the plan. You review and approve each step.

3. ASSESS

Claude reviews its own work. You test and verify. Identify what worked and what didn't.

4. COMPOUND

Document what you learned. Update project files so the next session starts smarter.

πŸ“‹ Step 1: Plan

Start every significant task with planning:

"I want to add [feature]. Before writing any code: 1. Look at the existing project structure 2. Identify what files need to change 3. Create a step-by-step implementation plan 4. Note any potential issues or decisions to make"

The output is a plan you can review and refine before any code is written.

πŸ”¨ Step 2: Work

Once you have an approved plan:

"Let's implement the plan. Start with step 1."

Claude builds incrementally. After each step, you can:

  • Approve and continue
  • Request modifications
  • Pause to test
  • Adjust the remaining plan

πŸ” Step 3: Assess

After building, take time to evaluate:

"Review what we just built: - Does it work as expected? - Are there any issues you notice? - What could be improved? - Did we miss anything from the original plan?"

Claude can catch problems you might miss. And your testing catches problems Claude misses.

πŸ“ Step 4: Compound

This is the step most people skipβ€”and it's the most valuable:

"Let's document what we learned: - Update the README with what we built - Add any new patterns or decisions to Claude.md - Note what we should remember for next time"

This investment pays off in every future session.

✨ The Compound Effect

Step 4 is what separates compound engineering from vibe-coding. Without it, every session starts from scratch. With it, every session builds on everything before.

⏱️ Time Investment

Roughly, for a typical feature:

  • Plan: 5-15 minutes
  • Work: Variable (depends on complexity)
  • Assess: 5-10 minutes
  • Compound: 5-10 minutes

The planning and documenting steps feel like overhead, but they prevent the 2-hour debugging sessions that come from jumping straight to building.

πŸ“– Complete Example: All 4 Steps

Let's watch the loop in action for adding a simple feature:

Task: Add a "clear all" button to a to-do list app

Step 1: PLAN (8 minutes)

Prompt: "I want to add a 'Clear All' button to remove all completed tasks. Before implementing, create a plan."

Claude's plan:
1. Add button to HTML below task list
2. Create clearCompleted() function in JavaScript
3. Filter completed items from tasks array
4. Update localStorage
5. Re-render the list
6. Add confirmation dialog to prevent accidents

User review: "Good plan. Let's do step 6 first - ask for confirmation before steps 2-5."
Claude adjusts: "Updated plan - will add confirmation dialog first."

Step 2: WORK (15 minutes)

Claude builds incrementally:
β€’ Adds button HTML β†’ User tests: button appears βœ“
β€’ Adds confirmation dialog β†’ User tests: dialog works βœ“
β€’ Implements clearCompleted() β†’ User tests: tasks clear βœ“
β€’ Updates persist β†’ User tests: survives refresh βœ“

Result: Working feature built step-by-step with testing at each stage

Step 3: ASSESS (5 minutes)

Prompt: "Review what we built. Any issues?"

Claude notices: "The button appears even when there are no completed tasks. Should we hide it?"
User tests: "Actually, I see an issue - it clears ALL tasks, not just completed ones."
Claude fixes: "You're right! The filter logic is backwards. Let me fix that."

Result: Caught a logic bug before it became a problem

Step 4: COMPOUND (7 minutes)

Prompt: "Update Claude.md to document: what we added, the confirmation pattern, and the localStorage update approach."

Claude documents:
β€’ Feature: Clear completed tasks button
β€’ Pattern: Always confirm destructive actions
β€’ Tech: Filter array, update localStorage, re-render
β€’ Note: Button could be hidden when no completed tasks (future enhancement)

Result: Next session starts with this context already available

βœ… Why This Worked

Plan caught the confirmation need early. Work built incrementally with testing. Assess caught the logic bug. Compound saved the confirmation pattern for reuse.

⚠️ Common Mistakes

Avoid These Pitfalls

Skipping Step 1: "Just build it" leads to unclear requirements and wasted work
Not testing during Step 2: Building everything then testing creates compound debugging
Skipping Step 3: Moving on without assessment means bugs hide until later
Skipping Step 4: The most common mistake - next session starts from zero
Rushing the loop: Taking time on each step saves time overall

⚑ Pro Tip: Start Small with the Loop

Your first few times using the 4-step loop will feel slow. That's normal. You're learning a new workflow. After 3-4 sessions, it becomes automatic and actually speeds you up.

✏️ Practice: Your Own Loop

Think about a small feature you want to add to a project:

🎯 Apply the Loop

Choose a task:
What's one small feature or fix you could add to something you're building?
Make it small enough to complete in one session.
Write your Plan prompt:
How would you ask Claude to create a plan for this task?
Include: what you want, why, and "create a plan before building."
Identify checkpoints:
During Work, what would you test after each step?
List 2-3 points where you'd pause to verify things work.
Plan your Assess:
What questions would you ask Claude (and yourself) during assessment?
Think: Does it work? Any issues? What's missing?
Decide what to Compound:
What should be documented for next time?
Consider: decisions made, patterns used, what you learned.

πŸ“š Resources & Further Reading

πŸ’­ Pause & Reflect

Before moving on, take a moment to consider:

  • Which of the 4 steps feels most natural to you? Which feels least natural?
  • Can you think of a time when skipping one of these steps caused problems?
  • What would make you most likely to skip Step 4 (Compound)?

🎯 Loop Understood

You know the 4-step process. Next: creating the Claude.md file that makes compounding automatic.

Topic 3.1 Complete β€’ Up Next: 3.2 – Creating a Claude.md File