Watch
0
0
Fork
You've already forked hyperhive
0
a swarm o agents, each in its own nspawn cage, gossiping over unix sockets. config changes flow as git commits, the operator approves them in a browser, every deploy is a tag. cyberpunk-themed dashboard included. 💜⚡
  • Rust 64%
  • Nix 22.3%
  • JavaScript 4.8%
  • TypeScript 4.4%
  • CSS 3%
  • Other 1.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-01 20:31:14 +02:00
.forgejo/workflows ci: internal jobs skip on the public forge instead of waiting for a hive-ci runner 2026-09-28 19:28:23 +02:00
branding swarm-ui: make it installable as a PWA 2026-09-12 11:30:20 +02:00
claude-plugins claude-plugins: format the swarm-logs skill with nix fmt 2026-09-17 15:17:33 +02:00
docs forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
frontend forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
hive-agent hive-agent: export ACP-reported cost and context fill over OTLP 2026-09-30 22:24:06 +02:00
hive-agent-mcp remove the create_repo agent tool 2026-10-01 09:04:17 +02:00
hive-agent-sock hive-c0re: render the new agent option paths into generated agent flakes 2026-09-17 20:19:30 +02:00
hive-bash-mcp hive-bash-mcp: drop the redundant output-path line from status's description 2026-09-13 15:56:10 +02:00
hive-c0re forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
hive-core-agent-sock remove the create_repo agent tool 2026-10-01 09:04:17 +02:00
hive-forge forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
hive-forge-notify hive-forge-notify: a failed assigned-count poll leaves the rollup todo unchanged 2026-09-27 05:12:39 +02:00
hive-host-sock matrix: swarm-controller is the only minter 2026-09-30 00:46:46 +02:00
hive-jobq treefmt: apply prettier 2026-09-02 15:25:07 +02:00
hive-jobq-metrics move otel_http_client from swarm-queue-client into swarm-controller 2026-08-29 11:17:24 +02:00
hive-jobq-wire address review: move parse_states/filter_nodes_by_state to hive-jobq-wire, rename placeholder enums, trim core-mirroring framing 2026-08-16 16:59:54 +02:00
hive-log log: send records natively to journald, keep stdout off-unit 2026-09-21 15:52:57 +02:00
hive-matrix-mcp matrix: the agent's daemon pulls its linked accounts from bao itself 2026-10-01 17:43:28 +02:00
hive-metric docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
hive-priv forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
hive-priv-sock forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
hive-runtime hive-runtime: re-export ACP_API_KEY_ENV_ENV 2026-09-30 22:55:03 +02:00
hive-screen-mcp hive-screen-mcp: bound grim/wtype and VNC calls; hive-c0re: make messages match the code 2026-09-27 20:47:06 +02:00
hive-sh4re remove the create_repo agent tool 2026-10-01 09:04:17 +02:00
hive-sock-client remove the create_repo agent tool 2026-10-01 09:04:17 +02:00
hive-subagent-mcp hive-runtime: read the ACP provider key from bao 2026-09-30 22:55:03 +02:00
hive-types swarm-controller: refuse a new agent name the forge would reject 2026-09-24 15:16:32 +02:00
hivectl matrix: swarm-controller is the only minter 2026-09-30 00:46:46 +02:00
nix forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
scripts check-issue-refs.sh: scan .ini files too; drop tracker tags from .vale.ini 2026-09-20 18:59:46 +02:00
swagger-ui-theme treefmt: apply prettier 2026-09-02 15:25:07 +02:00
swarm-authelia-bridge check-issue-refs: catch full forge issue URLs too, drop internal links from docs entirely 2026-09-09 21:15:28 +02:00
swarm-authelia-bridge-sock feat(swarm-authelia-bridge): report a heal as its own outcome 2026-08-23 19:00:41 +02:00
swarm-controller forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
swarm-logs swarm-controller: read the queue client secret from the store, drop the file 2026-09-28 19:01:05 +02:00
swarm-matrix-client swarm-matrix-ctl: mint the swarm's own appservice registration 2026-09-25 08:31:01 +02:00
swarm-matrix-ctl matrix: swarm-controller is the only minter 2026-09-30 00:46:46 +02:00
swarm-nats-auth matrix: the agent's daemon pulls its linked accounts from bao itself 2026-10-01 17:43:28 +02:00
swarm-queue-client matrix: the agent's daemon pulls its linked accounts from bao itself 2026-10-01 17:43:28 +02:00
swarm-secret-client forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
swarmctl Make agent creation swarm-only and refuse a name placed on another hive 2026-09-29 15:47:40 +02:00
.gitignore docs: address review — redundancy proof for Passive, wave-2 split, re-enable Contractions 2026-09-07 11:56:31 +02:00
.mailmap chore(#2165): add damocles@pr1ma + lexis@pr1ma mailmap entries 2026-07-04 13:50:16 +02:00
.prettierignore swarm-logs-cli.md: regenerate from the binary, prettierignore it 2026-09-17 01:02:14 +02:00
.prettierrc temp: add prettier configs 2026-07-02 23:33:11 +02:00
.vale.ini check-issue-refs.sh: scan .ini files too; drop tracker tags from .vale.ini 2026-09-20 18:59:46 +02:00
Cargo.lock forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00
Cargo.toml hive-runtime: shared runtime crate with claude and acp backends 2026-09-29 22:29:36 +02:00
CLAUDE.md hive-runtime, hive-agent: model/effort picker for ACP agents from configOptions 2026-09-30 10:53:53 +02:00
clippy.toml swarm-logs: an agent's CLI for the swarm log store 2026-09-17 01:02:14 +02:00
flake.lock nix flake update 2026-10-01 05:01:18 +02:00
flake.nix nix: list nix/container-modules/ among the module trees 2026-09-29 19:51:46 +02:00
README.md README: reframe around multi-hive swarms, all-local quick start, agent amenities 2026-10-01 20:31:14 +02:00

hyperhive

a swarm of coding agents spread across NixOS hosts — every agent in its own nspawn cage, every host a hive, one control plane over all of them. config changes flow as git commits, the operator approves them in a browser, every deploy is a tag. cyberpunk dashboard included. 💜⚡

→ website · → docs · → options reference

A coding agent is great in one window, exponentielle across many — as long as the agents stay off each other's toes, keep a durable identity, and leave production alone. hyperhive is the substrate for that, as a set of NixOS modules:

  • a hive is one host running hive-c0re and the agent containers it owns;
  • a swarm is any number of hives sharing one identity plane — SSO, forge, matrix, secret store, telemetry — with a controller that places agents on hives and tracks them across all of them.

Start with everything on one box; move services and add hives as the swarm grows. Which host runs what is a per-host deploy.* toggle, not an architecture change.

concern how hyperhive answers it
scale-out hives share one directory (swarm.hives, identical on every host); swarmctl agent create --hive <h> places an agent and the controller keeps the roster
identity every agent gets swarm-wide accounts — SSO subject, forge user, matrix account, secret-store cert identity — and is addressable as name@hive.domain
shared plane one forge, homeserver, secret store, SSO, queue and metrics/logs stack per swarm, each on whichever host you put it
blast radius one nixos-container per agent; the host daemon runs unprivileged, and a tiny socket-activated helper does the few root ops
config git: an agent proposes, the operator approves, the deploy lands as a deployed/<id> tag
runtime claude --print by default; any ACP agent (e.g. opencode) per agent with services.hyperhive.agent.runtime = "acp"
watching per-agent web UI with a live terminal, a per-hive dashboard, the swarm UI, Grafana over OTEL

Shape

every hive (NixOS host, deploy.hive-controller.enable)
│
├── operator
│   ├── browser → :80/:443 (hive-gateway)   dashboard + /agent/<name>/ UIs
│   └── hivectl → /run/hyperhive/host.sock   admin protocol
│
├── hive-c0re     Rust daemon: lifecycle, broker, approvals, job queue,
│                 auto-rebuild, dashboard — runs as the unprivileged hive-core user
├── hive-priv     root helper, socket-activated, does bind-mounts + nsenter
├── hive-gateway  nginx + dnsmasq in front of c0re and every agent socket
│
└── agent containers
    ├── h-ruth    manager — privileged MCP surface, spawns + configures agents
    └── h-<name>  agent — claude / ACP runtime, MCP tools, web UI, own socket

the swarm's shared services (one host each — any hive, or a dedicated box)
│
├── hive-forge             Forgejo — per-agent accounts, config mirror
├── hive-matrix            tuwunel — matrix homeserver, per-agent accounts
├── swarm-bao              OpenBao — the swarm's secret store, cert auth per agent
├── swarm-controller       cross-hive state: hive directory, agent roster, jobs
│                          (+ swarmctl, + swarm-ui served off the gateway)
├── swarm-authelia         SSO in front of swarm-ui, forge, grafana, …
├── swarm-nats             message queue (JetStream KV: hive status, …)
├── swarm-otel             telemetry collector, sole holder of upstream creds
├── swarm-victoriametrics  metrics store
├── swarm-victorialogs     log store
├── swarm-grafana          dashboards over both stores
│
└── opt-in, not part of singleHostSwarm
    ├── hive-ci                Forgejo Actions runner (deploy.forgejo.ci)
    ├── swarm-snapshot-store   btrfs-receive endpoint for agent snapshots
    └── wg-hive                WireGuard mesh between hives (deploy.wireguard)

Inside an agent

Every agent is a full NixOS container with its own unix user (passwordless sudo inside the cage) and a durable, self-compacting session. Out of the box it gets:

  • messaging — send / recv to other agents and the operator, remind and recurring schedules to wake itself, and a todo list that forge notifications and other producers feed. → scheduling
  • background bash — long-running commands as tracked tasks (run / status / kill), so a build doesn't block the turn. → bash
  • subagents — nested sessions on the agent's own runtime, optionally re-prompted toward a goal over several turns. → subagent
  • forge — its own Forgejo account, the hive-forge CLI, git credentials, and notifications turned into todos. Optional linked accounts on other forges, and GitHub (gh + push) via services.hyperhive.agent.github.enable. → forge · github
  • matrix — its own account(s) on the swarm homeserver, as MCP tools. → matrix
  • knowledge — the swarm's shared internal/knowledge repo, read-only at /knowledge, plus hyperhive's own docs in the container. → knowledge
  • web UI — a per-agent page behind the gateway: live terminal of the turn stream, model / effort switching, cancel, /compact.
  • GUI (opt-in, services.hyperhive.agent.gui.enable) — a Wayland desktop with screenshot / keyboard / mouse tools, viewable over VNC in the web UI.
  • your own tools — any extra MCP server (stdio or http) via services.hyperhive.agent.extraMcpServers, and any NixOS config you'd put on a machine.

Quick start: an all-local swarm

The whole swarm on one box — a hive plus every shared service. Good for a dev box or a single-host deployment; docs/swarm/ covers spreading a swarm across hosts.

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
    hyperhive.url = "git+https://forge.darkest.space/hyperhive/hyperhive";
    hyperhive.inputs.nixpkgs.follows = "nixpkgs"; # see "Overriding nixpkgs"
  };

  outputs = { nixpkgs, hyperhive, ... }: {
    nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        hyperhive.nixosModules.default # the whole host stack, one import
        {
          services.hyperhive = {
            deploy.singleHostSwarm = true;        # run everything on one machine

            swarm.domain = "hive.example";        # the swarm's DNS domain
            hiveName = "pr1ma";                   # this hive's label in it
            swarm.hives.pr1ma = { };              # the directory: just us

            # c0re.operatorPronouns = "they/them"; # default "she/her"
          };

          # ... the rest of your host config
          system.stateVersion = "25.11";
        }
      ];
    };
  };
}

