๐ค Tmux Multi-Agent Communication Demo
June 26, 2025 ยท View on GitHub
A demo system for agent-to-agent communication in a tmux environment.
๐ Read this in other languages: ๆฅๆฌ่ช
๐ฏ Demo Overview
Experience a hierarchical command system: PRESIDENT โ BOSS โ Workers
๐ฅ Agent Configuration
๐ PRESIDENT Session (1 pane)
โโโ PRESIDENT: Project Manager
๐ multiagent Session (4 panes)
โโโ boss1: Team Leader
โโโ worker1: Worker A
โโโ worker2: Worker B
โโโ worker3: Worker C
๐ Quick Start
0. Clone Repository
git clone https://github.com/nishimoto265/Claude-Code-Communication.git
cd Claude-Code-Communication
1. Setup tmux Environment
โ ๏ธ Warning: Existing multiagent and president sessions will be automatically removed.
./setup.sh
2. Attach Sessions
# Check multiagent session
tmux attach-session -t multiagent
# Check president session (in another terminal)
tmux attach-session -t president
3. Launch Claude Code
Step 1: President Authentication
# First, authenticate in PRESIDENT session
tmux send-keys -t president 'claude' C-m
Follow the authentication prompt to grant permission.
Step 2: Launch All Multiagent Sessions
# After authentication, launch all multiagent sessions at once
for i in {0..3}; do tmux send-keys -t multiagent:0.$i 'claude' C-m; done
4. Run Demo
Type directly in PRESIDENT session:
You are the president. Follow the instructions.
๐ About Instructions
Role-specific instruction files for each agent:
- PRESIDENT:
instructions/president.md - boss1:
instructions/boss.md - worker1,2,3:
instructions/worker.md
Claude Code Reference: Check system structure in CLAUDE.md
Key Points:
- PRESIDENT: "You are the president. Follow the instructions." โ Send command to boss1
- boss1: Receive PRESIDENT command โ Send instructions to all workers โ Report completion
- workers: Execute Hello World โ Create completion files โ Last worker reports
๐ฌ Expected Operation Flow
1. PRESIDENT โ boss1: "You are boss1. Start Hello World project"
2. boss1 โ workers: "You are worker[1-3]. Start Hello World task"
3. workers โ Create ./tmp/ files โ Last worker โ boss1: "All tasks completed"
4. boss1 โ PRESIDENT: "All completed"
๐ง Manual Operations
Using agent-send.sh
# Basic sending
./agent-send.sh [agent_name] [message]
# Examples
./agent-send.sh boss1 "Urgent task"
./agent-send.sh worker1 "Task completed"
./agent-send.sh president "Final report"
# Check agent list
./agent-send.sh --list
๐งช Verification & Debug
Log Checking
# Check send logs
cat logs/send_log.txt
# Check specific agent logs
grep "boss1" logs/send_log.txt
# Check completion files
ls -la ./tmp/worker*_done.txt
Session Status Check
# List sessions
tmux list-sessions
# List panes
tmux list-panes -t multiagent
tmux list-panes -t president
๐ Environment Reset
# Delete sessions
tmux kill-session -t multiagent
tmux kill-session -t president
# Delete completion files
rm -f ./tmp/worker*_done.txt
# Rebuild (with auto cleanup)
./setup.sh
๐ License
This project is licensed under the MIT License.
๐ค Contributing
Contributions via pull requests and issues are welcome!
๐ Experience Agent Communication! ๐คโจ