# Teammate

## Definition

A Teammate is a collaborative agent in Claude Code Agent Team mode. When the main agent creates a team via `TeamCreate` and spawns teammates using the `Agent` tool, each teammate runs as an independent agent process with its own context window and toolset, communicating with team members through `SendMessage`.

## Differences from SubAgent

| Feature | Teammate | SubAgent |
|---------|----------|----------|
| Lifecycle | Persistent, can receive multiple messages | One-off task, destroyed upon completion |
| Communication | SendMessage bidirectional messaging | Parent→child unidirectional call, returns result |
| Context | Independent full context, retained across turns | Isolated task context |
| Collaboration | Team collaboration, can communicate with each other | Hierarchical structure, only interacts with parent agent |
| Task Type | Complex multi-step tasks | Single tasks such as search and exploration |

## Behavior

- Created by the main agent (team lead) via the `Agent` tool and assigned a `team_name`
- Shares task lists through `TaskList` / `TaskGet` / `TaskUpdate`
- Enters idle state after each turn, waiting to be woken by a new message
- Can be gracefully terminated via `shutdown_request`

## Stats Panel Description

The Teammate stats panel displays the number of API calls for each teammate. The `Name` column shows the teammate's name (e.g., `reviewer-security`, `reviewer-pipeline`), and the `Count` column shows the total number of API requests generated by that teammate.
