Documentation / Concepts
Agents and delegation
How an agent hands work to sub-agents, runs them in the background, keeps them under control, and what is not available yet.
A single agent working through a large task fills its context quickly. Seshat lets an agent delegate: it starts a sub-agent with a self-contained task, the sub-agent works on its own with a limited set of tools, and only its result comes back.
- Main agentTalks to you, plans, decides what to delegate
- exploreRead-only: read, glob, grep
- planDesigns an approach before anything changes
- general-purposeDoes a self-contained piece of work
- helperA sub-agent of a sub-agent, within the depth limit
- verifyChecks the result
Two ways to delegate
The agent tool runs a sub-agent and waits for its answer. The main agent chooses a type and writes the task.
| Parameter | Meaning |
|---|---|
type | general-purpose, explore, plan, browse or verify |
task | A self-contained description: paths, goal, constraints, what to return |
max_turns | Turn limit for the sub-agent |
run_in_background | Return immediately with a task id and let it run |
fork | Give the sub-agent the parent’s message history |
isolation | worktree runs it in its own git worktree, so its changes stay apart until merged |
tools | Restrict its tools to a list of patterns |
The background family starts an agent that keeps running while the main agent continues:
| Tool | Use |
|---|---|
spawn_agent | Start a background sub-agent |
send_agent_message | Steer it between turns |
wait_agent | Block until it finishes and read its result |
list_agents | See what is running |
resume_agent | Continue one that stopped |
close_agent | Stop it |
Built-in agent types
| Type | For |
|---|---|
general-purpose | A self-contained piece of work with the full toolset |
explore | Understanding a codebase, read-only |
plan | Designing an approach |
browse | Deep read-only research across the web, documents and code |
verify | Checking work that was done |
A skill whose context is fork also runs as an isolated sub-agent. See Skills and MCP.
Keeping it under control
Delegation can run away if nothing stops it, so the runtime sets limits:
| Limit | Default |
|---|---|
| Delegation depth (A starts B starts C) | 3, adjustable up to 5 |
| Background agents running at once, across the process | 8 |
| Turns for a sub-agent | Lower than the top-level default, unless the agent type says otherwise |
| Wall-clock time of one sub-agent | 30 minutes, as a safety net for an agent that is stuck |
Permissions of a sub-agent
Starting an agent is itself an action that asks for approval, like any other tool. Once you approve it, the sub-agent runs without asking again for each tool, within the tools it was given. That is why the tool list matters: explore can only read, and you can narrow any agent further with the tools parameter.
Teams of persistent agents
The repository also contains building blocks for persistent agents that have a name, a role and a mailbox, and message each other asynchronously: agent profiles, a mailbox stored in SQLite, a dispatcher that sends, replies and broadcasts, and a bus that polls each inbox.
Next
Updated on 2026-10-07