v0.36.2

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 background instance of the agent loop running in an isolated context:

Enabling Delegation (subagents field)

The task tool is persona-gated. By default, built-in personas like senior or qa do not have access to task.

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

subagents: true

The built-in coder-with-subagents persona has subagents: true set by default.

Restricting Subagent Roles (subagentTypes)

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

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, 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.

Frontmatter Configuration

Custom sub-agent prompts live in prompts/subagents/<name>.md or can be loaded dynamically. Frontmatter supports tool allowlists and context rules:

---
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.

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: