Transcript of What are subagents?
Claude
0:03Sub-agents are specialized assistants0:05that Claude can delegate tasks to.0:10Each sub-agent runs in its own0:12conversation contacts window with a0:14custom system prompt that you define.0:17When finished, it returns a summary to0:19the main thread while all the0:21intermediate work stays isolated.0:24One of the main advantages of sub-agents0:26is that they help manage context window0:28usage.0:31When you chat with Claude Code, you're0:33adding context to the main context0:35window. Every tool call and its results0:37get stored in this main context window.0:40And so, when Claude uses a sub-agent, a0:43separate window starts. The sub-agent0:45receives two inputs, a custom system0:47prompt from your configuration file, and0:50a task description written by the parent0:52or parent agent based on what you ask0:55for.0:56The sub-agent then works autonomously.0:58When it reads files, edits files, or1:01uses tools, none of these will appear in1:03the main conversation. Just a summary is1:05returned back.1:07The entire sub-agent conversation then1:08gets completely discarded.1:13Consider a task like investigating how1:15the payment system works in an1:16unfamiliar code base.1:18Maybe you're trying to use Claude Code1:20to figure out which service handles1:22refunds.1:23Well, without a sub-agent, Claude might1:26read 15 files, run several searches, and1:29trace through multiple function calls.1:31All of that context fills your context1:34window, even if you only needed one1:37single fact, which service handles1:39refunds.1:40With a sub-agent, you get the answer1:43without the journey. The sub-agent1:45explores, discovers the answer, and1:47returns a focused summary, keeping your1:49main context clean.1:52But, the main window loses visibility1:54into how the sub-agent reaches its1:56conclusions and what it discovered along1:58the way.2:01Claude Code includes several built-in2:02sub-agents that you can use immediately,2:05like the general-purpose sub-agent, used2:08for multi-step tasks that require both2:09exploration and action. The explore2:12sub-agent, used for fast searching of2:14code bases.2:16The plan sub-agent, used during plan2:19mode for research and analysis of your2:21code base before presenting a plan.2:23And you can also create your own2:25sub-agents with custom system prompts2:27and tool access.2:30Sub-agents like Claude Code break work2:32into focused pieces, keep your main2:34context window clean, and bring back2:35just what you need, whether you're using2:37the built-in ones or creating your own.2:40They're a practical way to get more out2:42of longer Claude Code sessions.
391 words · 71 lines







