PTENES
Skip to content
TRACK 2

🤖 Plan and Loop Modes

Claude Code has two powerful modes that transform how you work: Plan Mode for thinking before acting, and Loop Mode for iterative automation. Master both and combine them for maximum speed and safety.

PLAN MODEthink and plan LOOP MODErun and iterate PLAN + LOOP combined pipeline Result
6
Modules
36
Topics
~4h
Duration
Inter
Level
Path progress: 0% 0 of 36

Learning path map

Detailed content

2.1~40 min

Plan Mode — Think Before You Code

The foundation: how and when to use plan mode to think before executing.

What is:

A mode that lets Claude think and propose a plan before taking any action.

Why learn:

Prevents costly errors and rework by planning first.

Key concepts:

Use Shift+Tab to activate; plan visible before execution.

What is:

Criteria for deciding whether plan mode is worthwhile or direct execution is faster.

Why learn:

Not every task needs a plan; using one unnecessarily wastes tokens.

Key concepts:

Complexity, risk, number of affected files.

What is:

The components of a good plan: goal, steps, dependencies, risks.

Why learn:

Knowing how to read a plan lets you evaluate whether it will work before approving it.

Key concepts:

Steps, file list, risk assessment, order of operations.

What is:

The approval flow where you review the plan and can adjust it before running it.

Why learn:

It's the control point: you decide whether to run, modify, or reject.

Key concepts:

Approve, reject, refine; a feedback loop before the action.

What is:

Technique of requesting multiple adjustments to the plan until it’s ideal.

Why learn:

A refined plan saves hours of rework later.

Key concepts:

Multi-turn planning; plan as a living draft.

What is:

Common mistakes: approving without reading, overplanning, ignoring the plan and executing directly.

Why learn:

Recognizing anti-patterns keeps you on a productive path.

Key concepts:

Over-planning; rubber-stamp approval; plan drift.

2.2~45 min

Plans That Work

In practice: how to create effective plans for features, refactors, and bug fixes.

What is:

Plan structure for implementing a completely new feature.

Why learn:

New features are where plan mode shines most: it prevents bad architecture.

Key concepts:

Scoping; interface first; test plan.

What is:

How to plan a safe refactor with test coverage and rollback.

Why learn:

Refactors without a plan become snowballs; with a plan, they’re surgical.

Key concepts:

Strangler pattern; test-first refactor; incremental steps.

What is:

A plan to diagnose the root cause, fix it, and validate without regressions.

Why learn:

Rushed bug fixes create new bugs; the plan disciplines the workflow.

Key concepts:

Reproduce first; root cause; regression test.

What is:

Technique of breaking a large task into atomic, independent steps.

Why learn:

Atomic tasks are easier to verify and revert.

Key concepts:

Atomic steps; single responsibility; verifiable output.

What is:

Identify which steps depend on others to determine the right order.

Why learn:

Wrong dependencies = wasted work and conflicts.

Key concepts:

Task DAG; critical path; blockers.

What is:

How to estimate the tokens, time, and iterations a plan will take.

Why learn:

Allows you to decide whether it's worth running or whether it's better to simplify the plan.

Key concepts:

Token budget; iteration count; complexity heuristics.

2.3~40 min

Loop Mode — Iterative Automation

Let Claude run in a loop: fix, test, fix until it passes. The foundation of autonomous mode.

What is:

A mode that lets Claude execute, verify the result, and iterate automatically.

Why learn:

Automates the edit-test-fix cycle that takes hours in manual mode.

Key concepts:

--dangerously-skip-permissions; auto-accept; iteration limit.

What is:

Criteria for loop mode vs. normal interactive mode with approval at each step.

Why learn:

Loop mode without criteria can burn tokens or make unwanted changes.

Key concepts:

Trust in the outcome; reversibility; supervision cost.

What is:

Mechanisms to prevent the loop from causing damage: allowedTools, max turns, git worktree.

Why learn:

Security is what lets you trust the loop and step out for coffee.

Key concepts:

allowedTools; permission scopes; worktree isolation.

What is:

Tools for observing what the loop is doing: logs, diff, test output.

Why learn:

Monitoring lets you intervene before problems pile up.

Key concepts:

Terminal watch; git diff --stat; CI status.

What is:

Stop criteria: tests passing, linter clean, stable diff.

Why learn:

Infinite loop = burned tokens; clear criteria = efficiency.

