Core tools
AgentTool — spawning sub-agents
AgentTool (internal name: Task) is how Claude spawns a sub-agent. Each call starts a new Claude session with its own isolated context:
| Parameter | Description |
|---|---|
description | Short label for the task (shown in coordinator UI) |
subagent_type | Always "worker" for standard sub-agents |
prompt | The complete task instruction (workers cannot see the coordinator’s conversation) |
SendMessageTool.
SendMessageTool — continuing a running agent
SendMessageTool sends a follow-up message to a worker that has already completed a turn. Use it to give a worker a synthesized implementation spec after it finishes research, or to correct a failed attempt without spawning a fresh worker:
to field) comes from the task_id returned by AgentTool when the worker was spawned.
TaskCreateTool / TaskUpdateTool — task tracking
TaskCreateTool and TaskUpdateTool let the coordinator create and update structured task records that can be shared across agents. This provides a lightweight coordination layer for tracking progress on multi-file or multi-phase work.
TeamCreateTool / TeamDeleteTool — managing agent teams
TeamCreateTool creates a named team of agents that can share a communication channel. Use teams when you need multiple long-running workers to coordinate with each other, not just with the coordinator:
TeamDeleteTool tears down a team once its work is complete.
Coordinator mode
Coordinator mode is a special session configuration that gives Claude a tailored system prompt optimized for multi-agent orchestration. Enable it by setting theCLAUDE_CODE_COORDINATOR_MODE environment variable:
- Parallelize — launch independent research and implementation workers concurrently
- Synthesize — read worker findings and write specific, actionable follow-up prompts rather than delegating understanding
- Verify separately — use a dedicated verification worker with fresh context to prove changes work
- Report to the user — summarize progress after each batch of worker results
SkillTool.
Inter-agent communication
When a worker finishes a turn, the coordinator receives a<task-notification> message in the conversation:
task-id is the agent ID to use with SendMessageTool. The result field contains the worker’s final response.
Worktree isolation
When running parallel agents that modify files, use worktree mode to give each agent an isolated git working tree so their changes don’t conflict:EnterWorktreeTool / ExitWorktreeTool tools manage per-agent worktrees programmatically. In bridge mode, the worktree spawn mode creates a fresh git worktree for each incoming session automatically.
Configure worktree behavior in settings.json:
symlinkDirectories— symlink these directories from the main repo into each worktree to avoid duplicating large directoriessparsePaths— use git sparse checkout to only populate these paths in worktrees (significantly faster in large monorepos)
Example: parallel refactor
The following shows how a coordinator session structures a multi-agent refactor:Use cases
- Parallel test runs — run different test suites in separate agents simultaneously
- Large refactors — split file-by-file changes across agents (use worktrees to avoid conflicts)
- Multi-file changes — research in one agent, implement in parallel workers, verify in a separate agent
- Codebase exploration — fan out read-only research agents across different subsystems at once
- Iterative fixes — fix one agent’s failure with
SendMessageToolwhile other agents continue working
Related pages
Agent tools
Full reference for AgentTool, SendMessageTool, TeamCreateTool, and related tools.
Architecture
Understand how Claude Code’s tool and query engine work.
Headless mode
Run Claude Code non-interactively for automated pipelines.
Skills
Skills that workers can invoke during swarm execution.