Sub-Agents in Claude Code – Context, Delegation, and Focus By the end of this lesson, students should be able to: How sub-agents are spawned. Sub-agents in Claude Code are spawned within Cowork/Agent mode. The parent agent spawns a sub-agent by providing it with a task description and relevant context. The sub-agent runs as a separate agent instance and returns results when complete. Verify current sub-agent spawn syntax and configuration at docs.anthropic.com/en/docs/claude-code. Context transfer – what to give the sub-agent. A sub-agent starts with a fresh context window. It does not inherit the parent's conversation history – it starts with only what you explicitly give it. Transfer: Do NOT transfer the entire parent conversation history – that defeats the purpose of a focused context window. Transfer only what this sub-agent needs for its specific task. Task description quality for sub-agents. Sub-agent task descriptions follow the same quality rules as Cowork mode tasks: What sub-agents inherit. Sub-agents in Claude Code inherit: the CLAUDE.md context for the project directory, available Skills, and the MCP servers configured for the project. They do NOT inherit: the parent's conversation history, intermediate findings, or decisions made during the parent session. Enroll to continue this lesson. The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.
Lesson 2: Spawning and Configuring Sub-Agents
Lesson Objectives
Lesson Content
src/db/")src/db/ – do not modify any files")
