Claude Code subagent patterns: how to break big tasks into bounded scopes
Claude Code Subagent Patterns: How to Break Big Tasks into Bounded Scopes If you've ever given Claude Code a massive task — "refactor the entire auth system" — and watched it spiral into confusion after 20 minutes, you've hit the core problem: unbounded scope kills context . The solution is subagent patterns: structured ways to decompose work into bounded, parallelizable units. Why Big Tasks Fail in Claude Code Claude Code has a finite context window. When you give it a large task: It reads lots of files → context fills up It loses track of what it read first It starts making contradictory changes You hit the context limit mid-task The session crashes and you lose progress The fix isn't a bigger context window — it's smaller tasks. The Subagent Pattern Instead of one Claude session doing e
Claude Code Subagent Patterns: How to Break Big Tasks into Bounded Scopes
If you've ever given Claude Code a massive task — "refactor the entire auth system" — and watched it spiral into confusion after 20 minutes, you've hit the core problem: unbounded scope kills context.
The solution is subagent patterns: structured ways to decompose work into bounded, parallelizable units.
Why Big Tasks Fail in Claude Code
Claude Code has a finite context window. When you give it a large task:
-
It reads lots of files → context fills up
-
It loses track of what it read first
-
It starts making contradictory changes
-
You hit the context limit mid-task
-
The session crashes and you lose progress
The fix isn't a bigger context window — it's smaller tasks.
The Subagent Pattern
Instead of one Claude session doing everything, you run multiple focused sessions:
# Don't do this:
"Refactor the entire auth system, update all tests, fix the API endpoints, and update docs"
Do this instead — 4 bounded tasks:
Session 1: Refactor auth/login.js only
Session 2: Update auth tests only
Session 3: Fix /api/auth/* endpoints only*
Session 4: Update auth docs only`
Enter fullscreen mode
Exit fullscreen mode
Each session has a clear scope, a clear input, and a clear output.
Setting Up Parallel Subagents with tmux
# Create 4 panes tmux new-session -d -s work tmux split-window -h tmux split-window -v tmux select-pane -t 0 tmux split-window -v# Create 4 panes tmux new-session -d -s work tmux split-window -h tmux split-window -v tmux select-pane -t 0 tmux split-window -vLaunch each agent in its own branch
tmux send-keys -t work:0.0 'git checkout -b feat/auth-refactor && claude' Enter tmux send-keys -t work:0.1 'git checkout -b feat/auth-tests && claude' Enter tmux send-keys -t work:0.2 'git checkout -b feat/auth-api && claude' Enter tmux send-keys -t work:0.3 'git checkout -b feat/auth-docs && claude' Enter`
Enter fullscreen mode
Exit fullscreen mode
Now each agent works in its own git branch — no conflicts, clear ownership.
The Bounded Scope Contract
For each subagent, define:
Input: What files can this agent read? Output: What files will this agent change? Constraint: What must this agent NOT touch?
# CLAUDE.md for auth-refactor branch
Scope
- READ: auth/login.js, auth/session.js, auth/middleware.js
- WRITE: auth/login.js, auth/session.js, auth/middleware.js
- DO NOT TOUCH: tests/, api/, docs/, any file outside auth/
Task
Refactor auth to use JWT instead of sessions. Do not change function signatures — other code depends on them.`
Enter fullscreen mode
Exit fullscreen mode
This CLAUDE.md scopes the agent's work. It won't accidentally break tests or API files.
The Orchestrator Pattern
For complex workflows, use an orchestrator session to coordinate:
# orchestrator/CLAUDE.md
Your job
You are the orchestrator. You:
- Break down the main task into subtasks
- Write task files to tasks/task-1.md, tasks/task-2.md, etc.
- Each task file becomes input for a subagent
- After subagents complete, you review and merge
Do NOT implement anything yourself
Only plan, delegate, and review.`
Enter fullscreen mode
Exit fullscreen mode
The orchestrator just creates task files. Subagents read task files and implement.
Practical Example: Feature Branch Workflow
Here's a real workflow for adding a new feature:
# 1. Orchestrator breaks down the feature cd /project cat > orchestrator-task.md << 'EOF' Feature: Add user notifications# 1. Orchestrator breaks down the feature cd /project cat > orchestrator-task.md << 'EOF' Feature: Add user notificationsBreak this into 4 independent subtasks:
- Backend: Create notifications table and model
- API: Create /api/notifications endpoints
- Frontend: Create NotificationBell component
- Tests: Write tests for all of the above
For each subtask, create tasks/task-N.md with:
- Files to create/modify
- Interfaces that must match (API contracts)
- Files to NOT touch EOF
claude < orchestrator-task.md
2. Now tasks/ has 4 files. Run subagents:
for i in 1 2 3 4; do git checkout -b feat/notif-task-$i main claude < tasks/task-$i.md git add -A && git commit -m "task $i complete" done
3. Merge all branches
git checkout main for i in 1 2 3 4; do git merge feat/notif-task-$i --no-ff done`
Enter fullscreen mode
Exit fullscreen mode
Handling Conflicts Between Subagents
The most common conflict: two agents modify the same shared file.
Prevention: In each agent's CLAUDE.md, explicitly list shared files as READ-ONLY:
## Shared files — READ ONLY
- src/types.ts — read this for type definitions, do NOT modify
- src/config.js — read this for config, do NOT modify
- package.json — do NOT modify`
Enter fullscreen mode
Exit fullscreen mode
If conflicts happen anyway:
# After merging, check for conflicts git status | grep "both modified"# After merging, check for conflicts git status | grep "both modified"For each conflict, run a resolution agent:
cat > resolve-task.md << 'EOF' Resolve the merge conflict in src/types.ts. Branch feat/notif-task-1 added UserNotification type. Branch feat/notif-task-2 added NotificationSettings type. Both types should exist. Merge them without removing either. EOF claude < resolve-task.md`
Enter fullscreen mode
Exit fullscreen mode
Rate Limits and the ANTHROPIC_BASE_URL Fix
Running 4 parallel Claude Code sessions means 4x the token usage. You'll hit rate limits fast.
The fix is to route all sessions through a proxy that removes rate limits:
export ANTHROPIC_BASE_URL=https://simplylouie.com/api/claude
Now all 4 sessions share a single rate-limit-free connection`
Enter fullscreen mode
Exit fullscreen mode
SimplyLouie is ✌️2/month — less than the cost of one interrupted multi-agent session. Set the env var and your parallel workflows run uninterrupted.
Summary
Pattern Use when
Sequential subagents Tasks have dependencies
Parallel subagents Tasks are independent
Orchestrator Task breakdown is complex
Bounded scope CLAUDE.md Any multi-file task
The rule: one context window = one bounded scope. Break your work to fit the tool, not the other way around.
Running parallel Claude Code agents? Set ANTHROPIC_BASE_URL to avoid rate limits mid-session. SimplyLouie — ✌️2/month.
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
claudemodellaunch
I Shipped an AI SaaS in 4 Hours. Here Is the Exact Stack.
I Shipped an AI SaaS in 4 Hours. Here Is the Exact Stack. Every AI SaaS project starts the same way. You have a great idea. You open your editor. Then you spend three weeks on auth, Stripe integration, a dashboard, and a landing page — none of which is your actual product. I built a kit that eliminates that. Here is the exact stack and what each piece does. The Stack next.js 14 (App Router) tailwind css stripe billing nextauth openai / claude api routes prisma + postgresql What Comes Pre-Wired Authentication (NextAuth) // app/api/auth/[...nextauth]/route.ts import NextAuth from " next-auth " import { authOptions } from " @/lib/auth " const handler = NextAuth ( authOptions ) export { handler as GET , handler as POST } Google OAuth, GitHub OAuth, and email/password — all configured. Sessions

Full Stack Developer Roadmap 2026: The Complete Guide from Beginner to Pro 🚀
Have a Look at My Portfolio Introduction: Why Full Stack Development Is Still the Best Bet in 2026 Let me be straight with you. When I started learning web development years ago, I had seventeen browser tabs open, three half-finished Udemy courses, and absolutely no idea what to actually learn first. Sound familiar? The good news: in 2026, the path is clearer than ever — if you know where to look. Full stack development remains one of the most in-demand, highest-paying, and genuinely exciting career paths in tech. Despite all the noise about AI replacing developers, companies continue to hire full stack developers because AI can assist coding — but it cannot design, architect, and scale real-world applications independently. What has changed is the stack itself. In 2026, being a full stack

10 Claude Code Skills That Replaced My Boilerplate Folders
10 Claude Code Skills That Replaced My Boilerplate Folders I used to keep a folder of boilerplate code. Auth templates. Stripe integration files. Docker configs. I do not do that anymore. Here are the 10 Claude Code skills that replaced them. What Is a Claude Code Skill? A skill is a markdown file Claude Code reads before writing code. It gives Claude full context about your preferences, patterns, and requirements — so the output is production-ready, not generic. You invoke a skill with a slash command: /auth → full authentication system /pay → Stripe billing setup Claude reads the skill, asks clarifying questions, then outputs complete implementations. The 10 Skills 1. /auth — Authentication System Asks: OAuth providers? Session or JWT? Role-based access needed? Outputs: Complete auth imp
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Releases

Orientation Matters: Learning Radiation Patterns of Multi-Rotor UAVs In-Flight to Enhance Communication Availability Modeling
arXiv:2604.02827v1 Announce Type: new Abstract: The paper presents an approach for learning antenna Radiation Patterns (RPs) of a pair of heterogeneous quadrotor Uncrewed Aerial Vehicles (UAVs) by calibration flight data. RPs are modeled either as a Spherical Harmonics series or as a weighted average over inducing samples. Linear regression of polynomial coefficients simultaneously decouples the two independent UAVs' RPs. A joint calibration trajectory exploits available flight time in an obstacle-free anechoic altitude. Evaluation on a real-world dataset demonstrates the feasibility of learning both radiation patterns, achieving 3.6 dB RMS error, the measurement noise level. The proposed RP learning and decoupling can be exploited in rapid recalibration upon payload changes, thereby enabl

MFE: A Multimodal Hand Exoskeleton with Interactive Force, Pressure and Thermo-haptic Feedback
arXiv:2604.02820v1 Announce Type: new Abstract: Recent advancements in virtual reality and robotic teleoperation have greatly increased the variety of haptic information that must be conveyed to users. While existing haptic devices typically provide unimodal feedback to enhance situational awareness, a gap remains in their ability to deliver rich, multimodal sensory feedback encompassing force, pressure, and thermal sensations. To address this limitation, we present the Multimodal Feedback Exoskeleton (MFE), a hand exoskeleton designed to deliver hybrid haptic feedback. The MFE features 20 degrees of freedom for capturing hand pose. For force feedback, it employs an active mechanism capable of generating 3.5-8.1 N of pushing and pulling forces at the fingers' resting pose, enabling realist

Software-update - Ventoy 1.1.11
Versie 1.1.11 van Ventoy is uitgekomen. Met dit opensourceprogramma kan een zelfstartende USB-stick worden gemaakt. De manier waarop het dat doet, is echter anders dan bij vergelijkbare tools. De USB-stick hoeft slechts eenmaal geprepareerd te worden en daarna kunnen er zoveel isobestanden als de vrije ruimte toelaat op de stick geplaatst worden. Ventoy maakt zelf automatisch een bootmenu aan voor de aanwezige isobestanden. Ondersteuning is aanwezig voor zowel UEFI- als legacyboot en het is getest met 1373 verschillende isobestanden. De changelog voor deze uitgave ziet er als volgt uit: Changes in Ventoy 1.1.11:

Dynamic Mask Enhanced Intelligent Multi-UAV Deployment for Urban Vehicular Networks
arXiv:2604.02358v1 Announce Type: cross Abstract: Vehicular Ad Hoc Networks (VANETs) play a crucial role in realizing vehicle-road collaboration and intelligent transportation. However, urban VANETs often face challenges such as frequent link disconnections and subnet fragmentation, which hinder reliable connectivity. To address these issues, we dynamically deploy multiple Unmanned Aerial Vehicles (UAVs) as communication relays to enhance VANET. A novel Score based Dynamic Action Mask enhanced QMIX algorithm (Q-SDAM) is proposed for multi-UAV deployment, which maximizes vehicle connectivity while minimizing multi-UAV energy consumption. Specifically, we design a score-based dynamic action mask mechanism to guide UAV agents in exploring large action spaces, accelerate the learning process a


Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!