Multi-agent collaboration for the pi coding agent.
Note: This repository is a fork of burggraf/pi-teams. Many credits to him!
Orchestrate teams of AI agents that work together on complex coding tasks. pi-teams enables you to spawn specialized agents, coordinate communication, and automate workflows with hooks.
pi install https://github.com/eleqtrizit/pi-teamsGoes well with Pi-Tasks:
https://github.com/eleqtrizit/pi-tasks
pi install https://github.com/eleqtrizit/pi-tasksUse simple phrasing in the chat window to make teams and workers:
Create a team called my-team.
Create a team called research-team with model gpt-4o.
Spawn a teammate called security-bot to review the codebase.
Spawn a teammate called architect with model gpt-4o and thinking level high.
Send a message to security-bot to focus on the auth module.
Broadcast a message to the entire team about the API endpoint change.
Read the inbox of security-bot.
team_create- Create new teamspawn_teammate- Launch agentsend_message/broadcast_message/read_inbox- Messaginglist_teammates- List and check teammate statusprocess_shutdown_approved- Gracefully shut down teammateteam_shutdown- Shutdown entire teamresolve_model- Find correct provider/model name
- 🏢 Team Management: Create teams with custom names, descriptions, and default AI models
- 🤖 Agent Spawning: Launch specialized teammates with different models and thinking levels
- 💬 Inter-Agent Messaging: Agents communicate autonomously via inbox system
- 🔔 Automated Reminders: System prompts idle agents to report back to team-lead
- 🖥️ Terminal Integration: Native support for tmux, Zellij, iTerm2, and WezTerm
- 🔒 Lock System: Thread-safe operations with automatic stale lock cleanup
- 📊 Model Resolution: Smart provider selection with priority-based model matching
pi-teams automatically detects and integrates with your terminal environment:
| Terminal | Detection | Pane Management |
|---|---|---|
| tmux | TMUX env var |
tmux split-window |
| Zellij | ZELLIJ env var |
zellij run |
| iTerm2 | macOS detection | AppleScript window splits |
| WezTerm | Cross-platform | wezterm cli spawn |
Team member windows are titled with format: {teamName}: {agentName}
Supported terminals:
- iTerm2: Escape sequences via AppleScript
- WezTerm: CLI
set-window-titlecommand - tmux/Zellij: Pane titles within session
Teammates automatically check for new messages every 30 seconds when idle, ensuring responsiveness without manual intervention.
If a teammate completes work without reporting back to the team-lead, the system automatically sends a one-time reminder:
"What is your report/feedback/questions? You report to the team-lead, not a human. Send a message to the team-lead immediately."
The reminder system uses instruction-based timestamps to avoid false positives from incidental wake cycles.
Each teammate receives a custom system prompt including:
- Their role and instructions
- Team context (team name, member list)
- Available tools
- Team environment guidelines
All team data is stored in ~/.pi/:
~/.pi/
├── teams/
│ └── <team-name>/
│ └── config.json # Team configuration
└── messages/
└── <team-name>/
├── <agent-name>.json # Message inboxes
└── index.json # Message index
- Lock files prevent concurrent modifications with automatic stale lock cleanup (60s timeout)
- Race condition protection for multi-agent operations
- Input validation on all task and message data
- File-based isolation between teams
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
npm test - Submit a pull request
MIT License - See LICENSE for details.
Ported from claude-code-teams-mcp for the pi coding agent ecosystem.
Built for the pi coding agent.
