| ask | auto | plan | full |
|---|---|---|---|
| allowed | allowed | allowed | allowed |
The tool
task. It exists only when the account or the machine has subagents to offer — without a library there is no such tool in the declarations.
Why delegating is free
A subagent's own tool calls go through the parent's callback, with the parent's mode. So asking twice — once to delegate, once per action — would be asking about the same decision at two levels, and the second is the one with the arguments in it.
What a subagent inherits, and what it does not
| Inherited | Not inherited |
|---|---|
The mode, including a later setMode() | The conversation — it starts with a fresh context |
| The permission callback | ask_user, todo_write and memory |
| The budget, shared with the parent | A step ceiling above 40 |
| The machine and the workspace | The ability to start subagents of its own |
Telling a child's events apart
onEvent: (e) => {
if (e.parentId) {
console.log(" [subagent]", e.type, e.tool ?? "");
} else {
console.log(e.type, e.tool ?? "");
}
}def on_event(event):
if event.get("parentAgent"):
print(" [subagent]", event["type"], event.get("tool", ""))
else:
print(event["type"], event.get("tool", ""))Child events carry parentId, and their identifiers are prefixed with the task's — so a tree can be drawn without guessing which run an event belongs to.
Several at once
task is in the parallel set, so several in one turn genuinely run together, each with its own context, all against the one shared budget.