Tool Name
spawn
Description
Spawn a subagent to handle a task in the background. Use this for complex or time-consuming tasks that can run independently. The subagent will complete the task and report back when done.Parameters
The task description for the subagent to complete. Should be clear and self-contained.
Optional short label for the task (used for display and tracking). If not provided, a label is generated from the task description.
Return Value
Returns a confirmation message with the subagent ID, or an error message if spawning fails.Configuration
Context Management
Examples
Spawn Simple Task
Spawn with Custom Label
Spawn Research Task
Spawn Monitoring Task
How It Works
- Spawn: Parent agent calls spawn tool with task description
- Create: SubagentManager creates new agent instance with own tool access
- Execute: Subagent runs independently in background
- Report: Subagent sends results/messages to origin channel when complete
- Cleanup: Subagent terminates after completion
Subagent Lifecycle
Use Cases
Long-Running Operations
Spawn subagents for tasks that take significant time:- Large file processing
- Multiple API calls with rate limits
- Comprehensive research
- System monitoring
Parallel Execution
Spawn multiple subagents to work in parallel:Isolation
Spawn subagents to isolate risky or experimental operations:- Testing new approaches
- Potentially destructive operations
- Resource-intensive tasks
Background Monitoring
Spawn subagents for continuous monitoring:- Log file watching
- System health checks
- Event detection
Best Practices
Clear Task Descriptions
Provide complete, self-contained task descriptions: ✅ Good:Meaningful Labels
Use descriptive labels for tracking:When to Use
Spawn subagents when:- Task takes > 30 seconds
- Parent agent has other work to do
- Task is independent and self-contained
- Need parallel execution
When NOT to Use
Don’t spawn subagents when:- Task is quick (< 10 seconds)
- Result is needed immediately
- Task requires interactive back-and-forth
- Task depends on parent agent state
Subagent Capabilities
Subagents have access to:- All tools the parent agent has
- Same configuration and restrictions
- Own tool execution context
- Ability to spawn further subagents (nested)
Limitations
- Subagents run with same permissions as parent
- No direct communication channel between parent and subagent during execution
- Subagents cannot access parent agent’s conversation history
- Resource limits apply to each subagent
Implementation
Seenanobot/agent/tools/spawn.py:11 for the SpawnTool implementation.
See nanobot/agent/subagent.py for the SubagentManager implementation.
Related
- Cron Tool - Schedule recurring tasks
- Message Tool - Receive subagent results
- Subagent Architecture - System design