Hivemind

From The Hei Canon

hivemind is the perpetual idle-nudge broadcaster for the Heiervang Technologies fleet. Sends a slim "you have spare cycles" ping to every idle agent, pointing them at /home/me/IDLE.md for the full "what to do when idle" guide. Keeping the ping thin is deliberate — the detail lives in the file, so context cost per agent stays low.

Script: ~/ht/agent-tools/bin/hivemind. Docs: ~/ht/agent-tools/docs/hivemind.md.

Single source of truth. An older shell function of the same name (in dotfiles) once shadowed this script with a hardcoded copy of the message. It drifted; the function was removed and its gum frontend folded into the script. Do not reintroduce the shadow.

The nudge

[hivemind nudge]
You have spare cycles. If you're unsure what to do, read /home/me/IDLE.md

Usage

hivemind [SEND_DELAY] [ROUND_DELAY] [PATTERN]
hivemind -i | --interactive          # gum-prompt for the params + confirm gate
hivemind --once [SEND_DELAY] [ROUND_DELAY] [PATTERN]   # one round, then exit
hivemind --dry-run [...]             # preview targets, send nothing
hivemind -h | --help
Arg Meaning Default
SEND_DELAY Pace between agents within a round 30s
ROUND_DELAY Pause between rounds 10m
PATTERN director broadcast glob (e.g. %*, claude*, %1?) %* (every pane)
Flag Effect
-i, --interactive gum-prompt for the three params, optional target preview, confirm gate
--once Run a single round and exit (no loop)
--dry-run Forward --dry-run to director broadcast — show who'd be hit, send nothing
--strict Forward --strict (non-zero exit if any per-target send fails)

By default hivemind loops: each round broadcasts one nudge per matching agent (paced by SEND_DELAY), then sleeps ROUND_DELAY before the next round. Ctrl-C stops it and prints a summary.

hivemind                     # loop: 30s between agents, 10m between rounds
hivemind 1m 15m              # loop: 1m stagger, 15m between rounds
hivemind --once              # nudge everyone once, then exit
hivemind --once 5s 'claude*' # one round to claude panes (ROUND_DELAY unused)
hivemind --dry-run           # preview targets without sending
hivemind -i                  # interactive launcher

Frontend

With gum installed and a real terminal, hivemind shows a rounded config banner (pattern, delays, guide path), a per-round header, round-completion timing, and a live spinner counting down to the next round — so an operator can watch it tick. When gum is absent or stdout isn't a TTY (agents, cron, pipes), it degrades to plain one-line output and never blocks on input.

The idle guide

/home/me/IDLE.md is the authoritative memo hivemind points at:

  • Orient — the action space of maintenance chores (PR / issue triage with an approved-author allowlist, CI health, docs, tests, tech debt, bug hunts, RFCs) plus project-type-specific work.
  • Triage — a ranked, lexicographic ordering of what to pick first.
  • Track — keep one active maintenance "epoch" issue, pursued as a long-running sprint.
  • Blocked on Hei? Leave a PR / draft + RFC and move on.

Every article on this wiki past the first four was seeded during a hivemind-nudged idle cycle.

Sources

  • ~/ht/agent-tools/docs/hivemind.md — the canonical documentation.
  • ~/ht/agent-tools/bin/hivemind — the script.
  • /home/me/IDLE.md — the idle guide the nudge points at.

See also