Agentic Coding with Claude Code

//https://www.youtube.com/watch?v=I_WOaDJ7g90

Planning Mode

Claude Code includes a Planning Mode that helps design implementation approaches before making code changes. This mode is activated via the /plan command and is particularly valuable for complex tasks.

Planning Mode should be used for:

  • Non-trivial implementation tasks - Features or changes that span multiple files or systems
  • Multiple valid approaches - When there are several ways to solve a problem (e.g., choosing between Redis, in-memory, or file-based caching)
  • Architectural decisions - Changes requiring trade-offs between patterns or technologies
  • Multi-file changes - Tasks that will touch more than 2-3 files
  • Unclear requirements - When the scope needs investigation before implementation
  • User preference matters - When implementation could reasonably go multiple ways and user input is valuable

How Planning Mode Works

Planning Mode follows four phases:

  1. Exploration - Claude uses Explore agents to research the codebase, find relevant files, and understand existing patterns
  2. Design - A plan is created outlining the implementation strategy, affected files, and key decisions
  3. Review - The user reviews the plan, asks questions, and approves or requests changes
  4. Implementation - After approval, Claude exits Planning Mode and executes the plan

Key Benefits

  • Alignment before action - Ensures you and Claude agree on the approach before any code is written
  • Prevents wasted effort - Catches misunderstandings early, before time is spent on the wrong solution
  • Explores alternatives - Allows discussion of different approaches and their trade-offs
  • Documents reasoning - The plan serves as documentation for why decisions were made
  • Reduces rework - Getting sign-off upfront means fewer mid-implementation course corrections

Example Usage

/plan Add user authentication to the app

Claude will explore the codebase, identify existing auth patterns (if any), propose an approach (session-based vs JWT, middleware structure, etc.), and present a plan for review before implementing.

Subagents

Rewind

> /rewind 3
Rewinding to snapshot from 3 turns ago...

Settting

~/.claude/settings.josn
{
"model": "sonnet-4",
"MAX_THINKING_TOKENS": "10000"
}