Handoff to another agent

Inside the interactive shell, use /use for the normal handoff path:

text
/use codex
/use claude
/use gemini
/use opencode

/use is the most ergonomic REPL path. If there is live context, Relay routes the switch through the same handoff machinery before activating the target.

The scriptable handoff surface is the target agent command:

terminal
agent-relay codex --task "Continue from the current state"
agent-relay claude --task "Review the Codex changes"
agent-relay gemini --task "Audit this plan"
agent-relay opencode --task "Finish the integration pass"

The slash equivalents are available when you want to force a packet without changing the active agent:

text
/relay codex
/handoff codex

Synopsis

terminal
agent-relay <agent> [flags]

<agent> is one of claude, codex, gemini, or opencode, plus any configured alias accepted by the agent resolver.

Options

FlagTypeDescription
--fromagentSource agent, inferred when omitted.
--task, -tstringWhat the target agent should do next.
--planning-notestringExtra planning context to preserve.
--planning-note-filepathRead planning context from a file.
--proposed-editsstringProposed edits that are not yet applied.
--proposed-edits-filepathRead proposed edits or a diff from a file.
--no-launchflagPrepare the packet without launching the target.
--no-auto-compactflagSkip the pre-handoff compaction sweep.
--yes, -yflagSkip confirmation prompts.
--repopathRepository path; defaults to the current directory.

Examples

terminal
agent-relay codex --task "Continue the release prep"

Captures the current observable repo/session state and prepares Codex to continue.

Automatic handoff

When relay install wires hooks and the REPL is running, rate-limit events can trigger the same handoff path automatically. The fallback order is stored in ~/.config/relay/config.toml under [handoff].order and can be set with:

terminal
relay install --handoff-order claude codex gemini opencode