Grok Swarm
/install grok-swarm
Grok Swarm
Multi-agent intelligence powered by Grok 4.20 Multi-Agent Beta
Give any AI coding agent access to a 4-agent swarm with ~2M token context for code analysis, refactoring, generation, and complex reasoning.
- Version: 1.0.8
- Platforms: OpenClaw, Claude Code
- Modes: analyze, refactor, code, reason, orchestrate
Overview
Grok 4.20 coordinates 4 agents (orchestrator + specialists + critics) to:
- Analyze codebases for security, architecture, and bugs
- Refactor code while preserving behavior
- Generate features, tests, and boilerplate
- Reason through complex architectural decisions
Features
- 4-Agent Coordination — Multi-perspective reasoning
- Massive Context — ~2M token window
- File Writing — Write annotated code blocks directly to disk
- Tool Passthrough — Use OpenAI-format tools with Grok
Usage
OpenClaw
tools.grok_swarm({
prompt: "Analyze security of this auth module",
mode: "analyze",
files: ["src/auth/*.ts"]
});
Claude Code
/grok-swarm:analyze Review auth module security
/grok-swarm:refactor Convert to async/await
/grok-swarm:code Write FastAPI endpoint
Task Modes
| Mode | Description |
|---|---|
analyze |
Security audits, architecture review |
refactor |
Modernization, migration |
code |
Feature generation, tests |
reason |
Multi-perspective reasoning |
orchestrate |
Custom agent handoff |
Requirements
- Python 3.8+
- Node.js 18+
openai>=1.0.0- OpenRouter API key with Grok 4.20 access
API Key
Set your API key:
export OPENROUTER_API_KEY=sk-or-v1-...
Or create ~/.config/grok-swarm/config.json:
mkdir -p ~/.config/grok-swarm
echo '{"api_key": "sk-or-v1-..."}' > ~/.config/grok-swarm/config.json
chmod 600 ~/.config/grok-swarm/config.json
Installation
# Via ClawHub
clawhub install grok-swarm
# Via npm
npm install @khaentertainment/grok-swarm
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install grok-swarm - 安装完成后,直接呼叫该 Skill 的名称或使用
/grok-swarm触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Grok Swarm 是什么?
Refactors code using Grok 4.20 multi-agent swarm to improve readability, maintain behavior, add modern patterns, and explain changes. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 223 次。
如何安装 Grok Swarm?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install grok-swarm」即可一键安装,无需额外配置。
Grok Swarm 是免费的吗?
是的,Grok Swarm 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Grok Swarm 支持哪些平台?
Grok Swarm 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Grok Swarm?
由 Billy Brenner(@khaentertainment)开发并维护,当前版本 v1.0.9。