Skip to content

agent-relay: Build an Approve-Once Pipeline Across Coding Agents

AINewss Editorial

agent-relay chains Claude Code, Codex, Gemini CLI, Aider or any CLI into a plan-review-implement pipeline with one human gate. This guide covers the relaypipe install, bounded review loops, YAML configuration, resume and CI flags, plus the honest limits and four unrelated projects that share the name.

View 2 references
0 views 0 likes

Allow the functional cookie to save your likes. Privacy details

A relay-style diagram with three coding agent boxes and a single pause marker before commit, representing gated agent handoffs.

What is agent-relay?

agent-relay is a small coordination layer that chains coding CLIs into a pipeline where one agent plans, another reviews, and a third implements. Handoffs happen through files on disk, and the run pauses once for your approval just before anything is committed. The installable command is relaypipe.

The project is honest about its scope: it is not an agent itself. Reasoning happens inside the CLIs it calls. Its value is automatic handoff between different vendors, a bounded review loop with an explicit verdict marker, and a single approval gate you control.

How does the plan-review-implement handoff work?

You supply a target; the plan step writes PLAN.md, the review step writes a critique, and the implement step reads both before making changes. Each arrow is an automatic file handoff, and the only interruption is the final gate before commit. No copy-pasting between tools is needed.

The default shape looks like this:

target -> [plan: Claude] -> PLAN.md -> [review: Codex] -> review.md
       -> [implement: Codex] -> pause for your approval -> commit?

Swapping any box for a different agent is a one-line YAML change. That cross-vendor mix, such as planning with Claude and implementing with Codex, is the durable differentiator the project claims over single-vendor subagent systems.

Which coding agents does agent-relay support?

Built-in adapters cover Claude Code, Codex, Gemini CLI and Aider. A generic adapter wraps any command-line tool from YAML with no code, using placeholders such as {prompt}, {output}, {workspace}, {model} and {role}. A custom adapter class is roughly twenty lines.

- name: implement
  agent: generic
  command: ["mytool", "run", "--prompt", "{prompt}", "--out", "{output}"]

Adapters can be shipped as separate packages through the agent_relay.adapters entry point, so you do not need to fork the repository to add a tool.

How do you install and run agent-relay?

Install the relaypipe package with pipx, or install from source in a development checkout. The fastest path is the zero-config command that takes an idea and a directory, loops review until the plan is approved, then builds after you confirm.

pipx install relaypipe
# or from a checkout
pip install -e ".[dev]"

relaypipe agents
relaypipe new "a todo-list CLI in Rust with JSON persistence" -d ./todo-cli
relaypipe new "..." -d ./app --dry-run
relaypipe run --resume -p examples/pipeline.yaml
relaypipe run "..." -p pipeline.yaml --yes

--dry-run previews commands without calling any API, --resume continues an interrupted run, and --yes auto-approves gates for CI. The repository ships a self-hosted example that points agent-relay at its own PLAN.md.

How do review loops and the approval gate work?

A loops: block repeats a contiguous group of steps until a reviewer emits VERDICT: APPROVED or a hard cap is reached. The default cap is three iterations, overridable per run with --max-iterations. The human gate still backstops the run even if the cap is hit.

steps:
  - name: plan
    agent: claude
    role: plan
    inputs: [PLAN.md, .agent-relay/review.md]
    output: PLAN.md
  - name: review
    agent: codex
    role: review
    inputs: [PLAN.md]
    output: .agent-relay/review.md
  - name: implement
    agent: codex
    role: implement
    inputs: [PLAN.md]
    approve_after: true

loops:
  - name: plan-review
    steps: [plan, review]
    until_step: review
    max_iterations: 3
    approved_marker: "VERDICT: APPROVED"

Feedback travels through the ordinary file handoff: the review output is listed as an input of the first step, so the next pass sees the previous critique. If the cap is reached without approval, the run logs a stop message and proceeds to the gate.

When should you not use agent-relay?

Skip agent-relay when one tool's native plan mode, subagents or hooks already cover your workflow. A shell script is enough for a fixed chain that never needs retries or resume, and CI workflows fit handoffs that should happen after pushes or pull requests.

Situation Better option
Everything inside one CLI That tool's plan mode and subagents
Fixed chain, no retries Shell script or Makefile
Handoff after a push or PR CI workflow
Teaching one agent a repeatable routine Skills, plugins or slash commands
Mixing agents from different vendors agent-relay

The project lists further limits: it is a thin wrapper, handoffs are text based and brittle if CLI output formats change, and structured JSON handoffs are the top roadmap item. Tests use mocked agents and need no API keys; the licence is MIT.

Is agent-relay the same as other projects with that name?

No. At least four unrelated repositories use "agent-relay" or "AgentRelay": a portable handoff-bundle CLI, a Windows desktop copilot platform, a Nostr-based agent relay network, and a Go orchestration platform. The relaypipe project described here is the one whose README explicitly chains CLIs into an approve-once pipeline.

Does agent-relay write code itself?

No. It coordinates tools that already write code. All planning, review and implementation happens in the agent CLIs; agent-relay manages order, files, retry loops and the approval pause.

Is it safe to run unattended?

Only with --yes in a controlled CI context. The intended design keeps a human at the final gate. The project describes itself as a coordination layer, not a safety layer, so review the generated diff yourself before committing.

Bottom line

agent-relay is worth trying when you want to mix vendors in one bounded, reviewable pipeline and you need resume plus retry behaviour that a shell script does not give you. It is not worth adding when a single tool already does the job. Read the linked repository before adopting, since this is a small, actively changing project.

References

  1. yuzhiquan/agent-relay READMEgithub.com
  2. yuzhiquan/agent-relay Chinese READMEgithub.com