Skip to lesson
Exit
How Coding Agents Work (and Their Limits)1 / 2

2 min lesson

Sub-agents: parallel tools with isolated context

Work through this. "The schema migration is finished. Updating the API client and updating the docs both need the migration's output but not each other's, and fixing an unrelated README typo needs neither. How do you set this up?"

Step 1 of 2

Sub-agents: parallel tools with isolated contexteach returns just its result

The other way an agent acts beyond text is by spawning sub-agents. A parent agent runs smaller agents simultaneously on parallelizable, independent subtasks, each with its own context window. That makes the pattern efficient: each sub-agentA child agent a main agent spawns to work in parallel with its own context window, handing results back so the parent's context stays clean. Press Enter for the full definition. takes a bucketed task and returns just its result to the parent, so the parent's window fills slowly instead of carrying every sub-agent's full working context. It also avoids the old multi-tab collision problem, where two agents editing the same file would block each other.

Sub-agents: examples, custom and cloud
Explore
Understand the codebase, a research helper.
Bash
Run terminal commands in isolation.
Browser
Drive the built-in browser.
Custom
Define your own specialized sub-agentA child agent a main agent spawns to work in parallel with its own context window, handing results back so the parent's context stays clean. Press Enter for the full definition. and choose its model, either inheriting the parent's or overriding it. Keep each one narrow.
Cloud agents
Sub-agents can run on their own VMs.

Each returns its result to the parent, which reads only what it needs. The built-in set has included Explore, Bash and Browser; check the Subagents docs for the current list.

New chat vs. sub-agent: the decision rule

The clean heuristic to teach: if task B is unrelated to task A, start a NEW chat so A's context doesn't carry into B. If B and C both depend on A's output but are unrelated to each other, use sub-agents. They parallelize, keep contexts isolated and hand back only results.

Learn more

Full explanation

The human-in-the-loop boundary

The human-in-the-loop boundary

Cursor doesn't auto-apply everything silently. It asks before some actions and shows diffs you accept. Present that as a design decision, because the honest version is the more persuasive one.

Why confirmation is a feature

Running a command or editing files has real consequences; a checkpoint keeps the developer in control of irreversible moves.

Trust is earned by being reviewable.

Why full autonomy has a place

For low-risk, well-scoped or background tasks, fewer prompts means more flow.

The right boundary depends on blast radiusHow much breaks if a change goes wrong; the scope of potential damage. Press Enter for the full definition.. The DX skill is teaching developers to set it deliberately.

Interview move

If a work-trial demo asks you to wire up an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server, treat the schema and error messages as the deliverable. Show a call that fails gracefully, like a tool that returns 'no record found for id X, try listing first' instead of a stack trace, and narrate why that makes the agent more reliable. That single detail shows you understand how agents recover from errors.

QAn MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition.-backed demo keeps failing: the agent calls your tool with malformed arguments and then loops. Before blaming the model, what would you inspect and why?