Teams let multiple agents work together on a shared project. A team has a lead agent that coordinates work, member agents that execute tasks, shared inboxes for communication, and a task board for tracking progress.
Core Concepts
| Concept | What it is |
|---|---|
| Subagent | A spawned worker managed by AgentManager |
| Team | A named group of agents with shared config, inboxes, and task board |
| Team lead | The coordinating agent (usually named team-lead) |
| Teammate | A spawned agent registered as a team member |
Quick Start
From the TUI, create a team and assign work:
/team 3 Build a REST API with auth, database, and tests
This spawns 3 agents and distributes the work across them.
Agent Lifecycle
Spawning
spawn_agent(agent_type: "worker", message: "Implement the auth middleware")
Each spawned agent has a status that progresses through:
pending_init → running → completed (or errored / shutdown)
Managing Agents
| Action | What it does |
|---|---|
spawn_agent | Create a new agent with a specific role and task |
send_input | Send follow-up instructions to a running agent |
wait | Block until one or more agents finish |
close_agent | Shut down an agent and free its slot |
resume_agent | Reopen a completed agent for more work |
Limits
Concurrency is controlled by config:
[agent.agents]
max_threads = 4 # max simultaneous agents
max_depth = 2 # max nesting (agent spawning agent)
Exceeding either limit returns an explicit error.
Roles
Agents are assigned roles that determine their capabilities. Roles come from three sources (checked in order):
- Built-in roles — shipped with Nyzhi
- Config roles — defined in
[agent.agents.roles] - File roles — stored in
.nyzhi/agents/*.md(or.claude/agents/*.md)
Built-in Roles
| Role | Purpose |
|---|---|
default | General-purpose agent |
explorer | Read-only codebase exploration |
worker | Implementation tasks |
reviewer | Code review |
planner | Architecture and planning |
architect | System design |
debugger | Root-cause debugging |
security-reviewer | Security analysis |
quality-reviewer | Code quality assessment |
test-engineer | Test writing and QA |
build-fixer | Build failure resolution |
deep-executor | Complex multi-step tasks |
document-specialist | Documentation |
code-simplifier | Refactoring and simplification |
Custom Roles
Define custom roles in your config:
[agent.agents.roles.frontend-specialist]
description = "Expert in React and CSS"
system_prompt = "You are a frontend specialist. Focus on component design, accessibility, and performance."
model = "anthropic/claude-sonnet-4-20250514"
max_steps = 50
allowed_tools = ["read", "write", "edit", "grep", "glob", "bash", "git_status", "git_diff"]
Or create a file at .nyzhi/agents/frontend-specialist.md:
# Frontend Specialist
You are a frontend development expert. Focus on:
- Component architecture
- Accessibility (WCAG 2.1 AA)
- Performance optimization
- Responsive design
Team Configuration
Creating a Team
From the TUI:
/team 3 Implement the payment system
Or programmatically via the team_create tool.
Team Storage
Team data lives under ~/.nyzhi/:
| What | Path |
|---|---|
| Config | teams/<team>/config.json |
| Inboxes | teams/<team>/inboxes/<member>.json |
| Tasks | tasks/<team>/*.json |
| Watermark | tasks/<team>/.highwatermark |
Team Config Schema
{
"name": "payment-team",
"members": [
{
"name": "lead",
"agentType": "planner",
"color": "copper"
},
{
"name": "worker-1",
"agentType": "worker",
"model": "deepseek/deepseek-chat"
}
],
"default_model": "anthropic/claude-sonnet-4-20250514",
"default_role": "worker",
"max_steps": 100
}
Communication
Messaging
Agents communicate through typed inboxes:
send_team_message(to: "worker-1", message: "Auth middleware is done. Start on the API routes.")
Broadcast to all members:
send_team_message(to: "*", message: "Database schema is finalized.")
Reading Messages
read_inbox()
Returns unread messages for the calling agent.
Task Board
Teams share a structured task board:
task_create(title: "Implement /api/payments endpoint", assigned_to: "worker-1")
task_update(task_id: "...", status: "in_progress")
task_list()
TUI Slash Commands
| Command | What it does |
|---|---|
/team <N> <task> | Spawn N agents for a task |
/teams-config | Show all team configs |
/teams-config show <team> | Show specific team config |
/teams-config set <team> model|role|max-steps <value> | Update team defaults |
/teams-config member <team> <member> model|role <value> | Update member config |
/teams-config reset <team> | Reset to defaults |
/subagent-config set <role> <model> | Override model for a role |
/subagent-config reset [role] | Reset role model override |
CLI Team Commands
# List all teams
nyz teams list
# Show team details
nyz teams show payment-team
# Delete a team and all its artifacts
nyz teams delete payment-team
Pass --team-name to set team context for run/exec:
nyz run --team-name payment-team "Check the status of all tasks"
Hook Integration
Team-specific events you can hook into:
teammate_idle— fires when a teammate finishes and has no pending worktask_completed— fires when a task status changes to complete
See Hooks for details.