📦yohey-w / multi-agent-shogun
← 返回首页
Samurai-inspired multi-agent system for Claude Code. Orchestrate parallel AI tasks via tmux with shogun → karo → ashigaru hierarchy.
⚖️ MIT#ai-agent#anthropic#automation#claude-code#llm📅 创建于 2026-01-25🔄 更新于 2026-08-06
🔗 GitHub Shell

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有
# multi-agent-shogun **Command your AI army like a feudal warlord.** Run 10 AI coding agents in parallel — **Claude Code, OpenAI Codex, GitHub Copilot, Kimi Code, OpenCode, Cursor, Antigravity** — orchestrated through a samurai-inspired hierarchy with zero coordination overhead. **Talk Coding, not Vibe Coding. Speak to your phone, AI executes.** [![GitHub Stars](https://img.shields.io/github/stars/yohey-w/multi-agent-shogun?style=social)](https://github.com/yohey-w/multi-agent-shogun) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![v5.1.0 Karo Traffic Control](https://img.shields.io/badge/v5.1.0-Karo%20Traffic%20Control-ff6600?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHRleHQgeD0iMCIgeT0iMTIiIGZvbnQtc2l6ZT0iMTIiPuKalTwvdGV4dD48L3N2Zz4=)](https://github.com/yohey-w/multi-agent-shogun/releases/tag/v5.1.0) [![Shell](https://img.shields.io/badge/Shell%2FBash-100%25-green)]() [English](https://github.com/yohey-w/multi-agent-shogun/blob/HEAD/README.md) | [日本語](https://github.com/yohey-w/multi-agent-shogun/blob/HEAD/README_ja.md)

📖 Sequel (Aug 2026): The author has since disbanded his own 10-agent army down to a single agent that carries his judgment. The successor project is kagemusha — it ships the forms of a judgment loop (corrections → principles → standing rules), not the agents. The story of the disbandment: article (JP). multi-agent-shogun itself continues to work as-is.

Latest translucent command session in the Shogun pane

Quick natural-language command in the Shogun pane Karo and Ashigaru panes reacting in parallel

One Karo (manager) coordinating 7 Ashigaru (workers) + 1 Gunshi (strategist) — real session, no mock data.


Quick Start

Requirements: tmux, bash 4+, at least one of: Claude Code / Codex / Copilot / Kimi / OpenCode / Antigravity

git clone https://github.com/yohey-w/multi-agent-shogun
cd multi-agent-shogun
bash first_setup.sh                        # one-time setup: config, dependencies, MCP
source ~/.bashrc                           # reload PATH
claude --dangerously-skip-permissions      # first run only: OAuth + accept Bypass Permissions → /exit
bash shutsujin_departure.sh                # launch all agents

For full install steps (incl. Windows) and the first-30-minutes walkthrough, see 🚀 Quick Start and the basic usage section below.

Type a command in the Shogun pane:

"Build a REST API for user authentication"

Shogun delegates → Karo breaks it down → 7 Ashigaru execute in parallel. You watch the dashboard. That's it.

Want to go deeper? The rest of this README covers architecture, configuration, memory design, and multi-CLI setup.


What is this?

multi-agent-shogun is a system that runs multiple AI coding CLI instances simultaneously, orchestrating them like a feudal Japanese army. Supports Claude Code, OpenAI Codex, GitHub Copilot, Kimi Code, OpenCode, Cursor, and Antigravity.

Why use it? - One command spawns 7 AI workers + 1 strategist executing in parallel - Zero wait time — give your next order while tasks run in the background - AI remembers your preferences across sessions (Memory MCP) - Real-time progress on a dashboard

        You (上様 / The Lord)
             │
             ▼  Give orders
      ┌─────────────┐
      │   SHOGUN    │  ← Receives your command, delegates instantly
      └──────┬──────┘
             │  YAML + tmux
      ┌──────▼──────┐
      │    KARO     │  ← Distributes tasks to workers
      └──────┬──────┘
             │
    ┌─┬─┬─┬─┴─┬─┬─┬─┬────────┐
    │1│2│3│4│5│6│7│ GUNSHI │  ← 7 workers + 1 strategist
    └─┴─┴─┴─┴─┴─┴─┴────────┘
       ASHIGARU      軍師

Why Shogun?

Most multi-agent frameworks burn API tokens on coordination. Shogun doesn't.

Claude Code Task tool Claude Code Agent Teams LangGraph CrewAI multi-agent-shogun
Architecture Subagents inside one process Team lead + teammates (JSON mailbox) Graph-based state machine Role-based agents Feudal hierarchy via tmux
Parallelism Sequential (one at a time) Multiple independent sessions Parallel nodes (v0.2+) Limited 8 independent agents
Coordination cost API calls per Task Token-heavy (each teammate = separate context) API + infra (Postgres/Redis) API + CrewAI platform Zero (YAML + tmux)
Multi-CLI Claude Code only Claude Code only Any LLM API Any LLM API 7 CLIs (Claude/Codex/Copilot/Kimi/OpenCode/Cursor/Antigravity)
Observability Claude logs only tmux split-panes or in-process LangSmith integration OpenTelemetry Live tmux panes + dashboard
Skill discovery None None None None Bottom-up auto-proposal
Setup Built into Claude Code Built-in (experimental) Heavy (infra required) pip install Shell scripts

