16. Deep Read: AgentTool
What AgentTool Represents
AgentTool is where the product stops being “one model with tools” and starts becoming a multi-worker system. The file contains schemas for agent launching, background behavior, isolation modes, agent naming, team wiring, and remote execution variants.
What This Tells You About the Product
- Subagents are not hacks. They have explicit input and output contracts.
- Background execution is a product feature, not a side effect.
- Worktree and remote isolation are first-class execution modes.
- Agent orchestration is integrated with session storage, progress tracking, and UI rendering.
Why This Is Useful for Learning
Even if you never build a full multi-agent system, this file teaches how to structure delegated work as a typed task interface instead of letting one loop recursively improvise. It is an architecture lesson in delegation boundaries.
Source Navigation
Recommended Source Files
source/tools/AgentTool/AgentTool.tsxsource/tools/AgentTool/runAgent.tssource/tools/AgentTool/agentToolUtils.tssource/tools/AgentTool/forkSubagent.tssource/tools/AgentTool/loadAgentsDir.ts
Next Files to Read
source/services/tools/toolOrchestration.tssource/services/AgentSummary/agentSummary.tssource/services/mcp/client.ts