AgentSkillsCN

agent-teams

当用户询问 Claude Code 代理团队、希望了解基于团队的开发工作流程,或需要关于何时以及如何使用代理团队的指导时,应使用此技能。适用于用户询问“创建团队”、“使用代理团队”、“协调代理”、“并行开发”、“团队工作流程”,或说“代理团队是如何运作的”的时候使用。 此技能概述了代理团队的使用场景,说明了何时应使用代理团队而非子代理,并提供了通往团队蓝图与协调模式的专注技能路径。

SKILL.md
--- frontmatter
name: agent-teams
description: |
  This skill should be used when the user asks about Claude Code agent teams, wants to understand team-based development workflows, or needs guidance on when and how to use agent teams. Use this skill when the user asks to "create a team", "use agent teams", "coordinate agents", "parallel development", "team workflow", or says "how do agent teams work".

  This skill provides an overview of agent teams, when to use them vs subagents, and routes to focused skills for team blueprints and coordination patterns.
version: 0.1.0

Agent Teams for Application Development

Agent teams let you coordinate multiple Claude Code sessions working together on complex tasks. One session acts as the team lead coordinating work, while teammates work independently in their own context windows and communicate directly with each other.

When to Use Agent Teams

Agent teams are most effective when parallel exploration adds real value:

Use CaseWhy Teams Excel
Research & DiscoveryMultiple teammates investigate different aspects simultaneously
Feature DevelopmentTeammates each own a separate module without stepping on each other
Code Review & QAReviewers apply different lenses (security, performance, tests) in parallel
DebuggingTeammates test competing hypotheses and challenge each other's findings
Cross-Layer CoordinationFrontend, backend, and test changes each owned by a different teammate

Agent Teams vs Subagents

AspectSubagentsAgent Teams
ContextOwn window; results return to callerOwn window; fully independent
CommunicationReport back to main agent onlyTeammates message each other directly
CoordinationMain agent manages all workShared task list with self-coordination
Best forFocused tasks where only the result mattersComplex work requiring discussion and collaboration
Token costLower (results summarized back)Higher (each teammate is a separate instance)

Rule of thumb: Use subagents for quick, focused workers. Use agent teams when teammates need to share findings, challenge each other, and coordinate independently.

Prerequisites

Agent teams are experimental and must be enabled:

json
// settings.json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

Quick Start

Tell Claude to create a team using natural language:

code
Create an agent team with 3 teammates to [describe your task].
Have one teammate focus on [aspect 1], one on [aspect 2], and one on [aspect 3].

Claude creates the team, spawns teammates, assigns tasks, and coordinates work based on your prompt.

Available Skills

SkillPurposeExample Triggers
team-blueprintsPre-designed team configurations for 4 development phases"research team", "feature team", "review team", "debug team"
team-coordinationTask management, messaging, plan approval, shutdown"manage tasks", "team communication", "delegate mode"

Available Commands

CommandDescription
/agent-teamsPlugin overview and quickstart
/spawn-research-teamSpawn a research & discovery team
/spawn-feature-teamSpawn a feature development team
/spawn-review-teamSpawn a code review & QA team
/spawn-debug-teamSpawn a debugging & investigation team

Team Architecture

An agent team consists of:

ComponentRole
Team LeadThe main Claude Code session that creates the team, spawns teammates, and coordinates
TeammatesSeparate Claude Code instances that each work on assigned tasks
Task ListShared list of work items that teammates claim and complete
MailboxMessaging system for direct communication between agents

Teams and tasks are stored locally:

  • Team config: ~/.claude/teams/{team-name}/config.json
  • Task list: ~/.claude/tasks/{team-name}/

Best Practices

  1. Give teammates enough context — They load CLAUDE.md but don't inherit the lead's conversation history. Include task-specific details in spawn prompts.
  2. Size tasks appropriately — Not too small (coordination overhead), not too large (long without check-ins). Self-contained units with clear deliverables.
  3. Avoid file conflicts — Break work so each teammate owns different files.
  4. Monitor and steer — Check progress, redirect approaches, synthesize findings.
  5. Start with research — If new to teams, start with review/research tasks before parallel implementation.

Reference Documentation

For complete API documentation, tool descriptions, and detailed patterns, see: ${CLAUDE_PLUGIN_ROOT}/skills/agent-teams/references/agent-teams-reference.md