When I first started using Claude Code, I kept everything simple. Open a terminal, type "implement this feature," get results. But as the work got more complex, that simple approach started breaking down. Some tasks took too long, others got their context tangled up, and some had Claude Code losing its direction entirely.
After enough friction, I noticed a pattern — or rather, five of them. The efficiency of Claude Code changes dramatically depending on how you use it. This post breaks down those five agentic workflow patterns.
The 5 Patterns at a Glance
| Pattern | Agents | Human Involvement | Best For |
|---|---|---|---|
| Sequential | 1 | After each step | Staged tasks, documentation |
| Operator | 1 | Minimal | Tool-heavy single complex tasks |
| Parallel | Multiple | Before and after | Independent tasks running simultaneously |
| Teams | Multiple | Orchestrator only | Complex tasks needing role separation |
| Autonomous | Multiple | Near zero | Scheduled, batch, repeated tasks |
At first, these distinctions felt overly academic to me. Using them is what makes the differences real.
Pattern 1: Sequential
The simplest and most intuitive pattern. You stay in the loop and advance work step by step.
# Example: code review → fix → test → document
claude "review the code in this PR"
# Check the review, then direct the next step
claude "fix items A and B from the review"
# Check the fix, then continue
claude "add test coverage for the changes you just made"
You verify each result and issue the next instruction. It's slow, but you have the highest degree of control.
When to use it: When you need to validate quality at each step, or when human judgment is needed between tasks. Especially good for exploring an unfamiliar codebase — it's the safest default.
Honest take: The fatigue is real for repetitive work. A five-step task means five separate rounds of monitoring.
Pattern 2: Operator
Give a single agent MCP tools or Bash execution rights, then hand it one complex task.
# After defining permission scope in CLAUDE.md
claude "analyze every TypeScript file in src/,
create a report of type errors in report.md,
and fix anything that's clearly fixable"
The key is precisely defining permission scope upfront. Your .claude/settings.json or CLAUDE.md should explicitly specify which files can be modified and which commands can run.
{
"permissions": {
"allow": ["Bash(npm run *)", "Read", "Edit"],
"deny": ["Bash(rm *)", "Bash(git push *)"]
}
}
When to use it: A single complex task with a clear context and well-defined scope. Examples: "add JSDoc to all functions in this module," "rename all files in this directory to kebab-case."
The Claude Code best practices guide covers permission design through CLAUDE.md in depth — worth reading alongside this.
Pattern 3: Parallel
Process multiple independent tasks simultaneously by creating isolated work environments with Git Worktree.
# Create 3 independent worktrees
git worktree add ../feature-auth feature/auth
git worktree add ../feature-dashboard feature/dashboard
git worktree add ../docs-update docs/update
# Run separate Claude Code sessions in each
cd ../feature-auth && claude "implement JWT authentication"
cd ../feature-dashboard && claude "optimize the dashboard components"
cd ../docs-update && claude "bring the API docs up to date"
Switching to this approach made a noticeable difference in my personal throughput. The most concrete win: running other branch work while waiting for a CI pipeline to finish.
The step-by-step guide to running parallel sessions with Git Worktree is in a dedicated post. If you're setting this up for the first time, that's the faster path.
When to use it: Independent feature development, multi-language translations, writing test suites — anything that doesn't require shared state between tasks.
Watch out: Tasks that touch the same file will conflict if run in parallel. Checking inter-task dependencies is a prerequisite.
Pattern 4: Teams
An orchestrator agent delegates work to multiple sub-agents. This uses Claude Code's sub-agent functionality.
# Prompt passed to the orchestrator
Handle these tasks in order:
1. @researcher: gather latest technical trends on this topic
2. @writer: draft a blog post based on the research
3. @editor: SEO optimization and proofreading of the draft
4. @publisher: translate the final piece into 4 languages and save files
The core of the Teams pattern is role separation. Each agent only knows its own domain; the orchestrator manages the overall flow.
In practice, this approach also distributes the context length limits of individual agents. Handing a large task to one agent tends to blow up the context window. Splitting into a team means each agent only needs to hold the context for its own piece of work.
I wrote about actually setting up and running an agent team in OpenClaw — role design through tmux-based monitoring, with specifics.
When to use it: Sequential but complex multi-step pipelines. Content pipelines, code review → fix → test → deploy cycles, and similar flows.
Looking back at the failures and improvements when I applied the orchestrator pattern to this blog's automation system — unclear role boundaries led to agents conflicting with each other or spinning in infinite loops. That was more instructive than any documentation.
Pattern 5: Autonomous
Fully autonomous execution triggered by cron or events, with no human in the loop. This blog's daily publishing pipeline runs exactly this way.
# Executed by launchd or cron
#!/bin/bash
cd ~/workspace/blog
claude --no-interactive "
Research today's tech trends,
write a blog post in 4 languages,
verify the build, and complete the git push.
On failure, send a Telegram notification.
"
Prerequisites for this pattern:
- Clear success/failure criteria must be defined up front
- Rollback mechanisms ready to go (git revert, etc.)
-
Monitoring and alerts configured (use the Hooks
stopevent)
Honestly, the Autonomous pattern is easy to over-trust at first. When it works, it feels like magic. But when an agent starts running in the wrong direction, stopping it is harder than expected. For anything that touches the file system or writes to external services, I always validate with a dry-run mode first.
How to Choose a Pattern
The criteria I use when picking a pattern:
Do I need to review the work partway through?
- Yes → Sequential
Are there multiple tasks, each independent of the others?
- Yes → Parallel
Is this a complex pipeline with clearly separable roles?
- Yes → Teams
Does this need scheduled/repeated execution, and is it well-proven?
- Yes → Autonomous
Single complex task otherwise?
- Operator
It sounds clean, but in practice compound patterns are common. This blog's automation pipeline is Teams + Autonomous — the team pattern generates the content, and that entire pipeline runs on an autonomous schedule.
What Matters More Than Pattern Selection
No matter how well you design the pattern, if CLAUDE.md and permissions are a mess, it doesn't matter. The most common failure I've run into is an "Operator with scope that's too broad." The agent modifies files it shouldn't touch, or executes unexpected bash commands.
When first introducing any pattern, starting with a narrow scope and expanding gradually is the safe approach. More than the pattern itself, boundary definition is what determines success or failure.
Top comments (0)