Claude Code Sub Agents Tutorial
Sub agents are amazing and you should learn how to use them.
Even if you don’t use Claude Code.
Why? Because — like many things from Anthropic — sub agents are an emerging pattern that you will see a lot of in the coming years.
Check out the video on YouTube
1:00 - Benefits of Claude Code Sub Agents
2:12 - Sub Agents Demo
2:56 - Creating Your First Sub Agent
6:31 - Building a Feature with Sub Agents
12:10 - The Context Problem with Sub Agents
13:27 - Manually Editing Sub Agents
14:46 - Test Runner + SWE Sub Agent Demo
17:27 - Running the Unit Converter MCP Feature
19:20 - Release Helper Sub Agent
22:52 - Releasing a Version Upgrade of my PyPI Package
Course Update: Added 200+ images
I’ve added ~250 images to my AI Engineer Roadmap course.
These figures compliment the various concept maps and code examples through out.
These took me a very very long time to create, and I’ll be increasing the price of the course later in August.
Here’s one particularly nice set of plots from the optimization lesson:
Topics from this week’s video
Sub Agents in Claude Code
Introduction to Sub Agents and their purpose
Pre-configured AI personalities that can delegate tasks
Benefits include:
Context preservation via isolated contexts for each subagent
Reusability as shareable, text-based configurations
Flexible permissions for scoped access based on least privilege principle
Demonstration Use Case: MCP Server Unit Converter
Creating Sub Agents
Product Manager Agent
Read-only access
Helps ideate and prioritize features
Software Engineer Agent
Full tool access
Builds out features like batch conversion
Test Runner Agent
Executes tests following project-specific instructions
Initial issues with using proper commands (e.g.,
uv run pytest
)
Testing the Sub Agent System
Persistent subagents stored in local project directory
Feature ideation and implementation process
Iterative refinement of subagent system prompts
Troubleshooting & Improvement
Addressing test context hand-off issues between subagents
Improving test accuracy and reliability
Identifying inefficiencies in agent interactions
Successful Sub Agent Collaboration
Achieved working batch conversion feature
Creating a Release Manager Sub Agent
Automates versioning and changelog updates
Uses custom release checklist from the project
Demonstrates value in codifying organizational best practices
Publishing the Package
Final prep steps: formatting, type-checking, and linting
GitHub Actions validate before release
GitHub Release triggers PyPI deployment
v0.1.2
Unit Converter MCP
If you don't prioritize your life, someone else will.
Greg McKeown