🧩AgentDefinition
Also known as agents option, Agent SDK subagents, Claude Agent SDK AgentDefinition
The type for a subagent you set up in code. It has a description, its own prompt and its tools.
Think of it like
It is like a job card for a helper you send on a side task.
Example
Mia's agent writes code, then hands it to a reviewer subagent with read-only tools. The reviewer's notes come back as a tool result.
Why it matters
Definition
Example code
typescript
agents: {
reviewer: {
description: "Reviews code for bugs",
prompt: "You are a careful code reviewer.",
tools: ["Read", "Grep"],
},
}Common mistake
Key takeaways
- 1description and prompt. Required.
- 2Own tools and model. Optional.
- 3Started by the Agent tool. Keep it in the session.