Claude Code Subagents: Keep Your Context Clean — Transcript
Full transcript
- 0:00What if Claude could hand off work to a
- 0:02helper without cluttering your
- 0:04conversation? That's what sub-agents do.
- 0:10Here's the problem. Every file Claude
- 0:13reads, every search result, and every
- 0:15long test log fills your conversation's
- 0:18context. The more clutter, the less room
- 0:21for the work that matters.
- 0:30A sub-agent is a specialized AI
- 0:32assistant with its own context window,
- 0:35its own system prompt, and its own tools
- 0:38and permissions. Claude hands it a task,
- 0:41it works independently, and only a
- 0:44summary comes back.
- 0:50Claude Code already includes built-in
- 0:52sub-agents. Explore is a fast, read-only
- 0:56agent for searching your code base. Plan
- 0:59researches during plan mode, and
- 1:01general-purpose handles complex,
- 1:03multi-step tasks.
- 1:10Sub-agents help you preserve context,
- 1:12enforce limits on tools, specialize
- 1:15behavior, and control costs by routing
- 1:18simple tasks to faster models.
- 1:26Let's build one for our bookstore API, a
- 1:29code reviewer. The easiest way is to
- 1:32just ask Claude to create it and say
- 1:34where to save it.
- 1:44Claude writes a markdown file with front
- 1:46matter, a name, a description that tells
- 1:49Claude when to delegate, a tools list
- 1:52with no edit or write, so it's
- 1:54read-only, and a model. The body is its
- 1:57system prompt, what to check and how to
- 2:00report.
- 2:08Now, I ask Claude to use the code
- 2:10reviewer on my changes. It runs in its
- 2:13own context, reads the diff in the
- 2:15files, and returns a short, prioritized
- 2:19report. My main conversation only gets
- 2:22the summary.
- 2:32There are three ways to call a sub
- 2:34agent. Name it in your prompt, at
- 2:36mention it to guarantee it runs, or
- 2:39start a whole session as that agent with
- 2:41{dash} {dash} agent.
- 2:50Example two, noisy test runs. Ask Claude
- 2:54to use a sub agent to run the tests and
- 2:56report only failures. Hundreds of log
- 2:59lines stay in the sub agent. Your
- 3:01conversation gets one clear line.
- 3:12You can also run independent research in
- 3:14parallel or chain sub agents. A reviewer
- 3:18finds issues, then another fixes them.
- 3:21Just remember, each sub agent uses
- 3:23tokens, and its results come back to
- 3:26your conversation.
- 3:30To keep sub agents focused, restrict
- 3:32their tools and pick a model. A simple
- 3:35research agent can run on Haiku to save
- 3:38cost.
- 3:44Project sub agents live in {dot} Claude
- 3:46{slash} agents, so commit them for your
- 3:49team.
- 3:50Personal ones go in your home folder's
- 3:52{dot} Claude {slash} agents.
- 3:58When should you use one? Use a sub agent
- 4:00for noisy, self-contained work with
- 4:03clear limits. Stay in the main
- 4:05conversation for back-and-forth work and
- 4:08quick changes.
- 4:16Best practices: one job per sub agent, a
- 4:19description that clearly says when to
- 4:21use it, and only the tools it needs.
- 4:30Recap: Claude.md for facts, skills for
- 4:34procedures, hooks for guarantees, and
- 4:36sub agents for focused work in a
- 4:38separate context.
- 4:40Next episode: MCP, connecting Claude
- 4:43code to your tools and data.
- 4:50If this helped, hit like, share it with
- 4:52your team, and subscribe.
About this transcript
This page contains the full transcript of Claude Code Subagents: Keep Your Context Clean by AgentCodeAcademy, generated from the public captions YouTube serves with the video. The transcript has 486 words across 82 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.