Git-Backed Cells Let Agent Swarms Survive Context Death

articletoolaiagent-loopsopencodemulti-agentcoordinationgitmemory

Swarm's git-backed cells, file reservations, and checkpoints map cleanly to joelclaw workload handoffs and clawmail-style reservation discipline.

Swarm Tools is a site for the opencode-swarm-plugin, a set of primitives for coordinating multi-agent coding work in OpenCode. The pitch is simple: break big tasks into pieces, spawn workers in parallel, keep them from stepping on each other, and remember what worked.

The clever bit is not “more agents.” More agents without coordination is just more chaos with a higher token bill. The useful move is turning work into durable cells: decomposed tasks, file reservations, checkpoints, and completion signals that can be tracked outside one fragile chat context.

That makes the workflow feel more like a tiny state machine than a vibes-based prompt party: decompose → reserve → work → checkpoint → complete → learn. The Git-backed .hive/ layer matters because it gives the swarm a boring, inspectable substrate. Boring is good. Boring survives context death.

This connects hard to joelclaw: Inngest, Restate, and the workload rig already care about resumability, handoffs, and visible state. Swarm Tools is a useful adjacent pattern for making parallel agent work less fucky: reserve files, checkpoint progress, record outcomes, and let the next agent pick up the trail.

Key Ideas

  • Swarm Tools frames AI coding agents as single-threaded, context-limited workers that need decomposition, coordination, memory, and recovery.
  • The opencode-swarm-plugin provides task decomposition, file reservations, parallel workers, skills, and learning signals for OpenCode.
  • Work items live as git-backed cells in .hive/, which makes agent progress inspectable and portable through Git instead of trapped inside one model context.
  • File reservations via Swarm Mail prevent parallel workers from editing the same files at the same time.
  • Checkpoint and recovery tools like swarm_progress, swarm_checkpoint, and swarm_recover store modified files, strategy, progress, directives, and error context in libSQL / SQLite.
  • The learning loop promotes fast successful patterns and demotes slow or error-prone patterns into anti-patterns.
  • Optional tools extend the loop: CASS searches past agent sessions, and UBS scans completed subtasks for bugs.