Core Workflows — The Patterns That Matter

A beginner-friendly teaching edition based on the source chapter
Main idea: Claude Code becomes much more useful when you stop treating every task as “write some code” and start using a few repeatable workflows: Plan, Execute, Verify, Protect, Manage Context, and Iterate.

1. Why Core Workflows Matter

After your first project, you already know the basic cycle: Claude changes files, runs commands, and you check the result.

But the real efficiency difference comes from knowing when to plan, when to let Claude run, when to stop it, how to manage permissions, how to use Git, and how to keep the conversation focused.

The central question: It is not only “Can Claude do this?” It is also “Should I discuss the approach before I let it do it?”

2. Plan Mode — Think Before You Act

Plan Mode lets Claude understand the task and propose an approach without immediately changing your project.

In Plan Mode, Claude can read files and understand the codebase, but it does not modify code, install packages, or run commands until you move back to execution.

How to enter Plan Mode

Press Shift + Tab twice

Claude switches into Plan Mode and gives you a proposed implementation plan.

What Plan Mode gives you

  • A view of the intended approach before changes are made.
  • The files Claude expects to change.
  • Technical choices and possible tricky areas.
  • A chance to ask questions and revise the plan.
Think of Plan Mode like an architect meeting.
First agree on the design. Then allow construction to begin.

3. The Golden Plan → Execute Workflow

The chapter describes a structured workflow for larger tasks.

Step 1 — Describe requirements in Plan Mode
Enter Plan Mode, explain the goal, review Claude's proposal, and refine it.
Step 2 — Prepare a detailed execution prompt
Use Ctrl + G to open the input in your configured editor. Write the confirmed plan and constraints, save it, and send it back to Claude.
Step 3 — Execute
Switch back to normal mode with Shift + Tab. After the planning is complete, Claude can execute the agreed approach with much less back-and-forth.
Why this works: Put most of the thinking before the implementation. Repeatedly changing direction in the middle of execution wastes time and context.

4. When Should You Use Plan Mode?

Use Plan ModeUsually skip Plan Mode
You are unsure about the implementation approach.Changing one line.
The change affects multiple files.Fixing a typo.
You do not know the codebase well.Adding a simple debug statement.
You are refactoring architecture.Running tests.
You are touching a project for the first time.Routine, repetitive work.
Simple rule: If you would need to explain the task to a colleague before they could safely do it, Plan Mode is probably useful. If you can describe the change in one sentence, direct execution may be enough.

5. Auto Mode — Safer Autopilot

When Claude Code repeatedly asks for permission, approval fatigue can happen. Auto Mode is designed to reduce that friction by using an AI safety classifier to evaluate operations.

How Auto Mode works

The source describes two layers:

  1. Input layer: checks content Claude reads for possible prompt injection attempts.
  2. Output layer: evaluates the risk of actions before they execute.

The goal is simple: routine operations can proceed automatically while suspicious or risky actions receive more scrutiny.

Examples of things Auto Mode may block

  • Expanding a vague cleanup request into destructive remote branch deletion.
  • Searching for other credentials after an authentication failure.
  • Bypassing a deployment safety check.
  • Sharing code externally without clear authorization.

Enable Auto Mode

claude -permission-mode auto

You can also cycle through modes with Shift + Tab.

Important: Auto Mode is not a guarantee of safety. The chapter specifically advises more caution for production databases and cloud infrastructure. For high-risk operations, manual confirmation remains safer.

6. Auto Mode vs. Skipping Permissions

Auto Mode--dangerously-skip-permissions
Uses an AI classifier to evaluate operations.Removes permission confirmations.
Risky operations can be blocked or challenged.Commands can execute without those warnings.
Has input-layer prompt-injection protection described in the chapter.No equivalent protection from permission bypass.
Designed for everyday development.Source recommends isolated environments for this type of bypass.
Do not confuse these two. “No permission prompts” is not automatically the same thing as “safe automation.” The chapter strongly distinguishes Auto Mode from completely bypassing permissions.

