Skip to content

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_use blocks now emit "Agent", but "Task" still appears in the system:init tools list and in result.permission_denials[].tool_namecheck both.
  • Include Agent in allowedTools to auto-approve subagent invocation without a permission prompt.
  • Subagent messages carry parent_tool_use_id.
  • Input channel = subagent_type + a single prompt string (the only parent→child channel).
  • run_in_background defaults 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, allowedTools scopes access, and the Task/Agent naming split across surfaces.

Common gotchas

  • After the rename you must still look for "Task" in system:init and permission denials — searching only for "Agent" misses it.
  • run_in_background defaulting to true means you must set it false when you need the result inline.

See also

Sources