Multi-agent features require agent swarms to be enabled. See Agent swarms for configuration and usage patterns.
AgentTool
Spawns a sub-agent — a new, isolated Claude session — to handle a complex multi-step task. The sub-agent has its own tool access, context window, and permission scope.When to use
UseAgentTool when a task requires multiple independent units of work that can run in parallel, or when a task is complex enough to benefit from isolated context. Common examples:
- Running tests and fixing failures across many files simultaneously.
- Performing a large-scale refactor on different parts of the codebase in parallel.
- Delegating research tasks to a sub-agent while the parent continues other work.
Parameters
The task description for the sub-agent to perform. Be specific — the sub-agent starts with a fresh context window and only knows what you tell it here.
A short (3–5 word) label for the task, shown in the UI while the agent runs.
The type of specialized agent to use. If omitted, a general-purpose agent is used. Custom agent types are defined in the
agents/ directory.Model override for this agent:
"sonnet", "opus", or "haiku". Overrides the agent definition’s model setting. If omitted, inherits from the parent session.When
true, the agent runs in the background and the parent session continues immediately. You are notified when the agent completes. Defaults to false.A name for this agent, making it addressable by
SendMessageTool via { "to": "<name>" } while it is running.Isolation mode:
"worktree"— creates a temporary git worktree so the agent works on an isolated copy of the repository.
Absolute path to run the agent in. Overrides the working directory for all filesystem and shell operations in this agent. Cannot be used together with
isolation: "worktree".How sub-agents work
WhenAgentTool runs, it:
- Creates a new Claude session with a fresh system prompt and context.
- Gives the sub-agent access to the same tools as the parent, subject to its own permission scope.
- Runs the sub-agent’s tool loop until it produces a final answer.
- Returns the sub-agent’s result to the parent session as a tool result.
prompt. If the sub-agent needs file content, it should read those files itself.
Example: parallel task delegation
SkillTool
Executes a named skill — a reusable workflow defined as a slash command. Skills are markdown prompts stored in theskills/ directory (or loaded from an MCP server) that encode standard procedures like committing code, reviewing a PR, or generating documentation.
Parameters
The skill name, e.g.
"commit", "review-pr", or "pdf". Leading slashes are stripped automatically for compatibility.Optional arguments passed to the skill. How arguments are used depends on the skill definition.
How skills are executed
Skills can run in two modes:- Inline (default) — The skill’s prompt is injected directly into the current conversation context. The current agent processes the skill’s instructions without spawning a new session.
- Forked — If the skill’s frontmatter specifies
context: fork, the skill runs in an isolated sub-agent with its own token budget. The result is returned as a tool result.
Example
Task tools
Task tools create and manage tasks in a shared task list. In multi-agent sessions, tasks are the primary mechanism for coordinating work — agents create tasks, pick them up, and mark them complete.Task lifecycle
TaskCreateTool
TaskCreateTool
Creates a new task in the shared task list and returns the task ID.Parameters:
subject(string, required) — A brief title for the task.description(string, required) — What needs to be done.activeForm(string) — Present-continuous label shown in the spinner when the task is in progress, e.g."Running tests".metadata(object) — Arbitrary key-value metadata to attach to the task.
TaskUpdateTool
TaskUpdateTool
Updates an existing task’s status, owner, metadata, or blocking relationships.Parameters:
taskId(string, required) — The ID of the task to update.status(string) — New status:"pending","in_progress","completed", or"deleted".subject(string) — New subject.description(string) — New description.owner(string) — The agent name that owns this task.addBlocks(string[]) — Task IDs that this task blocks.addBlockedBy(string[]) — Task IDs that block this task.metadata(object) — Metadata keys to merge in. Set a key tonullto delete it.
TaskGetTool
TaskGetTool
Retrieves a single task by ID, including its current status, owner, and metadata.
TaskListTool
TaskListTool
Lists all tasks in the current task list. Returns subject, status, owner, and blocking relationships for each task.
TaskStopTool
TaskStopTool
Stops a running agent task. The task moves to a stopped state and can be resumed later with
SendMessageTool.TaskOutputTool
TaskOutputTool
Reads the output file produced by a completed background agent task. Background agents write their results to disk — this tool retrieves that content.
SendMessageTool
Sends a message to another agent in the current swarm. Messages are delivered to the recipient’s mailbox and processed at the recipient’s next tool round.Parameters
The recipient. Options:
- A teammate name, e.g.
"alice"or"worker-1". "*"to broadcast to all teammates in the current team.
The message content. Either a plain text string or a structured message object for protocol messages (shutdown request/response, plan approval).
A 5–10 word preview shown in the UI. Required when
message is a plain text string.Example
Team tools
Team tools create and manage teams of parallel agents.TeamCreateTool
TeamCreateTool
Creates a named team and registers the current session as the team lead.Parameters:
team_name(string, required) — Name for the team.description(string) — Team description or purpose.agent_type(string) — Role of the team lead, e.g."researcher"or"orchestrator".
TeamDeleteTool before creating a new team.TeamDeleteTool
TeamDeleteTool
Deletes the current team and cleans up its resources (team file, task list directory).
Plan mode tools
EnterPlanModeTool
EnterPlanModeTool
Switches the session to plan mode. In plan mode, Claude proposes changes and tool calls but does not execute them until you approve. Useful for reviewing a complex plan before committing to it.
ExitPlanModeTool
ExitPlanModeTool
Exits plan mode and resumes normal execution. Claude will begin executing the approved plan.
Worktree tools
EnterWorktreeTool
EnterWorktreeTool
Creates a temporary git worktree and switches the session’s working directory to it. The worktree is an isolated copy of the repository, so changes made by the agent do not affect the main working tree until they are merged.This is the same isolation mechanism used by
AgentTool when isolation: "worktree" is specified.ExitWorktreeTool
ExitWorktreeTool
Exits the current git worktree and returns the session to the original working directory. The worktree is removed from disk.