Permissions

task

Handing a job to a subagent. Always allowed — and free precisely because everything the subagent then does is not.

always allowedruns in parallelchildren are not free
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

askautoplanfull
allowedallowedallowedallowed

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

The permission moved, it did not disappear

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

InheritedNot inherited
The mode, including a later setMode()The conversation — it starts with a fresh context
The permission callbackask_user, todo_write and memory
The budget, shared with the parentA step ceiling above 40
The machine and the workspaceThe 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.