Write a subagent file, give it a narrow job and a short tool list, and watch Claude Code delegate to it.
Out on Wednesday 21 October10 minutes, one build start to finish
Why this matters
One long Claude Code session fills its context with every file it read and every step it took, and quality drops as it grows. Subagents take a narrow job in their own context and return only the answer, so the main session stays focused.
What you build
A subagent with its own prompt and tools that Claude Code hands work to.
Write a subagent as a Markdown file, with a name and a line on when to use it.
Give it a narrow prompt and a short list of tools.
Ask Claude Code for work that matches, and watch it hand the task over.
Get the subagent's answer back without its working steps filling your context.
The ideas behind it
A subagent file
A Markdown file with a name, a line on when to use it, a prompt and a tool list.
Delegation
Claude Code reads that line and hands matching work to the subagent on its own.
Context isolation
The subagent's searching and reading stay in its own context; only its answer comes back.
Before you start
You need
Claude Code installed, and a repository to try it on.
Length
About 10 minutes, one build start to finish.
Questions
How many subagents should I have?
Start with one for a job you repeat often, such as reviewing a diff or searching the codebase.
Can a subagent use a different model?
Yes. A small, fast model is often enough for narrow jobs.
Can the team share them?
Yes. Commit the files to the repository and everyone gets the same subagents.
Is the recorded lab free?
Yes. Watch it any time, follow the steps and keep the code you build.
How is it different from a Live Lab?
A recorded lab is one short build you follow on your own. A Live Lab builds a bigger part of the system in an hour, with time for your questions.
Then take it further
This build is one piece. The Live Lab Build a Team of AI Agents goes from here to a working part of a real system.
Split one agent into roles
A planner, an engineer and a reviewer, each with its own prompt and model.
Scope tools per role
Each agent calls only the tools its role needs, and every call is logged.
Decide when it pays
Compare the team with one agent on quality, latency and token cost.
The parts of a production agent system that lab builds, lit on the map:
Week 1Architect
Roles and modelsOne job per agent, a model chosen for that job, and a token budget.
OrchestrationA queue agents pick work from, with hand-offs a person can follow.
Context and memoryRetrieval with sources, memory across sessions, prompts laid out for the cache.
Tool callingTyped tools that act in GitHub, Linear and Google.
Week 2Build
MCP serversEvery tool behind an MCP gateway, scoped to the role that needs it.
Durable executionRuns that resume after a crash and never repeat a write.
Human in the loopA person approves anything that cannot be undone.
Week 3Secure and deploy
Identity and permissionsEach agent signs in as itself and acts on behalf of a user.
LLM gatewayRouting, caching and a budget on every model call.
Traces, evals and costEvery run traced, scored and charged to the agent that made it.
Multi-tenancyEach team or customer kept apart, in data and in the bill.
Week 4Govern and extend
Policy as codeRules checked on every action, not written in a document.
Signed skillsNew roles built from reviewed, signed skills.