Expand description
Task tool — Claude-Code Agent-equivalent for typed sub-agent delegation.
PMAT-CODE-SPAWN-PARITY-001: the Task tool mirrors Claude Code’s
Agent tool, which takes subagent_type + description + prompt
and returns the child’s final response. This is the 1:1 equivalent
for apr code and is default-registered (no capability gate) so
the agent can always delegate, matching Claude Code 1:1.
Distinct from SpawnTool:
SpawnToolis untyped — caller passes any manifest inline.TaskToolresolvessubagent_typeviaSubagentRegistryto a preset personality (system-prompt + narrow tool allowlist). This matches Claude’s pattern where each agent type has a fixed role.
Toyota Production System:
- Poka-Yoke: subagent_type must exist in the registry — an unknown type errors out before spawn, so typos can’t launch a misconfigured child.
- Jidoka: child
max_iterationsis clamped and recursion is bounded bymax_depth. - Muda: child shares parent’s driver + memory Arc, so no duplicate model load.
Structs§
- Subagent
Registry - Registry of subagent types available to
TaskTool. - Subagent
Spec - A pre-configured subagent personality resolved by
subagent_type. - Task
Tool - Task tool — Claude-Code-equivalent
Agent/Tasksub-agent dispatcher.
Functions§
- default_
registry - Default registry populated with the 3 canonical subagent types
(
general-purpose,explore,plan) — identical roster to Claude Code’s built-in agents. - register_
task_ tool - Register
TaskTool+Spawn { max_depth }capability in the given registry, unless the manifest already deniesSpawnexplicitly.