1735 words No Slides

Video 20.4: Spawning and Managing Teammates

Course: Claude Code - Parallel Agent Development Section: S20 - Agent Teams Video Length: 5 minutes Presenter: Daniel Treasure


Opening Hook

Spawning a team is as simple as describing what you need. No configuration files, no templates—just natural language. Tell Claude Code what specialists you need, and it creates them. Let's build a team from scratch.


Key Talking Points

What to say:

Natural Language Spawning - You describe the team you need in plain English - Claude Code parses your request and creates the team automatically - No YAML, no templates, no wizard dialogs - Examples: "Create a team with 3 teammates" or "I need an API architect, a React specialist, and a test engineer" - The system is smart enough to understand roles and allocate resources

Basic Spawning - Simplest form: just count: "Create a team with 3 teammates" - Claude creates three generic teammates with default names - Each gets the same model (default is the lead's model) - Useful for quick prototyping or when roles don't matter yet

Role-Based Spawning - Specify focus areas: "Create a team with one for API, one for frontend, one for database" - Claude creates teammates with those specializations in mind - The role becomes part of their context and initial direction - Names are auto-generated based on roles (api_dev, frontend_dev, db_engineer) - Much more effective than generic teammates

Model Selection - By default, teammates use the same model as the lead - You can specify different models: "Create a team with an Opus architect and two Sonnet implementers" - Opus models are slower but better for complex thinking; Sonnet is faster for tactical work - Cost implication: Opus is more expensive, so use strategically - Example: "Create a team with 4 teammates: one Opus architect, three Sonnet engineers"

Detailed Spawning with All Options - Combine roles, count, and models: "I need a team with one Opus architect for system design, two Sonnet backend developers, and one Sonnet frontend developer" - Order matters: lead reads it naturally - Flexible syntax: Claude is forgiving about phrasing - Overkill for simple cases but powerful for complex projects

Managing the Spawn - Watch teammates initialize (shows progress in terminal) - Each teammate gets an independent context window - Names appear in the interface - Task board starts populating with initial planning tasks - Takes 20-30 seconds typically (network latency included)

Shutting Down a Teammate - Graceful shutdown: "Ask the frontend dev to shut down" or "Ask @frontend_dev to shut down" - The teammate sees the request and can accept or ask for clarification - Allows them to finish what they're doing, save state, or ask "are you sure?" - Not forceful: it's a negotiation, not a hard kill - Useful when a task is complete or you realize you don't need that specialist anymore

Team Cleanup - Removes all shared resources and ends the team session - Command: "Clean up the team" - Always initiated by the lead (teammates can't clean up themselves) - Happens gracefully; teammates are notified - Necessary before spawning a new team (one team per session)

Model Costs and Practical Considerations - Using Opus for every teammate is expensive - Use Opus for architecture, design, complex thinking - Use Sonnet for implementation, testing, routine work - Hybrid teams (mixed models) are the sweet spot for cost-effectiveness - Lead can be Opus, teammates a mix based on role

What to show on screen:

  • Terminal showing Claude Code ready to spawn
  • Natural language requests for teams (multiple examples)
  • Team initialization in real-time
  • Task board as tasks populate
  • Teammate names and roles appear
  • Show sending a shutdown request to one teammate
  • Show them responding (graceful exit)
  • Show the team cleanup command
  • Verify team is gone and ready for a new spawn

Demo Plan

0:00-0:45 - Simple Spawn - Start with the simplest case: "Create a team with 3 teammates" - Watch them initialize one by one - Narrate: "These three teammates now have independent context windows and are ready to work" - Point out the auto-generated names in the interface - Show the task board starting to populate

0:45-1:45 - Role-Based Spawn - Stop and start fresh (cleanup the team) - Now spawn with roles: "I need a team with one focused on API development, one on React frontend, and one on testing" - Watch the difference: teammates are given direction and context about their specialty - Narrate: "Notice how the names now reflect their roles. Each teammate knows their lane" - Show the task board with role-specific initial tasks (API design, component architecture, test strategy) - Explain: "This small difference—being specific about roles—is huge for team coherence"

1:45-2:45 - Mixed Model Spawn - Clean up again - Spawn with model specification: "Create a team with one Opus architect for system design and two Sonnet developers for implementation" - Narrate: "The Opus teammate will do the heavier thinking; the Sonnet teammates will move fast on code" - Show the initialization takes the same time (all three spawn in parallel) - Explain the cost implication briefly: "Opus is more expensive per token, so we use it strategically for the big decisions" - Show all three working together

2:45-3:45 - Shutdown and Management - All three teammates are working on a task - Pick one and send a shutdown request: "Ask the architect to shut down" - Show the request go to that teammate - The teammate responds (could be "okay" or "I'm in the middle of something") - Show graceful shutdown - Narrate: "That's a graceful shutdown. The teammate had the chance to save state" - Show the team now has 2 active teammates - Ask another to shut down if time permits

3:45-4:30 - Full Cleanup and Reset - Say: "Clean up the team" - Watch the entire team wind down - Show the task board clearing - Confirm no team is active - Narrate: "Now we're ready to spawn a completely new team if we want" - Optional: spawn one final team to show we're back to the start

4:30-5:00 - Lead-out - Confirm the basics are down - Next video focuses on the task list and how teams coordinate work - Tease: "Tasks are the heartbeat of team communication"


Code Examples & Commands

Simple Spawn (Generic)

# In Claude Code:
> Create a team with 3 teammates

Role-Based Spawn

> Create a team with one teammate focused on API backend,
> one on React frontend, and one on testing

Model-Specific Spawn

> I need a team with one Opus teammate for system architecture
> and two Sonnet teammates for implementation

Complex Spawn (All Options)

> Create a team with the following specialists:
> - One Opus architect for overall system design
> - Two Sonnet backend engineers for API and database
> - One Sonnet frontend developer for React components
> - One Sonnet QA engineer for testing

Shutdown a Teammate

# Graceful shutdown
> Ask the API developer to shut down

# Alternative phrasing
> @api_dev, are you ready to wrap up and shut down?

# Direct request
> Shut down the testing teammate

Team Cleanup

# Remove all teammates and clean up shared resources
> Clean up the team

# Alternative
> Let's wrap up this team session

Example Team Config (Reference - Auto-Generated)

{
  "team_name": "sprint-build",
  "lead_model": "claude-opus-4-6",
  "lead_delegate_mode": false,
  "teammates": [
    {
      "name": "api_architect",
      "model": "claude-opus-4-6",
      "role": "API Backend Architecture"
    },
    {
      "name": "backend_dev_1",
      "model": "claude-sonnet-4-20250514",
      "role": "Backend Implementation"
    },
    {
      "name": "frontend_dev",
      "model": "claude-sonnet-4-20250514",
      "role": "React Frontend"
    },
    {
      "name": "qa_engineer",
      "model": "claude-sonnet-4-20250514",
      "role": "QA and Testing"
    }
  ]
}

Gotchas & Tips

Gotchas: - You can't spawn a second team until you clean up the first one (one team per session) - Teammate names are auto-generated; you can't manually name them during spawn - If you ask for a "Python expert" but your project is JavaScript, Claude will understand context and adapt - Changing the spawn request midway doesn't work; you have to cleanup and respawn - Very large teams (8+ teammates) will be slower to initialize and harder to manage

Tips: - Start with 3-4 teammates for your first real team, then scale up once you understand workflows - Use Opus for 1-2 teammates (architects, lead thinkers), rest on Sonnet for cost efficiency - Be specific about roles: "API with validation and error handling" is better than just "API" - Role names matter for teammate context; avoid vague terms like "developer" - If a teammate isn't a good fit after spawning, just ask them to shut down and spawn a replacement - Watch the task board during spawn to see how teammates interpret their roles


Lead-out

You now know how to create and manage a team. But how do they coordinate? In the next video, we'll explore the task list—the shared nervous system of the team. You'll learn how to assign work, create dependencies, and keep everyone in sync.


Reference URLs

  • Claude API Model Pricing: https://www.anthropic.com/pricing
  • Claude Models Comparison: https://www.anthropic.com/claude/features
  • Team Spawning Reference: https://www.anthropic.com/claude-code/docs/agent-teams/spawning

Prep Reading

  • Review the capabilities and speed differences between Opus and Sonnet models
  • Think about a real project you'd build with a team (what roles would you need?)
  • Understand the cost implications of model choices for your use case
  • Familiarize yourself with what a graceful shutdown looks like in distributed systems (conceptual understanding)

Notes for Daniel

Spawning is visually cool—watch and celebrate each teammate appearing. Don't rush through the initializations; let viewers see the team coming together. The model selection part is important for practical use, so be clear about cost/speed tradeoffs. Shutdown is brief but shows maturity of the system; emphasize that it's graceful, not forceful. This video is slightly longer (5 min) because there are multiple spawn scenarios; pace it so nothing feels rushed.

Risk: if the network is slow or Claude is rate-limiting, the spawn might take longer than expected. Have a backup pre-spawned team ready, or talk through what's happening in the background while it initializes. The cleanup/respawn cycle is quick and satisfying—make sure to show it crisply.