Claude Code guide in three levels, Beginner to Advanced: hands-on lessons with checked exercises, every volatile fact cited to its source. Independent community guide.
JavaScript agent-skillsagentic-codingai-agentsanthropicanthropic-claudebest-practicesclaudeclaude-aiclaude-codeclaude-code-guideclaude-code-hooksclaude-code-pluginsclaude-code-skillsclaude-code-tutorialclaude-code-workflowsguidelearn-claude-codemcpsubagentstutorial
docs: correct agent teams and restructure the parallelism story (#21)
Wesam Abousaidcdcffa851c58
diff --git a/README.md b/README.mdindex a8bb527..baa02a2 100644--- a/README.md+++ b/README.md@@ -54,7 +54,7 @@ The five extension points in Claude Code, side by side:**Productivity & frameworks** — [Effort levels](#effort-levels) · [Fast Mode](#fast-mode) · [Super Claude](#super-claude-framework) · [BMAD Method](#the-bmad-method--ai-agent-framework)-**Reference** — [Slash Command Cheatsheet](#built-in-slash-commands) · [Effort levels (full guide)](docs/reference/effort-levels.md) · [FAQ](#faq) · [Updates & Deprecations](#updates--deprecations) · [Further Reading](#references)+**Reference** — [Slash Command Cheatsheet](#built-in-slash-commands) · [Effort levels](docs/reference/effort-levels.md) · [Workflows](docs/workflows.md) · [Agent Teams](docs/agent-teams.md) · [Skills](docs/skills.md) · [FAQ](#faq) · [Updates & Deprecations](#updates--deprecations) · [Further Reading](#references)<!-- Compatibility anchors for old inbound links --><a id="sdlc"></a>@@ -480,15 +480,24 @@ Claude Code snapshots your hook configuration at session start and warns if hook---<a id="ai-agents"></a>-### Subagents+<a id="running-agents-in-parallel"></a>+### Subagents & running agents in parallel-Three building blocks for going beyond a single Claude session:+Claude Code has **four** ways to run agents at once. They're easy to confuse, so start here — the question that separates them is **who coordinates the work**:-| Building block | What it gives you | When to reach for it |+| Surface | Who coordinates | Reach for it when… ||---|---|---|-| **Git worktrees** | Multiple branches checked out simultaneously, each in its own folder + Claude session | You want to work on `feature-A` while Claude finishes `feature-B` |-| **General-purpose subagents** | Spawn isolated Claude sub-sessions from your main session for parallel sub-tasks | A task is large or context-heavy enough that the main session shouldn't carry it |-| **Specialized subagents** | Pre-written role prompts (security-reviewer, frontend-engineer, etc.) you drop into `.claude/agents/` | You want focused expertise without writing the role prompt yourself |+| **Subagents** *(below)* | Claude, turn by turn, inside one session | A side task would flood your main conversation with search results, logs, or file contents you'll never reference again |+| **Agent view** — `claude agents` *(research preview)* | **You** — hand off, check back later | You have several independent tasks and want to dispatch them, glance at status, and step in only when one needs you. Each dispatched session gets **its own worktree automatically** |+| **[Agent Teams](#agent-teams-experimental)** *(experimental)* | A lead agent supervising peer sessions | Workers need to **talk to each other** — share findings, challenge each other, self-claim from a shared task list |+| **[Dynamic Workflows](#dynamic-workflows)** | **A script**, not Claude's judgement | The job outgrows a handful of subagents, or you want findings cross-checked against each other: codebase-wide audits, 500-file migrations |++Two supporting tools that aren't a coordination style of their own:++- **[Git worktrees](#1-git-worktrees--parallel-branches-parallel-sessions)** — separate checkouts so parallel sessions never touch the same files.+- **`/batch`** — a bundled skill that researches the codebase, splits one large change into **5–30 independent units**, and spawns a background subagent per unit **in its own worktree, each opening a PR**. It's a packaged use of subagents + worktrees, and the fastest way to feel this whole category.++> 💡 **Checking on running work** depends on what you started: `/tasks` for anything backgrounded in the current session, `claude agents` for background sessions, `/workflows` for workflow runs. Note `/agents` (removed as a wizard in v2.1.198) is a different thing entirely from `claude agents`.#### 1. Git worktrees — parallel branches, parallel sessions@@ -582,104 +591,59 @@ export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 # add to ~/.zshrc to persistclaude```-#### How a team is structured+Or, more durably, in `settings.json`:-- **Team lead** *(your main session)* — assigns tasks, sets dependencies, reviews completed work.-- **Teammates** *(specialist sub-agents)* — focus on a single task each, update the shared list, can request help.-- **Shared task list** — single source of truth visible to everyone, tracks dependencies and status (pending / in progress / completed).--**Mechanics as of mid-2026:** each session has **one implicit team** — the old `TeamCreate`/`TeamDelete` tools were removed in v2.1.178, and teammates are spawned through the Agent tool's `name` parameter. Teammates display **in-process** by default; for split-pane views you need tmux or iTerm2 (`teammateMode: "iterm2"`, v2.1.186+).+```json+{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } }+```-#### Multi-agent collaboration patterns+#### The example that justifies the cost-**1. Parallel development** — three independent streams, three teammates, one team lead synthesizing.+Most "spawn N teammates" prompts would work just as well with subagents. This one wouldn't — it needs teammates to **talk to each other**:-```markdown-Task 1: frontend-engineer – Build login UI-Task 2: backend-engineer – Implement auth API-Task 3: qa-engineer – Write integration tests+```text+Users report the app exits after one message instead of staying connected.+Spawn 5 agent teammates to investigate different hypotheses. Have them talk to+each other to try to disprove each other's theories, like a scientific+debate. Update the findings doc with whatever consensus emerges.```-**2. Sequential pipeline** — one teammate's output feeds the next.+The debate structure *is* the mechanism. Sequential investigation anchors: once one theory gets explored, everything after is biased toward it. With independent investigators actively trying to disprove each other, the theory that survives is far more likely to be the real root cause.-```markdown-Task 1: backend-engineer – Create database schema- ↓ (blocks Task 2)-Task 2: backend-engineer – Implement CRUD endpoints- ↓ (blocks Task 3)-Task 3: frontend-engineer – Build admin dashboard-```+#### Staff a team with the role prompts you already have-**3. Code review workflow** — feature lands, multiple reviewers, then revision.+A teammate can be spawned **from a subagent definition** — so this repo's [`.claude/agents/`](.claude/agents) and [10 specialist prompts](#3-specialized-subagents--drop-in-role-prompts) work as teammates, not just as subagents:-```markdown-Task 1: feature-developer – Implement new feature- ↓ (completed)-Task 2: security-reviewer – Check for vulnerabilities-Task 3: perf-reviewer – Analyze optimization opportunities- ↓ (both complete)-Task 4: feature-developer – Address review feedback+```text+Spawn a teammate using the security-reviewer agent type to audit the auth module.```-**4. Research → implementation** — one analyst, multiple workers applying findings.+It honors that definition's `tools` allowlist and `model`, and the body is *appended* to the teammate's system prompt. (`skills` and `mcpServers` frontmatter is **not** applied to teammates.)-```markdown-Task 1: research-agent – Analyze existing codebase patterns- ↓ (generates recommendations)-Task 2: implementation team – Apply findings across modules- - Teammate A: auth module- - Teammate B: payment module- - Teammate C: notifications module-```+#### Three things that catch people out-#### Example: full feature implementation+- **Teammates don't inherit the lead's `/model`.** Set **Default teammate model** in `/config` (pick *Default (leader's model)* to follow the lead), or name the model per spawn. They *do* inherit the lead's effort level. Model and fast mode are fixed at spawn — `/model` and `/fast` only ever change the lead.+- **Teammates don't get the lead's conversation history.** They load `CLAUDE.md`, MCP servers, and skills like any session, but everything task-specific has to be in the spawn prompt.+- **No worktree isolation.** Unlike agent view, teams don't isolate teammates — two teammates editing one file is a straight overwrite. Partition the files yourself.-```markdown-Team lead: coordinate overall strategy.--Teammates:-- planner: requirements → technical spec-- backend-dev: API endpoints-- frontend-dev: UI components-- db-specialist: schema design + migration-- qa-engineer: unit + integration tests-- security-reviewer: security audit--Dependencies:-1. planner → spec (blocks all)-2. db-specialist → schema (blocks backend-dev)-3. backend-dev + frontend-dev in parallel-4. qa-engineer waits for implementation-5. security-reviewer waits for all code-```+#### Monitoring, and the naming trap-#### Best practices+Teammates appear in the **agent panel** below your prompt input: `↑`/`↓` to select, `Enter` to open a transcript and message that teammate directly, `Esc` to interrupt, `Ctrl+T` for the task list. An idle row that vanished is **hidden, not stopped** — it returns on the teammate's next turn.-| ✅ Do | ❌ Don't |-|---|---|-| Give teammates clear, focused, single-purpose tasks | Spawn more than 3–5 teammates per session |-| Use descriptive names (`frontend-specialist`, not `agent1`) | Assign vague or overlapping tasks |-| Set explicit task dependencies (`blockedBy`) | Skip dependencies — they prevent merge conflicts |-| Let teammates work in parallel when possible | Micromanage; trust the role prompt |-| Watch progress in the `claude agents` dashboard | Mix different project contexts in one team |+> ⚠️ `claude agents` opens **agent view**, a *different* surface for background sessions — not your team monitor. And subagents show up in the same agent panel as teammates, so seeing rows there doesn't prove a team actually formed.-#### Common issues+#### Best practices-| Issue | Fix |+| ✅ Do | ❌ Don't ||---|---|-| Teammates conflicting on the same files | Add explicit `blockedBy` dependencies |-| Team too slow | Reduce team size; increase parallelization |-| Tasks stuck | Check for circular dependencies |-| Context drift | Make task descriptions and teammate names more specific |--#### Limitations (it's experimental)--- Multiple agents consume more tokens — budget accordingly.-- Large teams add coordination overhead; 3–5 teammates is the sweet spot.-- One team per session, no nested teams, and the lead is fixed; in-process teammates can't be resumed after a restart.-- Deeper models make better leads — Opus 4.8 or Fable 5 as lead, Sonnet 5 teammates is a solid split.--> 📚 Authoritative reference: [code.claude.com/docs/en/agent-teams](https://code.claude.com/docs/en/agent-teams).+| Start with **3–5 teammates**, ~5–6 tasks each | Scale up before the work needs it — three focused beat five scattered |+| Give each teammate a distinct, non-overlapping slice of files | Let two teammates edit the same file |+| Put task specifics in the spawn prompt | Assume teammates saw your conversation |+| Name teammates descriptively so you can address them later | Use `agent1`, `agent2` |+| Start with **research and review** while learning | Start with parallel implementation |+| Gate "done" with a `TaskCompleted` hook (exit 2 blocks) | Let a teammate declare victory on a red test suite |++> 📚 **[Full guide in `docs/agent-teams.md` →](docs/agent-teams.md)** — display modes, plan approval, the mailbox architecture, permissions, hooks, troubleshooting, and the honest limitations list. Authoritative reference: [code.claude.com/docs/en/agent-teams](https://code.claude.com/docs/en/agent-teams).---diff --git a/docs/agent-teams.md b/docs/agent-teams.mdnew file mode 100644index 0000000..7e2397a--- /dev/null+++ b/docs/agent-teams.md@@ -0,0 +1,352 @@+# Agent Teams — The Complete Guide++*~15 min read · [← Back to README](../README.md#agent-teams-experimental)*++> ⚠️ **Experimental and disabled by default.** Without `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, no team is set up at session start, no team directories are written, and Claude will not spawn or propose teammates. There are real [limitations](#limitations) around session resumption, task coordination, and shutdown.++> **Mental model:** An agent team is **multiple full Claude Code sessions** coordinated by a lead, sharing a task list and a mailbox. The thing that separates it from subagents isn't parallelism — it's **communication**. Teammates message each other directly, and *you* can message any teammate directly without going through the lead.++---++## Contents++- [Teams vs subagents](#teams-vs-subagents)+- [Enable it](#enable-it)+- [Your first team](#your-first-team)+- [Reuse your existing agent definitions](#reuse-your-existing-agent-definitions)+- [Models and effort](#models-and-effort)+- [Display modes](#display-modes)+- [Talking to teammates](#talking-to-teammates)+- [Plan approval](#plan-approval)+- [The shared task list](#the-shared-task-list)+- [Quality gates with hooks](#quality-gates-with-hooks)+- [Architecture](#architecture)+- [Permissions](#permissions)+- [What teammates know](#what-teammates-know)+- [Two patterns that earn their cost](#two-patterns-that-earn-their-cost)+- [Best practices](#best-practices)+- [Troubleshooting](#troubleshooting)+- [Limitations](#limitations)++---++## Teams vs subagents++Both parallelize work. Pick based on **whether your workers need to talk to each other**:++| | Subagents | Agent teams |+|---|---|---|+| **Context** | Own context window; results return to the caller | Own context window; fully independent |+| **Communication** | Report back to the main agent only | Teammates message **each other** directly |+| **Coordination** | Main agent manages all work | Shared task list with self-coordination |+| **Best for** | Focused tasks where only the result matters | Work requiring discussion and disagreement |+| **Token cost** | Lower — results summarized back | Higher — each teammate is a separate Claude instance |++Teams add coordination overhead and use significantly more tokens. They work best when teammates can operate **independently**. For sequential work, same-file edits, or heavy dependency chains, a single session or [subagents](https://code.claude.com/docs/en/sub-agents) win. If the job is bigger than a handful of peers can coordinate, you probably want a [dynamic workflow](workflows.md) instead.++---++## Enable it++Either in your shell environment, or — the more durable option — in settings:++```json+{+ "env": {+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"+ }+}+```++```bash+export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 # or add to ~/.zshrc+```++---++## Your first team++Describe the task and the teammates you want in plain language. This example works because the three roles are genuinely independent — nobody waits on anybody:++```text+I'm designing a CLI tool that helps developers track TODO comments across+their codebase. Spawn three teammates to explore this from different angles:+one on UX, one on technical architecture, one playing devil's advocate.+```++Claude populates the shared task list, spawns a teammate per perspective, and synthesizes findings at the end.++> ⚠️ **Claude may quietly use subagents instead.** Subagents appear in the *same* agent panel as teammates, so the panel alone doesn't prove a team formed. If you got subagents, ask again and explicitly request an agent team.++Teammates are listed in the **agent panel** below your prompt input:++| Key | Action |+|---|---|+| `↑` / `↓` | Select a teammate |+| `Enter` | Open its transcript and message it directly |+| `Esc` | Interrupt the selected teammate's current turn |+| `x` | Stop the selected teammate |+| `Ctrl+T` | Toggle the task list |++**Idle rows hide — they aren't dead.** Once every agent in the panel is idle, idle rows disappear after 30 seconds and return on the teammate's next turn; the teammate stays running and addressable the whole time (v2.1.199+). When more than three are idle, the surplus collapses into a single `N idle agents` row — `Enter` expands it.++---++## Reuse your existing agent definitions++This is the highest-leverage thing most people miss: a teammate can be spawned **from a subagent definition** you already have — project, user, plugin, or CLI-defined.++```text+Spawn a teammate using the security-reviewer agent type to audit the auth module.+```++The teammate honors that definition's `tools` allowlist and `model`, and the definition's body is **appended** to the teammate's system prompt rather than replacing it. Team coordination tools (`SendMessage`, task management) stay available even when `tools` restricts everything else.++So the role prompts in [`.claude/agents/`](../.claude/agents) and [`specialized-agents/`](../specialized-agents) work in both directions — delegate to them as subagents, or staff a team with them. Define the role once.++> ⚠️ The `skills` and `mcpServers` frontmatter fields are **not applied** when a definition runs as a teammate. Teammates load skills and MCP servers from your project and user settings, like a regular session.++---++## Models and effort++**Teammates do not inherit the lead's `/model` selection by default.** This trips up the common "deep lead, cheap teammates" plan, because you may already be getting something other than what you assumed.++- Set **Default teammate model** in `/config`. Choose **Default (leader's model)** to have teammates follow the lead.+- Or specify per spawn: `Spawn 4 teammates to refactor these modules in parallel. Use Sonnet for each teammate.`+- Teammates **do** inherit the lead's [effort level](reference/effort-levels.md) (v2.1.186+ in split-pane mode).++A teammate's model and fast mode are **fixed at spawn**, so `/model` and `/fast` only ever change the lead — even while you're viewing a teammate (v2.1.199 shows a notice saying so). `/effort` does apply to the viewed teammate's later turns.++---++## Display modes++| Mode | What you get | Requires |+|---|---|---|+| **`in-process`** *(default)* | All teammates in your main terminal, navigated with the agent panel | Nothing |+| **Split panes** | One pane per teammate, all output visible at once, click to interact | tmux **or** iTerm2 + [`it2`](https://github.com/mkusaka/it2) |++```json+{ "teammateMode": "auto" }+```++```bash+claude --teammate-mode auto # single session; experimental, not in --help+```++- `"auto"` — split panes when you're already inside tmux, or on iTerm2 with `it2` installed; falls back to in-process.+- `"tmux"` — split panes, auto-detecting tmux vs iTerm2.+- `"iterm2"` — iTerm2 native panes explicitly (v2.1.186+); needs `it2` plus **iTerm2 → Settings → General → Magic → Enable Python API**.++> ℹ️ The default changed from `"auto"` to `"in-process"` in v2.1.179 — upgraded sessions that used to open split panes now stay in one terminal unless you set the mode.+>+> ⚠️ Split panes are **not supported** in VS Code's integrated terminal, Windows Terminal, or Ghostty. `tmux` works best on macOS; `tmux -CC` in iTerm2 is the suggested entrypoint.++---++## Talking to teammates++Each teammate is a full, independent Claude Code session, so you can redirect one mid-flight instead of restarting the whole team.++- **In-process:** select it in the agent panel, press `Enter`, type.+- **Split panes:** click into its pane.++While you're viewing a teammate, plain text and [skills](skills.md) go to *that teammate* — but built-in commands still run in the lead's session.++**Shutting one down** — refer to it by name. The lead sends a shutdown request; the teammate can approve and exit gracefully, or reject with an explanation.++```text+Ask the researcher teammate to shut down+```++Names matter: the lead assigns every teammate a name at spawn, and any teammate can message any other by that name. **Tell the lead what to call each teammate** in your spawn instruction so you have predictable handles later.++---++## Plan approval++For risky work, make a teammate plan before it touches anything. The teammate stays in read-only plan mode until the lead approves.++```text+Spawn an architect teammate to refactor the authentication module.+Require plan approval before they make any changes.+```++Rejected plans send feedback back; the teammate revises in plan mode and resubmits. **The lead approves autonomously** — it does not ask you. To influence it, give it criteria up front: *"only approve plans that include test coverage"*, *"reject plans that modify the database schema."*++---++## The shared task list++Tasks have three states — **pending**, **in progress**, **completed** — and can depend on other tasks. A pending task with unresolved dependencies can't be claimed until they complete, and dependents unblock automatically.++- **Lead assigns:** tell the lead which task goes to which teammate.+- **Self-claim:** after finishing, a teammate picks up the next unassigned, unblocked task itself.++Claiming uses **file locking**, so two teammates racing for the same task isn't a problem.++---++## Quality gates with hooks++Three [hook](../README.md#hooks) events make team rules enforceable rather than advisory. **Exit code 2 blocks** in all three:++| Hook | Fires when | Exit 2 |+|---|---|---|+| `TeammateIdle` | A teammate is about to go idle | Sends feedback and **keeps it working** |+| `TaskCreated` | A task is being created | Prevents creation, sends feedback |+| `TaskCompleted` | A task is being marked complete | Prevents completion, sends feedback |++`TaskCompleted` + exit 2 is the practical one: gate "done" on your test suite actually passing, so a teammate can't declare victory on red.++> ℹ️ The `team_name` field in these payloads carries a session-derived name and is **deprecated** since v2.1.178.++---++## Architecture++| Component | Role |+|---|---|+| **Team lead** | Your main session — spawns teammates, coordinates, synthesizes |+| **Teammates** | Separate Claude Code instances, one task at a time |+| **Task list** | Shared work items teammates claim and complete |+| **Mailbox** | Message passing between agents |++Teams are stored locally under a session-derived name — `session-` plus the first eight characters of the session ID:++| Path | Lifetime |+|---|---|+| `~/.claude/teams/{team-name}/config.json` | Removed when the session ends |+| `~/.claude/teams/{team-name}/inboxes/{agent-name}.json` | Per-agent mailbox |+| `~/.claude/tasks/{team-name}/` | **Persists** locally, never uploaded — resumed sessions keep their tasks. Retention follows `cleanupPeriodDays` |++> ⚠️ **Don't hand-edit or pre-author the team config.** It holds runtime state (session IDs, tmux pane IDs) and your changes are overwritten on the next state update. There is no project-level equivalent — a `.claude/teams/teams.json` in your project is just an ordinary file, not configuration. To define reusable roles, [use subagent definitions](#reuse-your-existing-agent-definitions).++Teammates *can* read `config.json` to discover each other: its `members` array holds each name and agent ID, with the lead always carrying agent type `team-lead`.++Mailbox entries are validated on read — malformed ones are reported and removed while valid messages still deliver. (Before v2.1.207 a single bad entry error-looped every second and blocked that mailbox until you deleted the file.)++---++## Permissions++- Teammates **start with the lead's permission settings**. If the lead runs `--dangerously-skip-permissions`, so does every teammate. You can change individual modes after spawning, but not per-teammate at spawn time.+- **Teammate permission prompts surface in the lead session** — approve them there yourself.+- A teammate **cannot consent on your behalf.** When one agent messages another via `SendMessage`, the receiver is told it came from another Claude session, not from you. A teammate denied an action can't relay it through a peer to get around the check, and in [auto mode](https://code.claude.com/docs/en/permission-modes) the classifier treats a relayed approval claim as untrusted input.+- [Plan approval](#plan-approval) is the deliberate exception: the lead grants those without prompting you.++---++## What teammates know++On spawn, a teammate loads the same project context as a regular session — `CLAUDE.md`, MCP servers, skills — plus the lead's spawn prompt.++**It does not get the lead's conversation history.** That's the single most common cause of a teammate doing the wrong thing. Put the specifics in the spawn prompt:++```text+Spawn a security reviewer teammate with the prompt: "Review the authentication+module at src/auth/ for security vulnerabilities. Focus on token handling,+session management, and input validation. The app uses JWT tokens stored in+httpOnly cookies. Report any issues with severity ratings."+```++How information moves after that: messages deliver **automatically** (the lead doesn't poll), a finishing teammate notifies the lead on going idle, and everyone sees task status. As of v2.1.198 a teammate whose turn dies on an API error reports the failure with the error text instead of appearing to finish normally. To reach everyone, send one message per recipient.++---++## Two patterns that earn their cost++### Parallel code review with distinct lenses++A single reviewer gravitates toward one class of issue at a time. Assign each teammate a different filter so they don't overlap:++```text+Spawn three teammates to review PR #142:+- One focused on security implications+- One checking performance impact+- One validating test coverage+Have them each review and report findings.+```++### Competing hypotheses — the scientific debate++This is the pattern that justifies teams over subagents, because it needs **inter-agent communication**:++```text+Users report the app exits after one message instead of staying connected.+Spawn 5 agent teammates to investigate different hypotheses. Have them talk to+each other to try to disprove each other's theories, like a scientific+debate. Update the findings doc with whatever consensus emerges.+```++The debate structure *is* the mechanism. Sequential investigation suffers from anchoring: once one theory gets explored, everything after it is biased toward that theory. With independent investigators actively trying to disprove each other, the surviving theory is far more likely to be the real root cause.++---++## Best practices++| ✅ Do | ❌ Don't |+|---|---|+| Start with **3–5 teammates** — the range that balances parallelism against coordination | Scale up before the work genuinely benefits; three focused teammates beat five scattered ones |+| Aim for **5–6 tasks per teammate** so nobody idles and the lead can reassign | Size tasks so large that teammates run for ages without a check-in |+| Give each teammate a **distinct, non-overlapping** slice | Let two teammates edit the same file — teams get no worktree isolation, so it's a straight overwrite |+| Put task specifics in the **spawn prompt** | Assume teammates saw your conversation — they didn't |+| Use **descriptive names** you can reference later | Use `agent1`, `agent2` |+| **Start with research and review** while learning | Start with parallel implementation |+| Pre-approve common operations in permission settings | Let teammate prompts pile up in the lead session |+| Check in, redirect, and synthesize as findings arrive | Leave a team running unattended for long stretches |++Two prompts worth keeping handy:++```text+Wait for your teammates to complete their tasks before proceeding+```++Use it when the lead starts implementing instead of delegating. And when the lead calls it done prematurely, just tell it to keep going.++---++## Troubleshooting++| Symptom | Fix |+|---|---|+| **Teammates never appear** | Check the agent panel below the input (`↑`/`↓`, then Enter). A vanished row is *hidden*, not stopped — message it by name to bring it back. Confirm the task was complex enough to warrant a team; ask explicitly for one |+| **Split panes don't open** | `which tmux`. For iTerm2, verify `it2` is installed and the Python API is enabled |+| **Too many permission prompts** | Pre-approve common operations in [permission settings](https://code.claude.com/docs/en/permissions) *before* spawning |+| **A teammate stopped on an error** | Open its transcript, then either give it new instructions or spawn a replacement. As of v2.1.198, messaging a teammate that's waiting to retry a failed API request wakes it to retry immediately |+| **A task looks stuck** | Task status can lag. Check whether the work is actually done, then update the status manually or tell the lead to nudge the teammate |+| **Lead quits before work is done** | Tell it to keep going |+| **Orphaned tmux session** | `tmux ls` then `tmux kill-session -t <name>` |++---++## Limitations++The honest list, as of v2.1.178+:++- **No session resumption with in-process teammates.** `/resume` and `/rewind` don't restore them; the lead may try to message teammates that no longer exist. Tell it to spawn new ones.+- **Task status can lag** — teammates sometimes fail to mark tasks complete, which blocks dependents.+- **Shutdown can be slow** — teammates finish the current request or tool call first.+- **One team per session.** No additional named teams, no sharing a team across sessions.+- **No nested teams.** Teammates can't spawn teammates; only the lead manages the team.+- **No background subagents from in-process teammates** — a teammate's background work can't outlive the lead's process, so `run_in_background` (or a definition with `background: true`) errors.+- **Lead is fixed.** You can't promote a teammate or transfer leadership.+- **Permissions are set at spawn.** Change individual modes afterward, but not per-teammate up front.+- **No worktree isolation.** Unlike agent view, teams don't isolate teammates in worktrees — [partition the files yourself](#best-practices).++> 💡 `CLAUDE.md` works normally: teammates read it from their working directory. It's the cleanest way to give every teammate the same project rules.++---++## See also++- [Official agent teams docs](https://code.claude.com/docs/en/agent-teams) — authoritative reference+- [Run agents in parallel](https://code.claude.com/docs/en/agents) — subagents vs agent view vs teams vs workflows+- [Dynamic Workflows](workflows.md) — when the job outgrows a handful of peers+- [Subagents](../README.md#ai-agents) — the lighter primitive, and this repo's 10 role prompts+- [Agent team token costs](https://code.claude.com/docs/en/costs#agent-team-token-costs)++---++[← Back to README](../README.md#agent-teams-experimental) · [Dynamic Workflows](workflows.md) · [Skills](skills.md)diff --git a/docs/workflows.md b/docs/workflows.mdindex a329618..61ef63a 100644--- a/docs/workflows.md+++ b/docs/workflows.md@@ -293,10 +293,10 @@ Three phrases that reliably improve the script Claude writes:- [Official workflows docs](https://code.claude.com/docs/en/workflows) — authoritative reference- [Run agents in parallel](https://code.claude.com/docs/en/agents) — subagents vs agent view vs teams vs workflows-- [Agent Teams](../README.md#agent-teams-experimental) — the other multi-agent surface, and when to pick it instead+- [Agent Teams guide](agent-teams.md) — the other multi-agent surface, and when to pick it instead- [Effort levels](reference/effort-levels.md) — what `ultracode` changes- [Slash commands](reference/commands.md) — `/workflows`, `/deep-research`, `/batch`----[← Back to README](../README.md#dynamic-workflows) · [Skills](skills.md) · [Effort levels](reference/effort-levels.md)+[← Back to README](../README.md#dynamic-workflows) · [Agent Teams](agent-teams.md) · [Skills](skills.md)