7. Permission Management — You Set the Rules

For more precise control, Claude Code provides /permissions.

/permissions

You can pre-authorize specific operations so Claude does not ask every time.

Examples

# Allow npm scripts
Bash(npm run *)

# Allow editing docs
Edit(/docs/**)

# Allow tests
Bash(npx vitest *)
Bash(npx jest *)

# Allow Git operations
Bash(git add *)
Bash(git commit *)
Bash(git push)

The chapter notes that these rules can be stored in .claude/settings.json and shared through Git.

Three permission levels

ApproachConvenienceSafetyBest for
Auto ModeHighMediumEveryday development
/permissions whitelistMediumHighPrecise team/project control
Confirm every actionLowHighestLearning and high-risk work
Beginner recommendation from the chapter: Start with confirmation for every action. After you understand Claude's normal behavior, use Auto Mode or a carefully configured whitelist where appropriate.

8. Git Operations — Claude Understands Version Control

Claude Code can work with your project's Git state, including changed files and branches.

Meaningful commits

Commit the current changes with a meaningful commit message.

Or give more context:

Commit these changes — describe that we added RSS feed fetching.

Create a Pull Request

Create a PR with a clear title and description explaining what this feature does.

Claude can inspect the changes, generate a commit message, stage and commit changes, and prepare a PR description.

9. Git Worktrees — Parallel Work

A Git worktree gives another branch its own working directory. This is useful when multiple Claude sessions need to work independently.

claude -worktree

The chapter highlights three important benefits:

  • Your current branch remains untouched.
  • Multiple tasks can proceed simultaneously.
  • Each Claude instance gets an isolated working directory.
Simple example: One Claude session fixes a bug while another builds a new feature. Separate worktrees reduce the chance that the two tasks overwrite each other's files.

10. Computer Use — Claude Gets Eyes and Hands

Traditional Claude Code workflows are mostly text-based: read files, edit files, run commands, inspect logs.

Computer Use extends this by allowing Claude to look at screenshots of the desktop and interact with graphical interfaces using the mouse and keyboard.

Examples

Look at this page on my screen and tell me what's wrong with the layout.
Open System Preferences and turn off Dark Mode.
Open localhost:3000 in the browser, walk through the signup flow, and look for bugs.

Where Computer Use is useful

ScenarioWhy it helps
Testing a web UIClaude can click pages, fill forms, and inspect the rendered result.
GUI-only softwareIt can interact with software that has no convenient API.
Repetitive desktop tasksIt can perform mechanical actions across windows.
Debugging browser extensionsIt can inspect extension popups and visible browser behavior.

Current limitations described in the chapter

  • It is slower because actions involve screenshot → analysis → decision → execution.
  • Very precise operations such as dragging a slider can be unreliable.
  • Fast real-time interactions and animations are not its strongest use case.
Best mental model: Think of Computer Use as a patient but relatively slow tester. It works best for fixed, repeatable GUI sequences.

11. Voice Mode — Code by Talking

Voice Mode allows you to speak your instruction instead of typing it.

/voice

The chapter describes holding the spacebar to speak, releasing it to send. Voice transcription then becomes the input Claude processes.

When voice is useful

  • When your hands are occupied.
  • During brainstorming.
  • When describing spatial or visual layouts.
  • For quick commands such as running tests or asking Claude to inspect a file.
Useful combination:
Use voice to quickly start the task, then switch to the keyboard for precise technical requirements and constraints.

Voice limitations

  • Noise can reduce transcription accuracy.
  • Long technical specifications are generally more reliable when typed.
  • Voice is especially suited to short instructions and task initiation.

12. Session Management — Don't Let Context Become a Junk Drawer

Long conversations accumulate information. If unrelated tasks are mixed together, Claude has to work through more context and may lose focus.

Core command reference

ActionCommand / ShortcutWhen to use
Clear session/clearStarting a fundamentally different task.
Compress context/compactLong session where you want to preserve key conclusions.
Stop operationEscClaude is doing something you want to stop.
RewindEsc × 2 or /rewindUndo conversation changes, code changes, or both.
Resume last sessionclaude --continueContinue after the terminal was closed.
Resume a specific sessionclaude --resumeReturn to a particular previous session.
Side-chain question/btwAsk an unrelated question without polluting the main context.

13. /clear — Start With a Clean Slate

/clear removes the conversation history for the current session. Project files and CLAUDE.md remain available.

For example:

Finish API bug /clear Start frontend task

Without clearing, the previous API debugging discussion can remain in the conversation and add irrelevant context to the frontend task.

Good habit: Keep one session focused on one meaningful task. When the task changes substantially, use /clear or start a new session.

14. /compact — Compress Without Losing the Main Ideas

/compact is different from /clear. It keeps the session but compresses its history into a shorter summary.

Use it when:

  • The conversation has become long.
  • You want to keep important decisions but remove repetitive details.
  • Claude feels slower because the context has grown.
  • You are moving between phases of a long task.
/compact Keep all architecture decisions and bug fix records; compress away the detailed code
Difference:
/clear = clean slate.
/compact = keep the session, but summarize it.

15. /btw — Ask a Side Question

/btw opens a side-chain conversation. It is useful when a quick unrelated question comes to mind.

/btw — How does TypeScript's Record type work?

The main task's conversation remains untouched.

16. /rewind — Your Safety Net

If Claude makes a wrong change, you can use /rewind, or press Esc twice.

OptionMeaning
Rewind conversationUndo recent conversation turns.
Rewind codeRestore files while keeping the discussion.
Rewind everythingRestore both conversation and code.
Powerful use case: If Claude changed ten files using the wrong approach, you can rewind the code while keeping the discussion, then explain a better direction.

17. Six Common Workflow Traps

Trap 1 — Stuffing everything into one session

Mixing bug fixes, new features, refactoring, and documentation fills the context and reduces focus.

Better: one session per focused task, then /clear.

Trap 2 — Repeated corrections that spiral sideways

If Claude is wrong and two corrections still do not fix the direction, stop patching.

Better: use /clear and provide a more precise starting requirement.

Trap 3 — Accepting output that only looks correct

Code that looks reasonable can still contain bugs.

Better: run the code and tests after changes.

Trap 4 — Over-managing every step

If you inspect every tiny change and manually direct every action, you lose the benefit of agent-style work.

Better: focus on outcomes unless the work is clearly going in the wrong direction.

Trap 5 — Vague requirements

“Help me optimize this code” and “Make this page look better” leave too much room for guessing.
Better: give measurable, verifiable requirements. For example, specify the target response time and where you think the bottleneck is.

Trap 6 — Not writing a CLAUDE.md

If every new session requires you to explain the project rules again, you are repeatedly paying the same context cost. The next chapter covers CLAUDE.md in detail.

18. A Practical Daily Workflow

1. Understand 2. Plan 3. Execute 4. Verify 5. Review 6. Commit 7. Clear / Continue

A useful workflow for a medium-sized feature is:

  1. Start in Plan Mode.
  2. Describe the desired result and constraints.
  3. Review and refine the plan.
  4. Switch to execution.
  5. Let Claude implement the agreed work.
  6. Run tests and inspect the output.
  7. Use /review when you want an additional code audit.
  8. Commit the verified changes with Git.
  9. Use /clear before a completely unrelated task.

19. Useful Supporting Commands

CommandPurpose
/reviewAudit uncommitted changes for bugs, performance, security, and style issues.
/simplifyReview changes from multiple angles and apply refinements.
/doctorRun diagnostics for CLI, authentication, tools, and environment configuration.
/vimEnable Vim-style key bindings in the input area.
/terminal-setupConfigure terminal integration such as Shift+Enter behavior.
/exportExport the current session transcript as plain text.

20. Combining Commands Into Workflow Patterns

Pattern A — Long Session Management

/clear
Complete Phase 1
/compact
Complete Phase 2
/compact
Complete Phase 3
/cost

The idea is to periodically manage context instead of allowing one conversation to grow without control.

Pattern B — Exploratory Development

Discuss requirements
      ↓
/fork → Approach A
      ↓
Compare
      ↓
/fork → Approach B
      ↓
Choose the better result

Pattern C — Safe Refactoring

/review
   ↓
Refactor
   ↓
If wrong → /rewind
   ↓
/simplify
   ↓
/review
   ↓
git commit

Pattern D — Economy Mode

/model sonnet
      ↓
Everyday work
      ↓
Complex problem
      ↓
/model opus
      ↓
Problem solved
      ↓
/model sonnet
      ↓
/cost
Key lesson: Slash commands are not just a list of shortcuts. When combined, they become workflow infrastructure for context management, safe exploration, code quality, and cost control.

21. The Five Core Workflows to Remember

WorkflowMain purpose
Plan ModeThink and agree on the approach before making changes.
Auto ModeReduce repetitive approval prompts while retaining automated safety checks.
/permissionsPrecisely control which operations Claude may perform automatically.
GitTrack, commit, branch, and isolate work safely.
Session managementKeep context focused and recover safely when things go wrong.

22. Practice Exercises

Exercise 1 — Plan Mode
Enter Plan Mode and ask Claude to design a small feature. Do not allow implementation. Change one part of the plan, then review the updated plan.
Exercise 2 — Auto Mode
Try a small, safe task in Auto Mode. Observe which operations happen automatically and which still require confirmation.
Exercise 3 — Session Management
Start a task, use /btw for an unrelated question, then use /clear before starting a different project task.
Exercise 4 — Rewind
In a safe test project, ask Claude to make a change, then experiment with the rewind options so you understand how conversation and code can be restored.
Exercise 5 — Computer Use
Ask Claude to inspect a web page you are building and report visible UI problems. Compare its observations with your own.

23. Interview / Revision Questions

  1. What is Plan Mode and why is it useful?
  2. How do you enter Plan Mode?
  3. When should you use Plan Mode instead of direct execution?
  4. What problem is Auto Mode designed to solve?
  5. How is Auto Mode different from --dangerously-skip-permissions?
  6. What does /permissions do?
  7. What is the purpose of Git worktrees?
  8. What is Computer Use?
  9. What are some limitations of Computer Use?
  10. When is Voice Mode useful?
  11. What is the difference between /clear and /compact?
  12. What does /btw do?
  13. How can /rewind help when Claude takes the wrong approach?
  14. Why should you avoid putting unrelated tasks into one session?
  15. What are the five core workflows emphasized at the end of the chapter?

24. Quick Memory Map

CORE WORKFLOWS
│
├── THINK
│   └── Plan Mode
│       └── Discuss → Refine → Approve
│
├── EXECUTE
│   ├── Normal Mode
│   └── Auto Mode
│
├── CONTROL
│   └── /permissions
│       └── Allow only what is appropriate
│
├── VERSION
│   ├── Git commit / PR
│   └── Git worktree
│
├── INTERACT
│   ├── Computer Use
│   └── Voice Mode
│
├── MANAGE CONTEXT
│   ├── /clear
│   ├── /compact
│   └── /btw
│
└── RECOVER
    └── /rewind

25. Final Takeaway

Chapter 4 is about moving from “I know how Claude Code works” to “I know how to work effectively with Claude Code.”

The best workflow is not maximum automation.
It is the right amount of planning, automation, permission control, verification, and context management for the task in front of you.

For most meaningful features, remember this sequence:

Plan Refine Execute Verify Review Commit Keep Context Clean