Official Docs Breakdown: Common Workflows
💬 hippo: Part of the Claude Code Official Docs Breakdown series. Common Workflows is the page I return to most often—whenever I wonder “how do I get Claude to do this?”, the answer is almost always here.
1. What Common Workflows Covers
Common Workflows is Anthropic’s official day-to-day playbook for Claude Code, covering 16 development scenarios ranging from onboarding onto an unfamiliar repository to piping Claude into a CI pipeline.
At its core, this page answers one practical question: how to use Claude Code productively in real engineering work. Rather than generic Q&A advice, each scenario gives you concrete prompts and repeatable steps.
Out of the 16 scenarios, this post dives deep into the 5 highest-leverage workflows and summarizes the rest in a quick-reference table.
2. Official Documentation Breakdown
2.1 Understand a New Codebase
When joining a new project, the fastest way to ramp up is to have Claude map out the terrain. The official docs recommend narrowing your scope from broad to specific—start with high-level architecture, then drill into individual modules.
1 | # Step 1: High-level overview |
The docs also recommend asking Claude to generate a project glossary—especially helpful when working in an unfamiliar business domain such as finance or healthcare.
2.2 Plan Mode: Think Before Editing
Plan Mode puts Claude in read-only mode so it analyzes the codebase and drafts a plan before touching any files. The official docs highlight three ideal use cases:
- Multi-step implementations: Features that touch many files
- Code exploration: Investigating unfamiliar code thoroughly before making changes
- Interactive design: Iterating on direction with Claude before committing to an approach
Three ways to launch Plan Mode:
1 | # Option 1: Specify on launch |
Set Plan Mode as the default:
1 | // .claude/settings.json |
In Plan Mode, Claude uses AskUserQuestion to clarify requirements proactively before proposing a plan. That works far better than simply asking it to “write a plan,” because it verifies your actual intent first.
Automatic session naming on plan acceptance: When you accept a plan, Claude automatically names the session based on the plan content, displaying that name in the prompt bar and the session picker. If you already named the session with --name or /rename, accepting a plan will not overwrite it.
2.3 Thinking Mode: Deep Reasoning on Demand
Extended thinking is enabled by default, allowing Claude to reason internally before responding. Press Ctrl+O to toggle verbose mode and inspect the gray thinking trace.
Key configuration options:
| Scope | How to Configure | Details |
|---|---|---|
| Effort level | /effort command, /model menu, or CLAUDE_CODE_EFFORT_LEVEL env var |
Controls reasoning depth for Opus 4.6 and Sonnet 4.6 |
ultrathink keyword |
Include the word anywhere in your prompt | Sets maximum effort level for that single turn; ideal for one-off deep tasks |
| Toggle shortcut | Option+T (macOS) / Alt+T (Linux) |
Toggles extended thinking on or off for the current session |
| Global default | /config menu |
Saved to alwaysThinkingEnabled in ~/.claude/settings.json |
| Token budget cap | MAX_THINKING_TOKENS env var |
Caps thinking tokens; set to 0 to disable extended thinking completely |
Opus 4.6 and Sonnet 4.6 support adaptive reasoning—the model allocates thinking tokens dynamically based on your effort level without needing a manual cap. On these two models, MAX_THINKING_TOKENS only takes effect if set to 0 (disabling thinking) or if CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 is set (falling back to a fixed budget).
Older models use a fixed token budget carved out of the output limit, with per-model caps. You can constrain it with MAX_THINKING_TOKENS or disable it completely via /config or the keyboard shortcut.
1 | # Using ultrathink — include the keyword anywhere in your prompt |
2.4 Git Worktrees: Parallel Development Without Collisions
Git worktrees let you check out multiple branches of the same repository into separate directories. Each Claude session gets an isolated workspace, preventing edit conflicts across parallel tasks.
1 | # Auto-create with --worktree / -w (recommended) |
Base branch behavior: Worktrees branch off whatever remote default branch origin/HEAD points to. Git records origin/HEAD inside .git at clone time, so if the remote default branch changes later, your local ref can go stale. Sync it with:
1 | git remote set-head origin -a # Sync the remote default branch automatically |
Worktree cleanup behavior:
| Scenario | Claude’s Behavior |
|---|---|
| No changes | Automatically removes the worktree and its branch |
| Uncommitted changes or commits | Prompts you to keep or delete |
| Orphaned subagent worktrees (left behind after crashes/interruptions) | Automatically cleaned up on startup if older than cleanupPeriodDays with no tracked modifications or unpushed commits |
Worktrees created directly with --worktree are not auto-cleaned. To remove them manually outside a Claude session, use git worktree list and git worktree remove.
Worktree isolation for Subagents: Tell Claude to “use worktrees for your agents,” or add isolation: worktree to a custom subagent’s frontmatter. Each subagent runs in its own worktree and is automatically cleaned up when it finishes with no changes.
Non-Git VCS systems (SVN, Perforce, Mercurial) are also supported via custom WorktreeCreate and WorktreeRemove hooks. Once configured, these hooks replace the default Git behavior and .worktreeinclude is no longer processed.
For automated coordination across parallel sessions (shared tasks and messaging), see the official Agent Teams documentation.
Copying Gitignored Files into Worktrees Automatically
A new worktree is a fresh checkout and omits untracked files such as .env. Create a .worktreeinclude file in the repository root using .gitignore syntax to specify which files to copy over:
1 | # .worktreeinclude |
Only files that are both gitignored and matched by .worktreeinclude are copied. This applies to --worktree, subagent worktrees, and parallel sessions in the Desktop app.
Note: If you configure a
WorktreeCreatehook, it replaces the default worktree creation flow and.worktreeincludeis ignored—handle file copying inside the hook script instead.
2.5 Use Claude as a Unix-Style Utility
Claude Code supports standard Unix piping, making it straightforward to drop into shell scripts and CI pipelines.
1 | // package.json - use as a linter |
1 | # Piping stdin/stdout |
2.6 Quick Reference for Other Workflows
The official docs also cover these everyday scenarios:
| Workflow | Core Usage | One-Line Takeaway |
|---|---|---|
| Fix bugs | Feed Claude the error message and repro steps | The more specific the details, the faster the fix |
| Refactor code | Specify the target pattern and scope | Claude matches your project’s existing conventions |
| Write tests | State the behaviors to verify and ask for edge cases | Automatically matches your existing test framework |
| Create PRs | Say “create a pr” or use gh pr create |
Links the session directly to the PR |
| Work with docs | Specify which docs need updating | Covers both inline comments and external docs |
| Use images | Paste screenshots directly for analysis | Ideal for UI debugging |
| Reference files | Use @filepath to pull files in directly |
Skips waiting for Claude to search for them |
| Resume sessions | --continue / --resume / --from-pr <number> |
/resume supports search, keyboard shortcuts, and branch filtering |
| Desktop notifications | System alert when a long task finishes | Implemented via the Notification hook |
| Ask about Claude’s features | Ask directly, e.g. “can Claude Code create PRs?” | Built-in docs answer capability questions on the spot |
| Scheduled tasks | Cloud / Desktop / GitHub Actions / /loop |
Pick by runtime: cloud runs while powered off, local accesses local files |
2.7 Scheduled Tasks
The official docs added a Scheduled Tasks section offering four ways to run recurring tasks automatically:
| Method | Runtime Environment | Best For |
|---|---|---|
| Cloud scheduled tasks | Anthropic-hosted infrastructure | Jobs that must run even when your machine is off; configured at claude.ai/code |
| Desktop scheduled tasks | Local machine via the Desktop app | Tasks needing local files, local tools, or uncommitted changes |
| GitHub Actions | CI pipeline | Repo-event triggers or cron schedules tied to your repository |
/loop |
Current CLI session | Quick in-session polling; stops when the session exits |
Rule of thumb: use Cloud for persistence, Desktop for local file access, GitHub Actions for repository integration, and /loop for ad-hoc polling.
💬 hippo: I wrote a dedicated breakdown on scheduled tasks—see Official Docs Breakdown: Scheduled Tasks.
3. Hippo’s Field Notes
💬 hippo: Real-world pitfalls and habits from using these workflows daily.
3.1 Plan Mode Prevents Wrong-Direction Rework
Early on, I handed a complex requirement straight to Claude. It edited 8 files before I realized the architectural direction was wrong and had to revert everything.
My rule now: Any change touching 3 or more files starts in Plan Mode.
1 | claude --permission-mode plan |
Align on the approach inside Plan Mode first, then exit to implement.
3.2 Worktrees for Urgent Interrupts
Hit with an urgent production bug mid-feature? Previously that meant git stash → switch branches → fix → switch back → git stash pop, often ending in merge conflicts.
Now:
1 | # Open a second terminal with full workspace isolation |
Both Claude instances run side by side with zero interference.
3.3 ultrathink for Architectural Decisions
For multi-factor trade-offs—splitting a monolith into services, choosing a database or caching layer—prepend ultrathink to the prompt:
1 | > ultrathink analyze how to split the user system out of the monolith into a standalone service, considering data consistency, migration cost, and operational complexity |
Claude reasons at maximum effort and delivers a much more thorough trade-off analysis. For a caching decision, it compared Redis Cluster and Memcached across read/write throughput, memory efficiency, high availability, and operational overhead—far faster than piecing the research together manually.
3.4 Slash Commands to Standardize Team Workflows
I added two shared commands to our repository:
1 | # .claude/commands/review.md |
Once teammates clone the repo, they can immediately run /review and /test auth.js without rewriting boilerplate prompts.
3.5 Piping Claude into CI
Add an automated code-review step to GitHub Actions:
1 | # .github/workflows/review.yml |
Every pull request automatically gets a concise review summary right in the job summary.
4. FAQ
Q: What is the difference between Plan Mode, Normal Mode, and Auto-Accept Mode?
A: They form a progression of file-modification permissions:
| Mode | File Reads | File Edits | Best For |
|---|---|---|---|
| Plan Mode | Allowed | Disallowed | Codebase analysis and design planning |
| Normal Mode | Allowed | Requires confirmation | Everyday development |
| Auto-Accept Mode | Allowed | Automatic | Batch edits and CI integration |
Press Shift+Tab to cycle through all three modes.
Q: Do I need to reinstall dependencies after creating a worktree?
A: Yes. A worktree is a separate directory and does not share node_modules or similar build artifacts, so run npm install again.
Q: How does ultrathink differ from regular thinking?
A: ultrathink is a keyword that sets the highest effort level for that single turn, causing Opus 4.6 and Sonnet 4.6 to allocate more thinking tokens. Regular thinking runs at the default effort level.
Q: What is the difference between --continue, --resume, and --from-pr?
A: Each flag targets a different way of picking up past work:
| Command | Behavior |
|---|---|
--continue |
Resumes the most recent conversation immediately |
--resume |
Opens an interactive picker with search (/), preview (P), rename (R), and branch filter (B) |
--from-pr <number> |
Resumes the session associated with a specific PR |
Sessions are stored per project directory. The /resume picker lists interactive sessions from the same Git repository (including worktrees). Sessions started via claude -p or the SDK do not appear in the picker, though you can still resume them explicitly with claude --resume <session-id>.
Tip: When juggling multiple tasks, give each session a descriptive name with --name or /rename so it is easy to find later.
Q: Is there an input length limit when piping into Claude?
A: Usually it is plenty. For very large inputs, pass the file path in your prompt and let Claude read the file directly instead of piping the entire contents over stdin.
5. Summary
Common Workflows is one of the highest-utility pages in the Claude Code documentation. Its 17 workflows cover nearly every daily engineering task, with five worth mastering first:
- Plan Mode: Draft and align on a plan before complex edits to avoid costly wrong-direction rework
- Thinking Mode +
ultrathink: Dial up deep reasoning for architectural trade-offs and tricky bugs - Git Worktrees: Run parallel tasks without conflicts, complete with auto-creation and cleanup
- Unix Piping: Embed Claude directly into scripts and CI pipelines for automated reviews
- Scheduled Tasks: Pick from four runtimes—from persistent cloud schedules to in-session
/looppolling
Series Navigation
- Index: Claude Code Complete Guide · Series Index
- Previous: Official Docs Breakdown: Best Practices for Claude Code
- Next: Official Docs Breakdown: How Claude Remembers Your Project
Based on Common Workflows - Claude Code Docs.
Last updated: 2026-04-09




