Claude Code Subagents: Run 5 Coding Tasks in Parallel Without Hitting Rate Limits
If you've used Claude Code for more than a week, you've hit the wall: you're in the middle of a complex refactor, Claude is doing great work, and then — rate limit. Session paused. Momentum lost.
The solution isn't to slow down. It's to go wider.
The Subagent Pattern
Instead of one Claude Code session doing five things sequentially, you spin up five separate sessions — each doing one thing independently, in its own branch.
This is the subagent pattern:
# Terminal 1: Feature A
git checkout -b feature/auth-refactor
claude "Refactor the auth module: extract JWT logic to auth/jwt.js,
move middleware to auth/middleware.js, update all imports"
# Terminal 2: Feature B
git checkout -b feature/api-tests
claude "Write comprehensive tests for routes/api.js —
cover all endpoints, error cases, auth failures"
# Terminal 3: Feature C
git checkout -b feature/db-migration
claude "Create migration scripts for the schema changes in schema.sql —
write up.sql and down.sql with data backups"
# Terminal 4: Feature D
git checkout -b feature/perf-audit
claude "Profile the 5 slowest endpoints, identify N+1 queries,
add indexes and optimize the worst offenders"
# Terminal 5: Docs
git checkout -b docs/api-update
claude "Update README and docs/api.md to reflect the new auth endpoints —
include curl examples for every route"
All five run simultaneously. While terminal 1 is refactoring auth, terminal 2 is writing tests. You're not waiting — you're orchestrating.
The Golden Rule: One Task, One Branch, One Scope
Subagents only work if each one has a bounded, isolated scope.
Bad: claude "Refactor auth, write tests, update docs, fix the bug Brian mentioned"
Good: claude "Only touch auth/jwt.js and auth/middleware.js. Extract JWT decode logic to a pure function. No other files."
When scopes overlap, agents step on each other. When scopes are isolated, they run clean.
The git branch per agent rule enforces this at the OS level — merging branches surfaces conflicts explicitly rather than letting them corrupt silently.
The Orchestrator Pattern
For complex tasks, use a separate session as the orchestrator:
# Orchestrator terminal
claude "You are coordinating a database migration project.
The following tasks are running in parallel in separate terminals:
- Terminal 1: Writing new schema (feature/schema-v2)
- Terminal 2: Writing migration scripts (feature/migrations)
- Terminal 3: Updating ORM models (feature/models-update)
Your job: review the output from each branch when they complete,
identify conflicts, and write the integration plan.
Start by describing what each agent needs to produce."
The orchestrator doesn't do the work — it coordinates, reviews, and integrates.
Real Example: Shipping a Full Feature in 45 Minutes
Here's how I shipped a complete payments feature using parallel subagents:
Time 0:00 — Spawn 4 agents simultaneously:
- Agent 1:
claude "Build the Stripe webhook handler in routes/webhooks.js" - Agent 2:
claude "Build the subscription model in models/subscription.js" - Agent 3:
claude "Write tests for the payment flow in tests/payments.test.js" - Agent 4:
claude "Update the pricing page HTML to show the new plan tiers"
Time 0:20 — Each agent finishes its isolated scope
Time 0:30 — Review and merge: git merge feature/webhook feature/subscription-model feature/payment-tests feature/pricing-update
Time 0:45 — Fix the two merge conflicts (webhook handler referenced the model differently than the model defined itself)
Sequential would have taken 2-3 hours. Parallel took 45 minutes.
The Rate Limit Problem
Here's the catch: five parallel Claude Code sessions means five parallel rate limit clocks.
If you're on the standard Claude Max subscription, you'll hit the shared rate limit across sessions. Session 3 pauses while sessions 1 and 2 are running hot.
The way around this is to route each session through its own API key — or use a proxy that manages the pooling for you.
# Route each subagent through the proxy
ANTHROPIC_BASE_URL=https://simplylouie.com/api/claude claude
With a $2/month proxy subscription, you get:
- Flat monthly rate instead of per-token billing
- Managed rate limit pooling across sessions
- All 5 subagents can run without throttling each other
Details at simplylouie.com
Checkpoint Pattern for Long Tasks
For subagents doing work that takes 30+ minutes, add checkpoints to CLAUDE.md:
## Checkpoint Protocol
After completing each major step, write a one-line status to /tmp/agent-{branch}-status.txt:
- DONE: what was completed
- NEXT: what comes next
- BLOCKED: if you need input
Then your orchestrator can poll status files without interrupting agents:
watch -n 30 'cat /tmp/agent-*-status.txt'
When NOT to Use Subagents
- Sequential dependencies: if task B requires task A's output, they can't run parallel
- Shared mutable state: agents writing to the same file will conflict
- Exploratory work: if you don't know the scope yet, one session is better
- Debugging: debugging benefits from continuity, not parallelism
The TL;DR
- One task per agent, one branch per agent
- Define scope explicitly in the prompt — no scope creep
- Use a separate orchestrator session for coordination
- Handle rate limits with a proxy or API key pooling
- Merge at the end, conflicts are expected and manageable
The subagent pattern turns Claude Code from a single-threaded tool into a multi-threaded dev team. Once you've shipped something with 5 parallel agents, going back to sequential feels like removing CPU cores.
Running multiple Claude Code sessions simultaneously? The rate limit problem is real. simplylouie.com — $2/month flat rate proxy, 7-day free trial.
Top comments (0)