DEV Community

brian austin
brian austin

Posted on

How I use Claude Code to supervise multiple AI subagents — without losing control

How I use Claude Code to supervise multiple AI subagents — without losing control

Running one AI agent on a task is manageable. Running five simultaneously is where things get interesting — and where most developers lose control.

This is the workflow I've developed after months of running parallel Claude Code subagents on real production work.

The problem with multiple subagents

When you spin up parallel agents, three things break simultaneously:

  1. Context drift — each agent develops its own understanding of the codebase
  2. Conflict zones — agents touch the same files and overwrite each other's work
  3. Token burn — five agents hit rate limits five times faster

The naive approach (just launch 5 agents and hope) fails within 20 minutes on any non-trivial task.

The supervision architecture

Here's the structure that actually works:

Orchestrator Agent (you)
├── Agent A → frontend (React components)
├── Agent B → backend (API routes)
├── Agent C → database (migrations)
├── Agent D → tests (integration)
└── Agent E → docs (README updates)
Enter fullscreen mode Exit fullscreen mode

The orchestrator doesn't do implementation work. Its only job is coordination.

Setting up the CLAUDE.md for subagent work

Before launching any subagents, the orchestrator writes a shared coordination file:

# AGENT COORDINATION

## Locked files (do not touch)
- src/auth/session.ts — owned by Agent B
- prisma/schema.prisma — owned by Agent C
- src/components/Layout.tsx — owned by Agent A

## Shared interfaces (read-only for all agents)
- src/types/api.ts
- src/types/user.ts

## Current phase: IMPLEMENTATION
All agents working in parallel. Sync at 15-minute intervals.

## Agent assignments
- A: Create UserProfile component (src/components/UserProfile.tsx)
- B: Create /api/user/profile endpoint (src/routes/user.ts)
- C: Add profile fields to User table (prisma/migrations/)
- D: Write integration tests (tests/user-profile.test.ts)
- E: Update API documentation (docs/api/user.md)
Enter fullscreen mode Exit fullscreen mode

This file is the single source of truth. Every agent reads it before touching anything.

The supervision loop

Here's the actual supervision protocol I run every 15 minutes:

# Check what each agent has changed
git diff --stat HEAD

# Look for conflicts
git status

# Check agent progress in their working files
ls -la src/components/ src/routes/ prisma/migrations/ tests/ docs/
Enter fullscreen mode Exit fullscreen mode

Then I ask each agent for a status update:

Status check: What have you completed? What are you currently working on? 
Any blockers or questions? Any files you need access to that are currently locked?
Enter fullscreen mode Exit fullscreen mode

Agents that are blocked get their blockers resolved before they waste more tokens spinning.

Preventing file conflicts

The most common failure mode: Agent A and Agent B both need to modify src/types/api.ts to add their new types.

The fix: establish a type negotiation protocol at the start:

Before either agent touches src/types/api.ts:
1. Agent A writes its required types to a scratch file: /tmp/agent-a-types.ts
2. Agent B writes its required types to a scratch file: /tmp/agent-b-types.ts  
3. Orchestrator merges both into src/types/api.ts
4. Both agents proceed with the merged types
Enter fullscreen mode Exit fullscreen mode

This adds 5 minutes of overhead and prevents 30 minutes of conflict resolution.

Handling rate limits across 5 agents

Five parallel agents means five simultaneous heavy Claude sessions. Each one doing serious work — reading multiple files, writing code, running tests — burns through the standard Claude Code rate limits fast.

What I do:

  • Stagger agent launches by 3-5 minutes (not all at once)
  • Keep a fallback API endpoint ready for when limits hit
  • Use ANTHROPIC_BASE_URL to route through a secondary endpoint when the primary is exhausted

For the secondary endpoint, I use SimplyLouie — it's a Claude API proxy at ✌️2/month that I switch to when my primary Claude session hits limits. The setup is one environment variable:

export ANTHROPIC_BASE_URL=https://simplylouie.com/api
Enter fullscreen mode Exit fullscreen mode

This keeps all 5 agents running without a 5-hour wait.

The sync checkpoint

Every 30 minutes (or after each major phase), run a full sync:

Orchestrator prompt:
"Review all changes made by all agents since the last checkpoint.
Identify: (1) any conflicts that need resolution, (2) any agents that are blocked,
(3) any implementations that don't match the shared interfaces in src/types/api.ts,
(4) any test failures. Produce a reconciliation plan before any agent continues."
Enter fullscreen mode Exit fullscreen mode

This takes 5-10 minutes of orchestrator time but prevents divergence that would take hours to untangle.

A real example: shipping a feature in 2 hours

Last month I used this setup to ship a user profile feature across frontend, backend, database, and tests simultaneously.

Without subagents: 2 days of sequential work.
With 5 supervised subagents: 2 hours.

The supervision overhead was maybe 20% of that time — checking status, resolving conflicts, merging types. The other 80% was parallel execution.

The key insight

Supervising subagents is a skill, not a feature. The agents don't coordinate themselves. You are the coordinator. Your job is:

  • Define clear ownership boundaries before work starts
  • Check in at regular intervals, not just when something breaks
  • Resolve conflicts immediately rather than letting agents work around them
  • Keep a shared coordination file that every agent can read

Once you internalize this, running 5 parallel agents becomes less stressful than running 1 unsupervised agent.


The rate limit problem for parallel agents is real. When 5 sessions compete for the same Claude Code quota, limits hit fast. I use SimplyLouie as my fallback endpoint — ✌️2/month, same Claude API, swap with ANTHROPIC_BASE_URL. Start with a 7-day free trial.

Top comments (0)