Multi-Agent Orchestration System for Claude Code
One command. Eight AI agents working in parallel.
multi-agent-shogun is a system that runs multiple Claude Code instances simultaneously, organized like a feudal Japanese army.
Why use this?
- Give one command, get 8 AI workers executing in parallel
- 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
ββββββββ¬βββββββ
β YAML files + tmux
ββββββββΌβββββββ
β KARO β β Distributes tasks to workers
ββββββββ¬βββββββ
β
βββ¬ββ¬ββ¬ββ΄ββ¬ββ¬ββ¬ββ
β1β2β3β4β5β6β7β8β β 8 workers execute in parallel
βββ΄ββ΄ββ΄ββ΄ββ΄ββ΄ββ΄ββ
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 |
π§ Open Ubuntu and run (first time only) cd /mnt/c/tools/multi-agent-shogun
./first_setup.sh |
|
Step 4 |
β Deploy! ./shutsujin_departure.sh |
Open Ubuntu terminal (WSL) and run:
cd /mnt/c/tools/multi-agent-shogun
./shutsujin_departure.shπ§ Linux / Mac Users (Click to expand)
# 1. Clone the repository
git clone https://github.com/yohey-w/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 ~/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 (auto-install if missing)
- Check if Ubuntu is installed (auto-install if missing)
- Guide you to the next steps (
first_setup.sh)
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: WSL2 + Ubuntu setup | First time only |
first_setup.sh |
Installs tmux, Node.js, Claude Code CLI + configures Memory MCP | First time only |
shutsujin_departure.sh |
Creates tmux sessions + starts Claude Code + loads instructions | Every day |
- β Checks if WSL2 is installed (auto-install if missing)
- β Checks if Ubuntu is installed (auto-install if missing)
- β
Guides you to the next steps (
first_setup.sh)
- β Creates tmux sessions (shogun + multiagent)
- β Launches Claude Code on all agents
- β Automatically loads instruction files for each agent
- β Resets queue files for a fresh start
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 |
| βοΈ Ashigaru | Workers - execute tasks in parallel | 8 |
You'll see tmux sessions created:
shogun- Connect here to give commandsmultiagent- Workers running in background
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:
tmux attach-session -t shogunThe Shogun is already initialized! Just give your command:
Investigate the top 5 JavaScript frameworks and create a comparison table.
The Shogun will:
- Write the task to a YAML file
- Notify the Karo (manager)
- 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 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 up to 8 parallel tasks:
You: "Research 5 MCP servers"
β 5 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 YAML files and wake each other with tmux send-keys. No API calls are wasted on polling loops.
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.
Perfect for:
- Explaining UI bugs visually
- Showing error messages
- Comparing before/after states
| Agent | Model | Thinking | Reason |
|---|---|---|---|
| Shogun | Opus | Disabled | Delegation & dashboard updates don't need deep reasoning |
| Karo | Default | Enabled | Task distribution requires careful judgment |
| Ashigaru | Default | Enabled | Actual implementation needs full capabilities |
The Shogun uses MAX_THINKING_TOKENS=0 to disable extended thinking, reducing latency and cost while maintaining Opus-level judgment for high-level decisions.
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 |
This design allows:
- Any Ashigaru to pick up work on any project
- Consistent context across agent switches
- Clear separation of concerns
- Knowledge persistence across sessions
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 |
This standardized structure ensures:
- Quick onboarding for any agent
- Consistent information across all projects
- Easy handoffs between Ashigaru workers
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"
- YAML files: Structured communication that survives agent restarts
- send-keys: Event-driven wakeups (no polling = no wasted API calls)
- No direct calls: Agents can't interrupt each other or your input
- 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
This keeps skills user-driven β only what you find useful gets added.
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.
You: "Research the top 5 AI coding assistants and compare them"
What happens:
1. Shogun delegates to Karo
2. Karo assigns:
- Ashigaru 1: Research GitHub Copilot
- Ashigaru 2: Research Cursor
- Ashigaru 3: Research Claude Code
- Ashigaru 4: Research Codeium
- Ashigaru 5: Research Amazon CodeWhisperer
3. All 5 research simultaneously
4. Results compiled in dashboard.md
You: "Prepare a PoC for the project in this Notion page: [URL]"
What happens:
1. Karo fetches Notion content via MCP
2. Ashigaru 2: Lists items to clarify
3. Ashigaru 3: Researches technical feasibility
4. Ashigaru 4: Creates PoC plan document
5. All results in dashboard.md, ready for your meeting
Edit config/settings.yaml:
language: ja # Japanese only
language: en # Japanese + English translationScript Architecture (Click to expand)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FIRST-TIME SETUP (Run Once) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β install.bat (Windows) β
β β β
β βββ Check/Install WSL2 β
β βββ Check/Install Ubuntu β
β β
β first_setup.sh (run manually in Ubuntu/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 tmux sessions β
β β β’ "shogun" session (1 pane) β
β β β’ "multiagent" session (9 panes, 3x3 grid) β
β β β
β ββββΆ Reset queue files and dashboard β
β β β
β ββββΆ Launch Claude Code on all agents β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
shutsujin_departure.sh Options (Click to expand)
# Default: Full startup (tmux sessions + Claude Code launch)
./shutsujin_departure.sh
# Session setup only (without launching Claude Code)
./shutsujin_departure.sh -s
./shutsujin_departure.sh --setup-only
# Full startup + open Windows Terminal tabs
./shutsujin_departure.sh -t
./shutsujin_departure.sh --terminal
# Show help
./shutsujin_departure.sh -h
./shutsujin_departure.sh --helpCommon Workflows (Click to expand)
Normal Daily Usage:
./shutsujin_departure.sh # Start everything
tmux attach-session -t shogun # Connect to give commandsDebug Mode (manual control):
./shutsujin_departure.sh -s # Create sessions only
# Manually start Claude Code on specific agents
tmux send-keys -t shogun:0 'claude --dangerously-skip-permissions' Enter
tmux send-keys -t multiagent:0.0 'claude --dangerously-skip-permissions' EnterRestart After Crash:
# Kill existing sessions
tmux kill-session -t shogun
tmux kill-session -t multiagent
# Start fresh
./shutsujin_departure.shClick to expand file structure
multi-agent-shogun/
β
β ββββββββββββββββββββ SETUP SCRIPTS ββββββββββββββββββββ
βββ install.bat # Windows: First-time setup
βββ first_setup.sh # Ubuntu/Mac: First-time setup
βββ shutsujin_departure.sh # Daily startup (auto-loads instructions)
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββ instructions/ # Agent instruction files
β βββ shogun.md # Commander instructions
β βββ karo.md # Manager instructions
β βββ ashigaru.md # Worker instructions
β
βββ config/
β βββ settings.yaml # Language and other settings
β
βββ queue/ # Communication files
β βββ shogun_to_karo.yaml # Commands from Shogun to Karo
β βββ tasks/ # Individual worker task files
β βββ reports/ # Worker reports
β
βββ memory/ # Memory MCP storage
βββ dashboard.md # Real-time status overview
βββ CLAUDE.md # Project context for Claude
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:
tmux attach-session -t multiagent
# Use Ctrl+B then number to switch panes| Command | Description |
|---|---|
tmux attach -t shogun |
Connect to Shogun |
tmux attach -t multiagent |
Connect to workers |
Ctrl+B then 0-8 |
Switch between panes |
Ctrl+B then d |
Detach (leave running) |
tmux kill-session -t shogun |
Stop Shogun session |
tmux kill-session -t multiagent |
Stop worker sessions |
Based on Claude-Code-Communication by Akira-Papa.
MIT License - See LICENSE for details.
Command your AI army. Build faster.