subagents
Spawn specialized sub-agents to handle specific tasks. Delegate work to focused agents with their own tools, model, and system prompt.
Parent agent calls task(prompt, agent_type) → sub-agent runs and returns result. Built-in agents included.
Quick Start
main.py
Python REPL
Interactive
AGENT.md Format
Create a file at .co/agents/name/AGENT.md:
code
| Field | Required | Description |
|---|---|---|
| name | yes | Agent identifier (used in task() calls) |
| description | yes | Shown to parent agent when choosing sub-agent |
| model | no | Default: co/gemini-2.5-pro |
| max_iterations | no | Default: 10 |
| tools | no | List of tool names to give the sub-agent |
Available tool names:
glob, grep, read_file, edit, multi_edit, write, bash, WebFetch, Memory, Browser
Agent Discovery
Agents are discovered in priority order:
code
Project-level agents override built-ins. Built-in agents are bundled with co ai for common tasks like codebase exploration and planning.
Events used
| Event | Handler | Purpose |
|---|---|---|
on_agent_ready | initialize_subagents | Discover agents, register task() tool |