What makes this different

Zero coordination overhead — Agents talk through YAML files on disk. The only API calls are for actual work, not orchestration. Run 8 agents and pay only for 8 agents' work.

Full transparency — Every agent runs in a visible tmux pane. Every instruction, report, and decision is a plain YAML file you can read, diff, and version-control. No black boxes.

Battle-tested hierarchy — The Shogun → Karo → Ashigaru chain of command prevents conflicts by design: clear ownership, dedicated files per agent, event-driven communication, no polling.


Why CLI (Not API)?

Most AI coding tools charge per token. Running 8 Opus-grade agents through the API costs $100+/hour. CLI subscriptions flip this:

API (Per-Token) CLI (Flat-Rate)
8 agents × Opus ~$100+/hour ~$200/month
Cost predictability Unpredictable spikes Fixed monthly bill
Usage anxiety Every token counts Unlimited
Experimentation budget Constrained Deploy freely

"Use AI recklessly" — With flat-rate CLI subscriptions, deploy 8 agents without hesitation. The cost is the same whether they work 1 hour or 24 hours. No more choosing between "good enough" and "thorough" — just run more agents.

Multi-CLI Support

Shogun isn't locked to one vendor. The system supports 7 CLI tools, each with unique strengths:

CLI Key Strength Default Model
Claude Code Battle-tested tmux integration, Memory MCP, dedicated file tools (Read/Write/Edit/Glob/Grep) Claude Sonnet 4.6
OpenAI Codex Sandbox execution, JSONL structured output, codex exec headless mode, per-model --model flag gpt-5.3-codex / gpt-5.3-codex-spark
GitHub Copilot Built-in GitHub MCP, 4 specialized agents (Explore/Task/Plan/Code-review), /delegate to coding agent Claude Sonnet 4.6
Kimi Code Free tier available, strong multilingual support Kimi k2
OpenCode Shared AGENTS.md instructions, agent-specific definitions via --agent, /new context reset, restart-only model changes, deterministic interactive TUI launch, provider-qualified --model routing provider/model
Cursor Auto-loads CLAUDE.md/AGENTS.md/.cursor/rules/, built-in web search, inbox-write skill via .cursor/skills/, /model live switching, --yolo auto-run Varies
Antigravity CLI Google Antigravity CLI integration via agy, host-managed auth, YOLO-style launch, gemini/agy legacy aliases host default / last-used

OpenCode sessions load the agent-specific .opencode/agents/<agent_id>.md definition via --agent and keep automation resets on /new; model changes require a relaunch. Automation uses the repository-provided config/opencode-tui.json via OPENCODE_TUI_CONFIG, which disables app_exit and pins session_interrupt/input_clear to known bindings. Role boundaries are embedded in the generated agent frontmatter: Shogun can read queue/reports/* for oversight but cannot write them, Karo is limited to coordination files plus report aggregation, Ashigaru only touch their own task/report pair, and Gunshi reads ashigaru reports but only writes gunshi_report.yaml.

Antigravity sessions launch with agy --dangerously-skip-permissions. Shogun treats type: antigravity, type: agy, and legacy type: gemini as Antigravity. Authentication and default model selection stay in the host user's Antigravity CLI setup; settings.yaml may optionally pass a concrete model, but auto uses the host default or last-used model.

A unified instruction build system generates CLI-specific instruction files from shared templates:

instructions/
├── common/              # Shared rules (all CLIs)
├── cli_specific/        # CLI-specific tool descriptions
│   ├── claude_tools.md  # Claude Code tools & features
│   ├── copilot_tools.md # GitHub Copilot CLI tools & features
│   ├── opencode_tools.md # OpenCode tools, agent frontmatter, and permission model
│   └── cursor_tools.md  # Cursor Agent tools, skills, and session rules
└── roles/               # Role definitions (shogun, karo, ashigaru)
    ↓ build
CLAUDE.md / AGENTS.md / .github/copilot-instructions.md / .opencode/agents/*.md / .cursor/rules/*.md
  ← Generated per CLI

One source of truth, zero sync drift. Change a rule once, all CLIs get it.


Bottom-Up Skill Discovery

This is the feature no other framework has.

As Ashigaru execute tasks, they automatically identify reusable patterns and propose them as skill candidates. The Karo aggregates these proposals in dashboard.md, and you — the Lord — decide what gets promoted to a permanent skill.

``` Ashigaru finishes a task ↓ Notices: "I've done this pattern 3 times across different projects" ↓ Reports in YAML: skill_candidate: found: true name: "api-endpoint-scaffold" reason: "Same REST scaffold pattern used in 3 projects" ↓ Appears in dashboard.md → You approve → Skill created in .claude/commands/ ↓ Any agent can now invoke /api-

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR