Loading...
Loading...
Configure and orchestrate Claude Code agent teams (TeamCreate, SendMessage, TaskUpdate workflow). Use when you need multiple agents working in parallel on a complex task, want to coordinate background agents with messaging, or are setting up a lead/teammate architecture with a shared task list. Teams are experimental — enable with --enable-teams flag.
npx skill4agent add laurigates/claude-plugins agent-teamsExperimental: Agent teams require theflag and may change between Claude Code versions.--enable-teams
| Use agent teams when... | Use subagents instead when... |
|---|---|
| Multiple agents need to work in parallel | Tasks are sequential and interdependent |
| Ongoing communication between agents is needed | One focused task produces one result |
| Background tasks need progress reporting | Agent output feeds directly into next step |
| Complex workflows benefit from task coordination | Simple, bounded, isolated execution |
| Independent changes to the same codebase (with worktrees) | Context sharing is fine and efficient |
Lead Agent (orchestrator)
├── TeamCreate — creates team + shared task list
├── Task tool — spawns teammate agents
├── SendMessage — communicates with teammates
├── TaskUpdate — assigns tasks to teammates
└── Teammates (run in parallel)
├── Read team config from ~/.claude/teams/<name>/config.json
├── TaskList/TaskUpdate — claim and complete tasks
└── SendMessage — report back to lead| Tool | Purpose |
|---|---|
| Create team and shared task list directory |
| Clean up team when all work is complete |
| Send DMs, broadcasts, shutdown requests, plan approvals |
| Get output from a background agent |
| Stop a running background agent |
TeamCreate({
team_name: "my-project",
description: "Working on feature X"
})~/.claude/teams/<team-name>/~/.claude/tasks/<team-name>/TaskCreate({
team_name: "my-project",
title: "Implement security review",
description: "Audit auth module for vulnerabilities",
status: "pending"
})Agent tool with:
subagent_type: "agents-plugin:security-audit"
team_name: "my-project"
name: "security-reviewer"
prompt: "Join team my-project and work on security review task..."TaskUpdate({
team_name: "my-project",
task_id: "task-1",
owner: "security-reviewer",
status: "in_progress"
})| State | Meaning |
|---|---|
| Not yet started |
| Assigned and active (one at a time per teammate) |
| Finished successfully |
| Waiting on another task |
TaskListTaskList({ team_name: "my-project" })
→ Returns all tasks with status, owner, and blocked-by infoTaskUpdate({ team_name: "my-project", task_id: "N", owner: "my-name" })| Type | Use When |
|---|---|
| Direct message to a specific teammate |
| Critical team-wide announcement (use sparingly — expensive) |
| Ask a teammate to gracefully exit |
| Approve or reject a shutdown request |
| Approve or reject a teammate's plan |
SendMessage({
type: "message",
recipient: "security-reviewer", // Use NAME, not agent ID
content: "Please also check the payment module",
summary: "Adding payment module to scope"
})SendMessage({
type: "broadcast",
content: "Stop all work — critical blocker found in auth module",
summary: "Critical blocker: halt work"
})Read ~/.claude/teams/<team-name>/config.json
→ members array with name, agentId, agentTyperecipientin_progressTaskUpdateSendMessageSendMessageSendMessage({
type: "shutdown_request",
recipient: "security-reviewer",
content: "All tasks complete, wrapping up"
})SendMessage({
type: "shutdown_response",
request_id: "<id from shutdown_request JSON>",
approve: true
})TeamDelete()
→ Removes ~/.claude/teams/<name>/ and ~/.claude/tasks/<name>/TeamCreate: "code-review"
Tasks: security-audit, performance-review, correctness-check
Teammates: security-agent, performance-agent, correctness-agent (all parallel)
Lead: collects results, synthesizes findingsTeamCreate: "feature-impl"
Tasks: backend-api, frontend-ui, tests
Teammates: each spawned with isolation: "worktree"
Lead: delegates git push (sub-agents must not push independently in sandbox)blocked_by| Role | Behavior | When to Use |
|---|---|---|
| Lead | Orchestrates, assigns tasks, receives results | Always — coordinates the team |
| Teammate | Parallel execution with messaging | Ongoing collaboration, progress reporting |
| Subagent | Focused, isolated, returns single result | Simple bounded tasks, no coordination needed |
CLAUDE_CODE_REMOTE=truegit push| Context | Approach |
|---|---|
| Quick parallel review | Spawn 2–4 teammates, broadcast task assignments |
| Large codebase split | Assign directory subsets as separate tasks |
| Long-running work | Background teammates, poll via TaskList |
| Minimize API cost | Prefer |
| Fast shutdown | Send shutdown_request to each teammate, then TeamDelete |
TeamCreateTaskCreateteam_namenameTaskUpdateSendMessageSendMessage shutdown_requestTeamDelete| Path | Contents |
|---|---|
| Team members (name, agentId, agentType) |
| Shared task list directory |
| Mistake | Correct Approach |
|---|---|
| Using agentId as recipient | Use |
| Sending broadcast for every update | Use |
| Polling for messages | Messages delivered automatically — just wait |
| Sending JSON status messages | Use |
| Sub-agent pushes to remote | Delegate push to lead orchestrator |
| TeamDelete before shutdown | Shutdown all teammates first |
.claude/rules/agent-development.md.claude/rules/agentic-permissions.md.claude/rules/sandbox-guidance.md