Track 03 · Agents & toolsLesson 10 of 12
Subagents, skills and code mode
Split the work without multiplying latency and tokens.
- Specialisation · AI coding & modernisation
- 35 min read
- 60 min hands-on
- Northvale Bank
- Pro
What you'll be able to do
01- Explain three ways a single agent can decompose work: delegating to subagents, loading packaged skills on demand, and writing code that calls tools.
- Calculate the context and token trade-off of subagents versus one agent reading everything, and decide which a task needs.
- Write a valid
SKILL.mdthat uses progressive disclosure, and say what belongs in the body versus referenced files and scripts. - Design a code-mode tool surface and the sandbox it requires.
- Recognise when decomposition hurts (coordination overhead, lost context, debugging difficulty) and choose not to decompose.
Before you start
- The agent loop, written by hand: budgets and token growth per step.
- Context on a budget: what to keep, compress and cut: context isolation as one tool against context rot.
- Designing tools a model can use well and MCP: connecting agents to the customer's systems: the tools that subagents and code mode call.
- Agent or workflow? Choosing the autonomy level: the orchestrator-workers pattern this concept implements inside one agent.
The short version
A single agent with one long context degrades as the work grows: every document, tool definition and intermediate result competes for the same window, costs tokens on every step, and distracts the model. Three patterns decompose the work. Subagents give a sub-task its own clean context and a narrow brief, and return a short structured result, so the orchestrator never sees the raw material. Skills package instructions, scripts and reference files so the agent loads only a one-line description up front and the full procedure only when the task needs it. Code mode presents tools as a code API: the model writes a short program that calls tools and filters results in a sandbox, so thousands of rows never enter its context. Each pattern trades something: subagents cost more total tokens and add coordination, skills need curation and review, code mode needs a real sandbox. Use them when the work is genuinely separable or large; keep a single agent when it is small, tightly coupled or hard to debug.
Key takeaways:
- Subagents reduce peak context, not total cost. Expect more total tokens and more calls.
- A subagent's brief is a contract: objective, inputs, output schema, tools, boundaries.
- Skills are progressive disclosure for procedures: metadata always, body on activation, files on demand.
- Code mode keeps intermediate data out of the model's context, and makes sandboxing non-negotiable.
- Decompose for isolation, parallelism or scale; never for elegance.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI