v0.61.0

Sub-agents & Delegation

cast supports delegating complex, multi-turn, or parallel tasks to isolated sub-agents via the task tool.

Overview

A sub-agent is a separate instance of the agent loop running in an isolated context:

Enabling Delegation (subagents field)

The task tool is persona-gated. Among the built-ins, senior (the default) and coder-with-subagents have it; qa, analyst, pm, assistant and researcher do not.

To enable delegation, a persona's frontmatter must specify:

yaml
subagents: true

senior delegates sparingly: wide exploration, independent areas in parallel, an independent review. coder-with-subagents leans on delegation much harder.

Restricting Subagent Roles (subagentTypes)

You can restrict which specific sub-agent roles a persona is allowed to spawn:

yaml
subagents: true
subagentTypes: [explore, review]   # Can spawn 'explore' and 'review', but not 'worker'

If subagentTypes is omitted, the persona can spawn any configured sub-agent role.

Built-in Sub-agent Roles

cast includes three standard sub-agent roles:

RoleDescriptionAllowed Built-in ToolsUsage
workerDefault catch-all roleAll built-in tools (except task)Edits, refactoring, mixed tasks
exploreRead-only codebase explorationread, grep, glob, ls, inspection-only bashStructural research, finding symbols/files
reviewIndependent code validationread, grep, glob, ls, bashVerification of changes before reporting done

Sub-agents cannot delegate further: the task tool is stripped from all sub-agents to prevent infinite recursive spawning.

Custom Sub-agents

Beyond the built-ins in prompts/subagents/, cast loads ~/.cast/subagents/*.md and, for a trusted project, .cast/subagents/*.md. A later source replaces a same-named earlier one (project over global over built-in). Frontmatter supports tool allowlists and context rules:

markdown
---
name: explore
label: Explore
description: Read-only codebase exploration
tools: [read, grep, glob, ls, bash]
agentsMd: true
---

You explore the codebase and report findings. You cannot edit files.

Watching Sub-agents

Inherited Restrictions & Security

Sub-agents inherit security and discovery constraints from the parent session:

Model & Provider Selection

You can run sub-agents on a separate model to save costs or speed up parallel searches: