agent-relay run

Start a new managed session — capture every turn, decision, and tool call under .agent-relay/sessions/ while the agent works on the task you give it.

Synopsis

terminal
agent-relay run <agent> "<prompt>" [flags]

<agent> is the adapter name or one of its built-in aliases:

AdapterAliasBacked by
claude-codecClaude Code CLI
codexxOpenAI Codex CLI

Run agent-relay discover to see which adapters are installed on the current machine.

Options

FlagTypeDefaultDescription
--max-turnsintunlimitedHard cap on turns before Agent Relay stops the session.
--resumeflagfalseStart by reading the latest resume.json in the repo and feeding it to the agent as context.
--fromsession idlatestWhen combined with --resume, pick a specific session to resume from.
--watchflagfalseOpen a live watcher in the same terminal — equivalent to agent-relay watch in another shell.
--no-colorflagfalseDisable ANSI colors in Agent Relay's own output (the agent's output is untouched).
--configpath.agent-relay/config.tomlOverride the config file path.

Examples

terminal
agent-relay run c "Fix the failing auth tests"

Starts a Claude Code session on the current repo. Captures every turn to .agent-relay/sessions/<id>/turns/.

Exit codes

CodeMeaning
0Session completed cleanly.
1Session ended in an unrecoverable error (see meta.jsonerror).
2Session checkpointed for handoff (rate limit, manual stop, --max-turns reached). A resume.json is on disk.
127The requested agent adapter is not installed. Run agent-relay discover.