Task and Agent tool ⚠ verify
Definition
The tool that spawns subagents in Claude Code / the Agent SDK — historically Task, renamed to Agent in Claude Code v2.1.63 — with allowedTools scoping what a subagent may access.
Key points
- Task→Agent rename (v2.1.63):
tool_useblocks now emit"Agent", but"Task"still appears in thesystem:inittools list and inresult.permission_denials[].tool_name— check both. - Include
AgentinallowedToolsto auto-approve subagent invocation without a permission prompt. - Subagent messages carry
parent_tool_use_id. - Input channel =
subagent_type+ a singlepromptstring (the only parent→child channel). run_in_backgrounddefaults true (v2.1.198+); set false when the result is needed before continuing. ⚠ verify (2026-07-08).- Built-in tools (exact names):
Read,Write,Edit,Bash,Monitor,Glob,Grep,WebSearch,WebFetch,AskUserQuestion. - Subagent identity/behavior comes from an AgentDefinition; orchestration pattern is Hub-and-spoke orchestration.
Why it matters for the exam
- D1 tests knowing Task spawns subagents,
allowedToolsscopes access, and the Task/Agent naming split across surfaces.
Common gotchas
- After the rename you must still look for
"Task"insystem:initand permission denials — searching only for"Agent"misses it. run_in_backgrounddefaulting to true means you must set it false when you need the result inline.
See also
Sources
Referenced by
- AgentDefinition
- Agentic Architecture & Orchestration
- Agentic loop
- agentic-01
- Built-in Tools
- Claude Code Configuration & Workflows
- Filesystem Subagents (.claude Agents)
- Hub-and-spoke orchestration
- Subagent decision criteria
- Subagent Error Handling
- Task decomposition (chaining vs adaptive)
- Tool execution types (client vs server)
- Workflow tool
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.