Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alchaincyf avatar

Huashu Agent Swarm

  • 584 installs
  • 1.3k repo stars
  • Updated August 2, 2026
  • alchaincyf/huashu-skills

huashu-agent-swarm is a Claude Code skill that launches parallel git-coordinated Claude agents via tmux so developers can divide large coding projects without a central master controller.

About

huashu-agent-swarm is a Claude Code skill inspired by Nicholas Carlini's 16-instance C compiler experiment. It runs multiple independent Claude CLI agents in tmux sessions that claim tasks from TASKS.md, write code, and push through git with no master orchestrator. Setup runs bash scripts/setup_project.sh to generate AGENT_PROMPT.md, TASKS.md, and a current_tasks/ claim directory inside an existing git repository. Developers reach for huashu-agent-swarm when a monolithic agent session cannot keep pace with a large refactor, greenfield build, or parallel feature track. Default configuration starts 8 agents, and prerequisites include tmux, the Claude CLI, and a git repo with defined test commands.

  • Pure Git-based self-organization with no master agent
  • Each agent independently pulls, claims tasks, codes, and pushes in an infinite loop
  • Supports 8+ parallel agents using tmux sessions and isolated git worktrees
  • Real-time dashboard at localhost:8420 for monitoring progress and sending live instructions
  • Full lifecycle scripts: setup, start, status, stop, and automatic branch merging on shutdown

Huashu Agent Swarm by the numbers

  • 584 all-time installs (skills.sh)
  • Ranked #1,612 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/alchaincyf/huashu-skills --skill huashu-agent-swarm

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs584
repo stars1.3k
Last updatedAugust 2, 2026
Repositoryalchaincyf/huashu-skills

How do you run parallel Claude agents on one git repo?

Orchestrate multiple parallel Claude agents that self-organize via Git to tackle large, complex coding projects without a central master controller.

Who is it for?

Developers tackling large codebases who already use Claude CLI, tmux, and git and want decentralized parallel implementation without manual task handoffs.

Skip if: Developers on small single-file changes, teams without git discipline, or environments where tmux and Claude CLI are unavailable.

When should I use this skill?

User mentions agent swarm, 蜂群模式, multi-agent parallel development, or infinite agent loop for a git-backed project

What you get

AGENT_PROMPT.md, TASKS.md, current_tasks/ claim files, parallel tmux agent sessions, and git commits from coordinated workers

  • AGENT_PROMPT.md
  • TASKS.md
  • parallel agent git commits

By the numbers

  • Defaults to 8 parallel Claude agents
  • Inspired by Nicholas Carlini's 16-instance autonomous C compiler experiment
  • Scaffolds AGENT_PROMPT.md, TASKS.md, and current_tasks/ during setup

Files

SKILL.mdMarkdownGitHub ↗

Infinite Agent Loop - 无限Agent蜂群模式

受Nicholas Carlini用16个Claude实例自主构建C编译器的启发。
没有master agent,纯git自组织,每个agent独立认领任务、写代码、推送。

触发条件

当用户提到「蜂群模式」「多agent并行」「infinite loop」「agent swarm」「启动蜂群」时使用此技能。

前置要求

  • tmux(brew install tmux
  • claude CLI(已安装)
  • git 仓库(已有或新建)

使用流程

Step 1: 描述项目

用户告诉我:

  • 项目目录路径(必须是git仓库)
  • 项目目标和总体描述
  • 初始任务列表(或让agent自行拆解)
  • agent数量(默认8个)
  • 代码规范和测试命令

Step 2: 初始化项目

bash SKILL_DIR/scripts/setup_project.sh <项目目录>

这会在项目中创建:

  • AGENT_PROMPT.md - 从模板生成,需要我根据用户需求定制
  • TASKS.md - 初始任务清单
  • current_tasks/ - 任务认领目录
  • agent_logs/ - 日志目录

然后我根据 references/agent-prompt-template.md 定制 AGENT_PROMPT.md,填入项目具体信息。

Step 3: 启动蜂群

bash SKILL_DIR/scripts/start_swarm.sh <agent数量> <项目目录>

这会: 1. 为每个agent创建 git worktree(共享.git对象库,不浪费磁盘) 2. 创建 tmux session,每个pane一个agent 3. 每个agent进入无限循环:pull → 认领任务 → 执行 → push → 下一个

Step 4: 打开观测台

python3 SKILL_DIR/scripts/dashboard.py <项目目录> 8420

浏览器打开 http://localhost:8420,可以:

  • 实时查看所有agent状态、git log、任务进度
  • 查看每个agent的最新日志
  • 输入框直接发送指令给agent(写入HUMAN_INPUT.md)
  • 一键停止所有agent

也可以用命令行监控:

# 终端状态
bash SKILL_DIR/scripts/status.sh <项目目录>

# 发送指令
bash SKILL_DIR/scripts/send_input.sh <项目目录> "你的指令"

# 直接进入tmux观察
tmux attach -t swarm-<项目名>

Step 5: 停止

bash SKILL_DIR/scripts/stop_swarm.sh <项目目录>

自动停止所有agent + 合并分支 + 清理worktrees。

核心机制

Git自组织协调

  • 每个agent通过 current_tasks/*.lock 文件认领任务
  • 通过 TASKS.md 了解全局进度
  • 通过 git log 了解其他agent的工作
  • 冲突由agent自行解决

Git Worktree隔离

  • 不用多份clone,用 git worktree 实现隔离
  • 所有worktree共享同一个 .git 对象库
  • 每个agent在自己的worktree独立工作

无限循环

  • 每个agent完成一个session后自动开始下一个
  • 通过 git pull 获取其他agent的最新成果
  • 通过 sleep 间隔避免API限流

关键配置

参数默认值说明
agent数量8可在启动时指定
sleep间隔5秒agent_loop.sh中可调
模型claude-opus-4-6agent_loop.sh中可调

风险和应对

风险应对
API限流sleep间隔 + 可调agent数量
合并冲突AGENT_PROMPT指导小粒度commit
死循环无用功日志监控 + 停止条件
磁盘空间stop_swarm.sh自动清理
成本失控可在AGENT_PROMPT中限制session数

---

花叔出品 | AI Native Coder · 独立开发者
公众号「花叔」| 30万+粉丝 | AI工具与效率提升
代表作:小猫补光灯(AppStore付费榜Top1)·《一本书玩转DeepSeek》

Related skills

How it compares

Choose huashu-agent-swarm when you want decentralized git-based parallel agents instead of a single sequential Claude session or a centrally scripted pipeline.

FAQ

What does huashu-agent-swarm require before starting?

huashu-agent-swarm requires tmux (install via brew install tmux), an installed Claude CLI, and a project directory that is already a git repository. The setup script also expects a defined test command and coding standards from the developer.

How many agents does huashu-agent-swarm launch by default?

huashu-agent-swarm defaults to 8 parallel Claude agents, each running in its own tmux session. Developers can adjust agent count when describing the project, and each agent independently claims tasks from TASKS.md and pushes git commits.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.