Multi-Agent Orchestration System for Claude Code
One command. Multiple AI agents working in parallel via Agent Teams.
Fork notice: This repository is a fork of yohey-w/multi-agent-shogun. See CHANGELOG.md for changes since the fork.
multi-agent-shogun is a system that runs multiple Claude Code instances simultaneously using Agent Teams, organized like a feudal Japanese army.
Why use this?
- Give one command, get multiple AI workers executing in parallel
- Built on Claude Code's Agent Teams — agents communicate via SendMessage/TaskCreate
- No waiting — you can keep giving commands while tasks run in background
- AI remembers your preferences across sessions (Memory MCP)
- Real-time progress tracking via dashboard
You (The Lord)
│
▼ Give orders
┌─────────────┐
│ SHOGUN │ ← Receives your command, delegates immediately
└──────┬──────┘
│ Agent Teams API
┌──────▼──────┐
│ KARO │ ← Distributes tasks to workers
└──────┬──────┘
│
┌────────┼────────┐
▼ ▼ ▼
┌────────┐ ┌──┬──┬──┐
│METSUKE │ │A1│A2│A3│ ... ← Workers execute in parallel
│(Review)│ └──┴──┴──┘
└────────┘ ASHIGARU
|
Step 1 |
📥 Download this repository Download ZIP and extract to Or use git: |
|
Step 2 |
🖱️ Run Right-click and select "Run as administrator" (required if WSL2 is not yet installed). The installer will guide you through each step — you may need to restart your PC or set up Ubuntu before re-running. |
|
Step 3 |
✅ Done! AI agents are now running. |
Open Ubuntu terminal (WSL) and run from your project directory:
cd /mnt/c/your-project
/mnt/c/tools/multi-agent-shogun/shutsujin_departure.sh- After running
./shutsujin_departure.sh, a login screen appears in each pane - In just ONE pane, copy the URL and open it in your browser to log in
- After authentication, press
Ctrl+Cin other panes and re-runclaude --dangerously-skip-permissions - Credentials are saved to
~/.claude/and won't be needed again
Note: You don't need to log in separately on every pane.
🐧 Linux / Mac Users (Click to expand)
# 1. Clone the repository
git clone https://github.com/marucc/multi-agent-shogun.git ~/multi-agent-shogun
cd ~/multi-agent-shogun
# 2. Make scripts executable
chmod +x *.sh
# 3. Run first-time setup
./first_setup.shcd ~/your-project
~/multi-agent-shogun/shutsujin_departure.sh❓ What is WSL2? Why do I need it? (Click to expand)
WSL2 (Windows Subsystem for Linux) lets you run Linux inside Windows. This system uses tmux (a Linux tool) to manage multiple AI agents, so WSL2 is required on Windows.
No problem! When you run install.bat, it will:
- Check if WSL2 is installed
- If not, show you exactly how to install it
- Guide you through the entire process
Quick install command (run in PowerShell as Administrator):
wsl --installThen restart your computer and run install.bat again.
📋 Script Reference (Click to expand)
| Script | Purpose | When to Run |
|---|---|---|
install.bat |
Windows: First-time setup (runs first_setup.sh via WSL) | First time only |
first_setup.sh |
Installs tmux, Node.js, Claude Code CLI + configures Memory MCP | First time only |
shutsujin_departure.sh |
Creates .shogun/ + tmux sessions + starts Claude Code |
Every day (run from project dir) |
- ✅ Checks if WSL2 is installed
- ✅ Opens Ubuntu and runs
first_setup.sh - ✅ Installs tmux, Node.js, and Claude Code CLI
- ✅ Creates necessary directories
- ✅ Configures Memory MCP server (for cross-session memory)
- ✅ Creates
.shogun/directory in your project (dashboard, logs, wrapper scripts) - ✅ Creates tmux sessions (
shogun-<project>+multiagent-<project>) - ✅ Launches Claude Code with Agent Teams enabled
- ✅ Automatically loads instruction files for each agent
- ✅ Sets up the team hierarchy (Shogun → Karo → Ashigaru)
After running, all agents are ready to receive commands immediately!
🔧 Prerequisites (for manual setup) (Click to expand)
If you prefer to install dependencies manually:
| Requirement | How to install | Notes |
|---|---|---|
| WSL2 + Ubuntu | wsl --install in PowerShell |
Windows only |
| Set Ubuntu as default | wsl --set-default Ubuntu |
Required for scripts to work |
| tmux | sudo apt install tmux |
Terminal multiplexer |
| Node.js v20+ | nvm install 20 |
Required for Claude Code CLI |
| Claude Code CLI | npm install -g @anthropic-ai/claude-code |
Anthropic's official CLI |
After running either option, AI agents will start automatically:
| Agent | Role | Quantity |
|---|---|---|
| 🏯 Shogun | Commander — receives your orders | 1 |
| 📋 Karo | Manager — distributes tasks | 1 |
| 🔍 Metsuke | Reviewer — quality assurance | 1 |
| ⚔️ Ashigaru | Workers — execute tasks in parallel | Configurable (default: 3) |
You'll see tmux sessions created (names include your project name):
shogun-<project>— Connect here to give commandsmultiagent-<project>— Workers running in background
Wrapper scripts are generated in .shogun/bin/ for easy access.
After running shutsujin_departure.sh, all agents automatically load their instructions and are ready to work.
Open a new terminal and connect to the Shogun:
.shogun/bin/shogun.shThe Shogun is already initialized! Just give your command:
Investigate the top 5 JavaScript frameworks and create a comparison table.
The Shogun will:
- Create tasks via Agent Teams API
- Send instructions to the Karo (manager) via SendMessage
- Return control to you immediately (you don't have to wait!)
Meanwhile, the Karo distributes the work to Ashigaru workers who execute in parallel.
Open .shogun/dashboard.md in your editor to see real-time status:
## In Progress
| Worker | Task | Status |
|--------|------|--------|
| Ashigaru 1 | React research | Running |
| Ashigaru 2 | Vue research | Running |
| Ashigaru 3 | Angular research | Done |One command can spawn multiple parallel tasks:
You: "Research 5 MCP servers"
→ Ashigaru start researching simultaneously
→ Results ready in minutes, not hours
The Shogun delegates immediately and returns control to you:
You: Give order → Shogun: Delegates → You: Can give next order immediately
↓
Workers: Execute in background
↓
Dashboard: Shows results
You never have to wait for long tasks to complete.
The AI remembers your preferences:
Session 1: You say "I prefer simple solutions"
→ Saved to Memory MCP
Session 2: AI reads memory at startup
→ Won't suggest over-engineered solutions
Agents communicate via Claude Code's Agent Teams API:
- SendMessage — Direct messages between agents
- TaskCreate / TaskUpdate — Task management and assignment
- Automatic delivery — No polling, no wasted API calls
VSCode's Claude Code extension lets you paste screenshots to explain issues. This CLI system brings the same capability:
# Configure your screenshot folder in config/settings.yaml
screenshot:
path: "/mnt/c/Users/YourName/Pictures/Screenshots"
# Then just tell the Shogun:
You: "Check the latest screenshot"
You: "Look at the last 2 screenshots"
→ AI reads and analyzes your screenshots instantly
💡 Windows Tip: Press Win + Shift + S to take a screenshot. Configure the save location to match your settings.yaml path for seamless integration.
The system uses a three-layer context structure for efficient knowledge sharing:
| Layer | Location | Purpose |
|---|---|---|
| Memory MCP | memory/shogun_memory.jsonl |
Persistent memory across sessions (preferences, decisions) |
| Global | memory/global_context.md |
System-wide settings, user preferences |
| Project | context/{project}.md |
Project-specific knowledge and state |
All projects use the same 7-section template:
| Section | Purpose |
|---|---|
| What | Brief description of the project |
| Why | Goals and success criteria |
| Who | Stakeholders and responsibilities |
| Constraints | Deadlines, budget, limitations |
| Current State | Progress, next actions, blockers |
| Decisions | Decision log with rationale |
| Notes | Free-form notes and insights |
Skills are not included in this repository by default.
As you use the system, skill candidates will appear in dashboard.md.
Review and approve them to grow your personal skill library.
The Shogun → Karo → Ashigaru hierarchy exists for:
- Immediate Response: Shogun delegates instantly and returns control to you
- Parallel Execution: Karo distributes to multiple Ashigaru simultaneously
- Separation of Concerns: Shogun decides "what", Karo decides "who"
- Quality Gate: Metsuke reviews outputs independently
- Native integration: Built on Claude Code's Agent Teams API
- Automatic message delivery: No polling, no file-based workarounds
- Task management: Built-in TaskCreate/TaskUpdate/TaskList
- Reliable communication: SendMessage with guaranteed delivery
- Single responsibility: One writer = no conflicts
- Information hub: Karo receives all reports, knows the full picture
- Consistency: All updates go through one quality gate
Skills (.claude/commands/) are not committed to this repository by design.
Why?
- Each user's workflow is different
- Skills should grow organically based on your needs
- No one-size-fits-all solution
How to create new skills:
- Ashigaru report "skill candidates" when they notice repeatable patterns
- Candidates appear in
dashboard.mdunder "Skill Candidates" - You review and approve (or reject)
- Approved skills are created by Karo
MCP (Model Context Protocol) servers extend Claude's capabilities. Here's how to set them up:
MCP servers give Claude access to external tools:
- Notion MCP → Read/write Notion pages
- GitHub MCP → Create PRs, manage issues
- Memory MCP → Remember things across sessions
Run these commands to add MCP servers:
# 1. Notion - Connect to your Notion workspace
claude mcp add notion -e NOTION_TOKEN=your_token_here -- npx -y @notionhq/notion-mcp-server
# 2. Playwright - Browser automation
claude mcp add playwright -- npx @playwright/mcp@latest
# Note: Run `npx playwright install chromium` first
# 3. GitHub - Repository operations
claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=your_pat_here -- npx -y @modelcontextprotocol/server-github
# 4. Sequential Thinking - Step-by-step reasoning for complex problems
claude mcp add sequential-thinking -- npx -y @modelcontextprotocol/server-sequential-thinking
# 5. Memory - Long-term memory across sessions (Recommended!)
# ✅ Automatically configured by first_setup.sh
# To reconfigure manually:
claude mcp add memory -e MEMORY_FILE_PATH="$PWD/memory/shogun_memory.jsonl" -- npx -y @modelcontextprotocol/server-memoryclaude mcp listYou should see all servers with "Connected" status.
Edit config/settings.yaml:
ashigaru_count: 3 # Number of workers (1-8)language: ja # Japanese only
language: en # Japanese + English translationScript Architecture (Click to expand)
┌─────────────────────────────────────────────────────────────────────┐
│ FIRST-TIME SETUP (Run Once) │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ install.bat (Windows) │
│ │ │
│ └──▶ first_setup.sh (via WSL) │
│ │ │
│ ├── Check/Install tmux │
│ ├── Check/Install Node.js v20+ (via nvm) │
│ ├── Check/Install Claude Code CLI │
│ └── Configure Memory MCP server │
│ │
├─────────────────────────────────────────────────────────────────────┤
│ DAILY STARTUP (Run Every Day) │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ shutsujin_departure.sh │
│ │ │
│ ├──▶ Create .shogun/ directory in project │
│ │ │
│ ├──▶ Create tmux sessions │
│ │ • "shogun-<project>" session (Shogun agent) │
│ │ • "multiagent-<project>" session (Karo+Metsuke+Ashi) │
│ │ │
│ └──▶ Launch Claude Code with Agent Teams │
│ │
└─────────────────────────────────────────────────────────────────────┘
shutsujin_departure.sh Options (Click to expand)
# Run from your project directory
cd /path/to/your/project
# Default: Full startup (.shogun/ creation + tmux sessions + Claude Code launch)
/path/to/multi-agent-shogun/shutsujin_departure.sh
# Show help
/path/to/multi-agent-shogun/shutsujin_departure.sh -hCommon Workflows (Click to expand)
Normal Daily Usage:
cd /path/to/your/project
/path/to/multi-agent-shogun/shutsujin_departure.sh # Start everything
.shogun/bin/shogun.sh # Connect to give commandsRe-launch (after retreat):
.shogun/bin/shutsujin.sh # Re-deploy from project directoryRetreat (shutdown):
.shogun/bin/tettai.sh # Graceful shutdown with backupClick to expand file structure
multi-agent-shogun/ # SHOGUN_ROOT (system files)
│
│ ┌─────────────────── SCRIPTS ─────────────────────────┐
├── install.bat # Windows: First-time setup
├── first_setup.sh # Ubuntu/Mac: First-time setup
├── shutsujin_departure.sh # Deploy (run from project dir)
├── tettai_retreat.sh # Shutdown / retreat
├── watchdog.sh # Monitoring daemon
├── switch_account.sh # Account switching
│ └────────────────────────────────────────────────────┘
│
├── instructions/ # Agent instruction files
│ ├── shogun.md # Commander instructions
│ ├── karo.md # Manager instructions
│ ├── metsuke.md # Reviewer instructions
│ └── ashigaru.md # Worker instructions
│
├── scripts/
│ ├── claude-shogun # Claude Code launcher wrapper
│ ├── notify.sh # tmux send-keys wrapper
│ └── project-env.sh # Shared variable definitions
│
├── config/
│ └── settings.yaml # Language, agent count settings
│
├── context/ # Project context files
├── memory/ # Memory MCP storage
└── CLAUDE.md # Project context for Claude
your-project/.shogun/ # Generated per project
├── project.env # Project metadata
├── dashboard.md # Real-time status overview
├── bin/
│ ├── shutsujin.sh # Re-deploy wrapper
│ ├── tettai.sh # Retreat wrapper
│ ├── shogun.sh # Attach to shogun session
│ └── multiagent.sh # Attach to multiagent session
├── status/
│ └── pending_tasks.yaml # Saved on retreat
└── logs/
└── backup_*/ # Backups
MCP tools not working?
MCP tools are "deferred" and need to be loaded first:
# Wrong - tool not loaded
mcp__memory__read_graph() ← Error!
# Correct - load first
ToolSearch("select:mcp__memory__read_graph")
mcp__memory__read_graph() ← Works!
Agents asking for permissions?
Make sure to start with --dangerously-skip-permissions:
claude --dangerously-skip-permissions --system-prompt "..."Workers stuck?
Check the worker's pane:
.shogun/bin/multiagent.sh
# Use Ctrl+B then arrow keys to switch panes| Command | Description |
|---|---|
.shogun/bin/shogun.sh |
Connect to Shogun |
.shogun/bin/multiagent.sh |
Connect to workers |
.shogun/bin/tettai.sh |
Graceful shutdown |
Ctrl+B then 0-8 |
Switch between panes |
Ctrl+B then d |
Detach (leave running) |
tmux ls |
List all sessions |
Based on Claude-Code-Communication by Akira-Papa.
Forked from yohey-w/multi-agent-shogun.
MIT License - See LICENSE for details.
Command your AI army. Build faster.