Home › Claude Code lesson 3: Plan mode, scripts
Claude Code lesson 3: Plan mode, scripts
For bigger changes, plan mode makes Claude read and propose a plan with no edits until you approve. Once you trust a task, -p runs Claude Code from scripts and CI.
Step by step
- Start in plan mode with claude --permission-mode plan, or press Shift+Tab mid-session until the status bar shows “⏸ plan mode on”.
- Describe the change and read the proposed plan.
- Approve it (or edit it) before any file changes.
- For research-heavy questions, ask it to use a subagent so only the findings come back.
- In scripts, pipe text in and use -p, for example: git log --oneline -20 | claude -p "summarize these recent commits"
Try it: examples
- Plan mode
Add rate limiting to the login endpoint: 5 attempts per minute per IP. Plan first; don't edit yet.
- Subagent
use a subagent to investigate how our auth system handles token refresh
Good to know
- Plan mode is the safest way to start any multi-file change.
- Worktrees let you run parallel sessions without edits colliding.
- -p mode works like any Unix tool: stdin in, stdout out.
Sources (official pages, read Nov 8, 2026)
Written from Anthropic's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.