Subagent

A worker agent sent off with one scoped task and its own context, then asked to return a result to the parent agent.

send a smaller AI off to do one taskdelegate part of the jobgive each bot its own contextmy agent fills up its context reading filesAI helper for one subtasksplit the work between agentsworker botsub agant

See it

Live demo coming soon

What it is

A subagent is a separate agent given one bounded task, its own context, and usually a narrower set of tools. A parent agent delegates the work, waits for a result, and folds that result back into the main run. The useful bit is the fresh context: the worker can read fifty files without stuffing all fifty into the parent's transcript. Claude Code works this way, handing a search or a review to a subagent that reads whatever it needs and returns a paragraph.

Reach for one when a side task is self-contained, expensive in context, or safe to run in parallel: research one dependency, inspect one module, or test one hypothesis. Send a crisp task packet with the goal, inputs, constraints, allowed tools, output schema, and stopping condition.

Gotcha: delegation has a tax. Vague briefs produce overlapping work, parallel workers can return contradictory answers, and their summaries can hide the evidence the parent needed. A separate context is also not a security boundary. Enforce tool permissions in code, set time and token budgets, and require workers to return sources or artifacts with their conclusion.

Ask AI for it

Add a supervisor-worker subagent layer to this agent. Represent each delegation as a JSON Schema task packet with goal, inputs, constraints, allowed_tools, output_schema, deadline, and token_budget. Give each worker a fresh transcript containing only that packet, enforce its tool allowlist server side, cancel overdue workers with AbortController.signal, and collect independent results with Promise.allSettled. Have workers return a typed result with status, conclusion, evidence, artifacts, and unresolved_questions; then make the supervisor resolve conflicts and record which worker result supported each final claim.

You might have meant

agentagentic workflow agent orchestrationcontext windowtool calling function callinghuman in the loop