From ec23b8ea6ea8079547da9c6ddae8f592a4b288ac Mon Sep 17 00:00:00 2001 From: rUv Date: Sat, 7 Feb 2026 22:48:32 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: main - Timestamp: 2026-02-07T22:48:32Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 8ddc5b1801..291e2bb6bc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -526,6 +526,123 @@ const config = optimizer.getOptimalConfig(agentCount); ### Testing & Validation `tdd-london-swarm`, `production-validator` +## Agent Teams (Multi-Agent Coordination) + +Claude Code's experimental Agent Teams feature is fully integrated with Claude Flow for advanced multi-agent coordination. + +### Enabling Agent Teams + +Agent Teams is automatically enabled when you run `npx claude-flow@v3alpha init`. The following is added to `.claude/settings.json`: + +```json +{ + "env": { + "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" + }, + "claudeFlow": { + "agentTeams": { + "enabled": true, + "teammateMode": "auto", + "taskListEnabled": true, + "mailboxEnabled": true + } + } +} +``` + +### Agent Teams Components + +| Component | Tool | Purpose | +|-----------|------|---------| +| **Team Lead** | You (main Claude) | Coordinates teammates, assigns tasks, reviews results | +| **Teammates** | `Task` tool | Sub-agents spawned to work on specific tasks | +| **Task List** | `TaskCreate/TaskList/TaskUpdate` | Shared todo list visible to all team members | +| **Mailbox** | `SendMessage` | Inter-agent messaging for coordination | + +### Creating and Managing Teams + +```javascript +// Create a team +TeamCreate({ + team_name: "feature-dev", + description: "Building new feature", + agent_type: "coordinator" +}) + +// Create shared tasks +TaskCreate({ subject: "Design API", description: "...", activeForm: "Designing" }) +TaskCreate({ subject: "Implement endpoints", description: "...", activeForm: "Implementing" }) +TaskCreate({ subject: "Write tests", description: "...", activeForm: "Testing" }) + +// Spawn teammates (run in background for parallel work) +Task({ + prompt: "Design the API according to task #1...", + subagent_type: "system-architect", + team_name: "feature-dev", + name: "architect", + run_in_background: true +}) +Task({ + prompt: "Implement endpoints from task #2...", + subagent_type: "coder", + team_name: "feature-dev", + name: "developer", + run_in_background: true +}) +``` + +### Agent Teams Hooks + +| Hook | Trigger | Purpose | +|------|---------|---------| +| `TeammateIdle` | Teammate finishes turn | Auto-assign pending tasks to idle teammates | +| `TaskCompleted` | Task marked complete | Train patterns from successful work, notify lead | + +### Hook Commands + +```bash +# Handle idle teammate (auto-assigns available tasks) +npx claude-flow@v3alpha hooks teammate-idle --auto-assign true + +# Handle task completion (trains patterns, notifies lead) +npx claude-flow@v3alpha hooks task-completed -i task-123 --train-patterns true + +# Check on team progress +TaskList + +# Send message to teammate +SendMessage({ + type: "message", + recipient: "developer", + content: "Please prioritize the auth endpoint", + summary: "Prioritize auth" +}) + +# Shutdown teammate gracefully +SendMessage({ + type: "shutdown_request", + recipient: "developer", + content: "Work complete, shutting down" +}) +``` + +### Best Practices for Agent Teams + +1. **Spawn teammates in background**: Use `run_in_background: true` for parallel work +2. **Create tasks first**: Use TaskCreate before spawning teammates so they have work +3. **Use descriptive names**: Name teammates by role (architect, developer, tester) +4. **Don't poll status**: Wait for teammates to message back or complete +5. **Graceful shutdown**: Always send shutdown_request before TeamDelete +6. **Clean up**: Use TeamDelete after all teammates have shut down + +### Teammate Display Modes + +| Mode | Description | +|------|-------------| +| `auto` | Automatically selects best mode for environment | +| `in-process` | Teammates run in same process (default for CI/background) | +| `tmux` | Split-pane display in terminal (requires tmux) | + ## V3 Hooks System (17 Hooks + 12 Workers) ### Hook Categories