singleHostSwarm turns on everything an all-on-one-box swarm implies: the shared services above, the swarm CA, the swarm controller, and /etc/hosts entries so the hive's names resolve on the box itself. claude-code is unfree — hyperhive scopes the allowance to itself, so there's nothing to set.

After nixos-rebuild switch, hive-c0re creates the manager (ruth) and keeps every container rebuilt whenever its hyperhive rev goes stale. A few steps stay deliberately human — initialising the secret store, giving ruth her store identity, adding a gateway login, SSO. Walk through docs/getting-started/setup.md once, top to bottom.

Overriding nixpkgs

hyperhive pins its own nixpkgs so it builds standalone in CI. The follows line above builds it against your host's nixpkgs instead: one evaluation, no version drift. It works as long as your channel is close to the nixos-26.05 hyperhive develops against — drop it if a much older or newer channel breaks in ways hyperhive's CI doesn't catch.

Operating it

  • hivectl — the hive's operator CLI, on every hive host: agents, approvals, gateway logins, container shells. Talks to hive-c0re over /run/hyperhive/host.sock. → guide · full reference
  • swarmctl — the swarm's operator CLI, on the swarm-controller host: creating agents with their identities, SSO users, forge admins. → reference
  • Dashboard — approvals, agent state, the job graph, per-agent terminals. → docs/web-ui/

Human accounts come from SSO: a first login through authelia creates your forge and matrix accounts; swarmctl forge make-admin <you> promotes the forge one.

docs/README.md is the index, grouped by question — pick the page for your task rather than reading front to back. Some common entry points:

Hacking on it

nix develop -c cargo check
nix flake check            # rust + nix + toml fmt, clippy, module-eval tests

# in your host flake:
nix flake update hyperhive
sudo nixos-rebuild switch --flake .#<host>

Conventions (commit style, no #[allow(clippy::…)], the pre-push hook) live in docs/process/conventions.md. Issues + backlog are on the forge.