Overview
NanoClaw is the first personal AI assistant to support Agent Swarms - teams of specialized agents that collaborate on complex tasks. This feature is powered by Claude Code’s experimental agent teams functionality.Agent Swarms is an experimental feature from Claude Code. NanoClaw enables it by default in all agent containers.
What are Agent Swarms?
Agent Swarms allow a single Claude agent to orchestrate multiple sub-agents, each specialized for different tasks. The main agent coordinates the team, delegates work, and synthesizes results.Use cases
- Research projects: One agent searches the web, another analyzes data, a third writes the report
- Code reviews: One agent checks style, another tests functionality, a third reviews security
- Content creation: One agent researches topics, another drafts content, a third edits and refines
- Data processing: Multiple agents process different data sources in parallel
How it works
When you give NanoClaw a complex task, the main agent can spawn sub-agents automatically:- Spawn a research agent to search and gather information
- Spawn an analysis agent to identify patterns and trends
- Spawn a writing agent to compile the final report
- Coordinate between them and synthesize the results
Enabling Agent Swarms
Agent Swarms are enabled automatically in NanoClaw through the container configuration:.claude/settings.json:
Agent team architecture
Each sub-agent runs in its own Claude Code session with:- Independent context and memory
- Access to the same mounted filesystems as the parent
- Ability to use all available tools (Bash, browser automation, etc.)
- Communication channel back to the main orchestrator agent
Session isolation
Sub-agents are isolated from each other but coordinated by the main agent:Example interactions
Research and analysis
- A web scraping agent to fetch HN posts
- Multiple analysis agents to categorize in parallel
- A synthesis agent to compile trends
Multi-source data aggregation
- A GitHub agent to analyze commit history
- A Slack agent to summarize channel activity
- A Linear agent to fetch closed tickets
- A reporting agent to compile everything
Parallel document processing
- Multiple document reading agents (one per PDF)
- A synthesis agent to create the comparison table
Memory and context sharing
All agents in a swarm have access to:- Group memory: The
CLAUDE.mdfile in the group folder - Mounted directories: Same filesystem access as the main agent
- Additional memory directories: Via
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD
/workspace/group/CLAUDE.md(main group memory)/workspace/project/CLAUDE.md(for main channel only)/workspace/global/CLAUDE.md(read-only shared memory)
Coordination patterns
The main agent coordinates sub-agents through various patterns:Sequential workflow
Parallel execution
Hierarchical delegation
Performance considerations
Container limits
Agent Swarms respect the global concurrent container limit:Resource usage
Each sub-agent:- Runs in its own Claude Code session (API calls)
- May spawn its own container processes
- Shares CPU/memory with other containers
Debugging Agent Swarms
To see what’s happening inside agent swarms:Check container logs
Ask the agent
Check session files
Each sub-agent creates session files in.claude/sessions/:
Limitations
Best practices
When to use Agent Swarms
✅ Good use cases:- Complex multi-step tasks with clear delegation opportunities
- Parallel data processing across multiple sources
- Tasks requiring different specialized skills
- Research projects with distinct gathering/analysis/writing phases
- Simple single-step queries
- Highly interactive conversations (stick to single agent)
- Time-sensitive requests (coordination adds latency)
- Tasks with strict resource constraints
Optimize swarm performance
-
Be explicit about delegation: Help the agent understand when to spawn sub-agents
-
Provide clear sub-tasks: Break down your request to guide delegation
-
Monitor resource usage: Check if swarms are worth the overhead
Related documentation
- Scheduled tasks - Run agent swarms on a schedule
- Customization - Adjust container limits and behavior
- Web access - Sub-agents can use browser automation