Key concepts:

Exit conditions; convergence; diminishing returns.

What is:

Differences between local loop mode and background agents (GitHub Actions, etc.).

Why learn:

Each approach has trade-offs in cost, speed, and control.

Key concepts:

Local vs. remote; latency; cost per iteration.

2.4~45 min

Loop Patterns in Practice

Real-world recipes: test, lint, migration, data, and docs loops you can copy and run.

What is:

Run tests, fix failures, rerun until everything passes.

Why learn:

The most common and useful loop mode pattern.

Key concepts:

pytest/jest loop; error parsing; auto-fix.

What is:

Run the linter, fix warnings, rerun until there are zero errors.

Why learn:

Clean up lint across an entire codebase in minutes, not hours.

Key concepts:

eslint --fix; black/ruff; iterative cleanup.

What is:

Migrate APIs, dependencies, or versions file by file with validation.

Why learn:

Migrations are tedious for humans, perfect for loops.

Key concepts:

File-by-file; type-check gate; incremental commit.

What is:

Process, transform, and validate datasets iteratively.

Why learn:

Dirty data needs multiple passes; a loop does that without you.

Key concepts:

Schema validation; data cleaning passes; assertion gates.

What is:

Generate docs, validate links, update examples until everything is consistent.

Why learn:

Outdated docs kill projects; the loop keeps them in sync.

Key concepts:

Docstring sync; link checker; example runner.

What is:

Combine exit criteria: tests + lint + types + build all green.

Why learn:

The compound loop is the closest thing to CI/CD running locally.

Key concepts:

Multi-gate loop; combined exit criteria; script orchestration.

2.5~50 min

Combining Plan + Loop

The complete pipeline: plan, execute in a loop, review. Advanced orchestration.

What is:

The ideal workflow: plan mode first, loop mode to execute, human review at the end.

Why learn:

It's the gold standard for complex tasks with Claude Code.

Key concepts:

Three-phase pipeline; handoff points; review gate.

What is:

How to transition from the approved plan to the loop without losing context.

Why learn:

A poorly handled handoff can make the loop skip parts of the plan.

Key concepts:

Context preservation; explicit instructions; checkpoint.

What is:

Strategies for using plan+loop in projects with dozens of files.

Why learn:

Large projects require decomposition; without it, the loop loses its way.

Key concepts:

Phased execution; module boundaries; progressive disclosure.

What is:

Coordinate changes across multiple files while maintaining consistency.

Why learn:

Most features touch several files; orchestration is essential.

Key concepts:

Cross-file consistency; import graphs; batch edits.

What is:

How to undo the loop's work when something goes wrong: git, worktrees, stash.

Why learn:

The ability to roll back safely is what lets you take more risks in the loop.

Key concepts:

git reset; worktree discard; incremental commits.

What is:

Real examples of plan+loop pipelines in production projects.

Why learn:

Seeing concrete cases solidifies your understanding of the workflow.

Key concepts:

Real-world patterns; lessons learned; metrics.

2.6~35 min

Agentic Coding — The New Normal

The philosophy behind it all: delegation, trust, and the mindset shift toward 10x productivity.

What is:

The paradigm shift: from an assistant that responds to an agent that acts.

Why learn:

Understand the philosophy and what enables you to use the modes fluently.

Key concepts:

Agentic vs. assistive; autonomy spectrum; intent-driven.

What is:

How to delegate tasks to the agent without micromanaging or abandoning it.

Why learn:

Delegation is the human skill that scales the most with agentic AI.

Key concepts:

Clear intent; success criteria; scope boundaries.

What is:

The difference between reviewing the result and controlling every step.

Why learn:

Micromanagement kills productivity; review ensures quality.

Key concepts:

Output review; trust but verify; spot checks.

What is:

How to adjust your level of trust in the agent as you gain experience.

Why learn:

Too much trust = bugs; too little trust = slowness.

Key concepts:

Progressive trust; track record; domain-specific confidence.

What is:

How to measure whether you're actually more productive with agentic coding.

Why learn:

Without metrics, you don’t know whether you’re making progress or just spending tokens.

Key concepts:

Tasks/day; time-to-merge; rework rate; cost per task.

What is:

The mindset shift from "I code" to "I direct and review."

Why learn:

The biggest obstacle isn't technical; it's mental. Those who change their mindset take off.

Key concepts:

Director mindset; let go of typing; focus on outcomes.