Subagents library

remove()

api.agents.subagents.remove(name) → Promise<{ ok: true }>

Removes a subagent from the account. One that exists only on a disk is refused, with its path.

the account onlyitem_on_computermay remove task
Using Python?

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

await api.agents.subagents.remove("explore");   // { ok: true }
api.agents.subagents.remove("explore")   # {"ok": True}

Removing the last one removes a tool

With an empty library there is no task tool

The agent loses the ability to delegate, and the « Subagents » section leaves the system prompt. Nothing fails — but a run that used to fan out now does everything itself, which is slower and uses more of its own context.

A computer subagent is refused

item_on_computer, naming the folder. The API cannot touch that file, and reporting a deletion that did not happen would be worse.

Removing the account's copy reveals the disk's

If both existed, the computer's comes back into the list.

Errors

CodeStatusWhen
item_on_computer409It exists only on this computer.
not_found404In neither source.