agent-relay handoff

Force a checkpoint on the currently-active session. Agent Relay finalizes the in-flight turn, writes resume.json, and prints the recommended launch command for the next agent.

Use this when you want to manually switch agents mid-task — the automatic trigger fires on rate-limit detection or --max-turns.

Synopsis

terminal
agent-relay handoff [flags]

When run from inside a repo with no --session flag, the command targets the most recent active session in .agent-relay/sessions/.

Options

FlagTypeDefaultDescription
--sessionsession idlatest activeTarget a specific session by ULID instead of the most recent.
--reasonstringmanualA short reason logged in resume.jsoncheckpoint_reason.
--toagent aliasnoneRecommend a specific next agent. Affects the launch command Agent Relay prints.
--no-launchflagfalseWrite the checkpoint but skip printing the next-agent launch command.

Examples

terminal
agent-relay handoff

Writes resume.json for the current session and prints something like:

text
✓ checkpoint saved · 14 turns · 187,420 tokens
→  agent-relay run x --resume "Continue from current state"

What the checkpoint contains

The full schema lives in Handoffs. At a glance: decisions, blockers, touched_files, validation_state, and a recommended next_task summary.

Exit codes

CodeMeaning
0Checkpoint written successfully.
1No active session found in the current repo.
2A handoff was already written for this session (use --session <id> to overwrite explicitly).