# save()

Canonical URL: https://developers.iagenify.com/sdk/ref/agents/subagents/save/
Language: en

`api.agents.subagents.save({ name, description, content, tools?, model? }) → Promise<Subagent>`

Creates or replaces a subagent on the account. Its description is what the main agent reads when deciding whether to delegate.

Status: always the account · tools and model optional · description decides

```javascript
await api.agents.subagents.save({
  name: "explore",
  description: "Dig through files and data to answer a question, and report the facts.",
  tools: ["read", "list", "glob", "grep", "search", "fetch", "query_storage", "account"],
  model: "gemini-3.5-flash",
  content: [
    "Find what was asked. Quote exactly, with paths.",
    "Do not change anything.",
    "End with the facts, not with advice.",
  ].join("\n"),
});
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string | required | Lowercase letters, digits and dashes. |
| `description` | string | required | One line, in the system prompt. It decides when the agent delegates to it. |
| `content` | string | required | Its instructions, up to 100 000 characters. |
| `tools` | string[] |  | Its selection. Absent inherits the parent's. |
| `model` | string |  | Its model. Absent inherits the parent's. |

## Writing a good one {#writing}

- Give it the narrowest tool set that can do the job — an investigator needs no write.
- Tell it to report facts with paths and quotations: the parent sees none of its tool results.
- Say what to do when it is blocked, since it cannot ask anyone.
- A cheaper model is often right: a delegate reads a lot and decides little.

> **It starts with nothing**
>
> A subagent sees no part of the conversation — only the prompt the task call gives it. Its instructions should assume that, and the task call should carry the goal, the paths and exactly what to report.

## It never writes to the disk {#account}

Same rule as skills: the disk is a read-only source, and a developer's files stay theirs.

- [task](/sdk/agent/tools/task): How it is called.
- [remove()](/sdk/ref/agents/subagents/remove): Taking one away.

```python
api.agents.subagents.save(
    name="explore",
    description="Dig through files and data to answer a question, and report the facts.",
    tools=["read", "list", "glob", "grep", "search", "fetch", "query_storage", "account"],
    model="gemini-3.5-flash",
    content="\n".join([
        "Find what was asked. Quote exactly, with paths.",
        "Do not change anything.",
        "End with the facts, not with advice.",
    ]),
)
```
