Multi-agent collaboration framework using Claude Code, Tmux, and MCP (Model Context Protocol).
Perpendicular enables multiple AI agents to work in parallel on the same codebase without conflicts. Each agent gets its own git worktree, sparse-checkout, and dedicated workspace.
# Launch the admin agent
./admin
# From within admin, spawn workers
spawn_agent worker
spawn_agent memoryperpendicular/
├── admin # Launch admin agent in tmux
├── perp <type> # Spawn agent (admin|worker|memory|monitor)
├── perpendicular # Launch tmux workspace
├── .claude/ # Auto-loaded MCP configs for Claude Code
├── .env.example # Environment variables template
├── src/
│ ├── agent_tools.sh # Tools for agents (source this!)
│ ├── tmux.conf # Tmux configuration
│ └── mcp_profiles/ # Agent type descriptions (not MCP configs)
│ ├── admin.conf
│ ├── worker.conf
│ ├── memory.conf
│ └── monitor.conf
├── tests/ # Unit tests
└── __perpendicular_agent/ # Git worktrees (created at runtime)
-
Clone and navigate:
git clone <repo> cd perpendicular
-
Configure environment (optional, for full MCP features):
cp .env.example .env # Edit .env with your Upstash/Supabase credentials -
Run tests to verify:
./tests/run_tests
-
Launch admin:
./admin
MCP servers (Context7, Supabase) are auto-loaded from .claude/mcp_servers.json.
| Type | Purpose | MCP Servers |
|---|---|---|
admin |
Coordinates workers, assigns tasks | Agent-MCP, Context7 |
worker |
Implementation, code changes | Context7, Supabase |
memory |
RAG management, knowledge graph | Agent-MCP, Context7 |
monitor |
Self-healing, watches admin | (minimal) |
After spawning an agent, source the tools:
source agent_tools.shAvailable tools:
get_directory [depth]- List all repo files from gitdownload_file <path>- Copy to workspace + add to sparse-checkoutupload [message]- Commit and push changesspawn_agent <type>- Spawn new agent (admin only)send_message <id> <msg>- Send tmux message to agentcheck_status- Show all agent statusesquery_context <query>- Query knowledge graph (context7)
MCP servers are auto-configured from .claude/mcp_servers.json. No manual setup needed!
| MCP | Purpose |
|---|---|
| Context7 | Shared knowledge graph for all agents |
| Supabase | Database, file locking, task queues |
For advanced multi-agent orchestration (task management, conflict resolution):
uv venv && uv install
uv run -m agent_mcp.cli --port 8080Then add to .claude/mcp_servers.json:
{
"agent-mcp": {
"command": "uv",
"args": ["run", "-m", "agent_mcp.cli", "--port", "8080"]
}
}CRITICAL: When agents communicate via tmux, use TWO separate commands:
- Type message:
tmux send-keys -t agent_1 "Hello" - Press enter:
tmux send-keys -t agent_1 Enter
Trying to do both at once doesn't work reliably.
./tests/run_tests- Start admin:
./admin - Admin spawns workers:
spawn_agent worker - Worker queries context:
query_context "auth system design" - Worker downloads file:
download_file src/auth.rs - Worker edits file in
__agent_environment/ - Worker uploads:
upload "Implement login" - Admin monitors:
check_status
The monitor agent watches the admin and reinitializes if it dies:
# From admin
spawn_agent monitorMonitor sleeps 120s, checks admin status, reinitializes if needed. Loops forever.
MIT