machinations

// On-deck

Relay

A multi-agent plugin featuring an in-flight handoff sequence and 'set it and forget it' functionality

Relay preview
Claude Code(CLI)Bash

Relay is a two-agent handoff protocol for Claude Code that keeps long-running batch work moving across context-window boundaries. A "Worker" agent processes a queue while a parked "Sleeper" agent waits in a second window. When the Worker hits a configured threshold — N completions, or a named pipeline step — it serializes its progress to a set of flat Markdown files, flips a status flag, and stands down. A background polling watcher detects the flip, wakes the Sleeper, and the Sleeper picks up the queue exactly where the Worker left off. The two windows then swap roles, and the cycle continues until the batch is complete.

The design is deliberately minimal: no daemon, no message queue, no database. The entire protocol runs on file existence, file contents, and a 20-second Bash polling loop, which makes it portable across projects without modification and easy to recover from manually when something goes wrong. A small Relay Contract — one conditional step added to any batch command — is all that's required to make a workflow relay-compatible. State files, signaling, threshold tracking, and handoff timing are handled by the skill layer, not the command.

Beyond the mechanics, Relay tackles a class of failure modes specific to autonomous agent workflows: Agentic Infinite Loops (where two agents hand off a task that isn't actually advancing), silent path mismatches between windows, and orphaned handoffs when no Sleeper is parked. Each of these is caught by an explicit decision gate — a threshold check, a presence check, and a progress diff against the previous handoff — so the system fails loudly and recoverably rather than burning tokens in the dark.