Watch & Metrics
Agent Relay records every turn to disk as it happens. That makes two things easy: watching an active session from another shell, and rolling up token cost across an entire chain of handoffs after the fact. Both are local, both work without any background daemon.
Watch — live session observation
agent-relay watch streams the active session in the current repo. It
reads from disk as new turn artifacts are written, so it works whether
your agent-relay run is in a parent shell, a tmux pane, or a CI job.
agent-relay watchWhat you'll see (one line per event):
turn 1 prompt sent 1,420 tokensturn 1 output returned 380 tokens · 2 tool callsturn 2 prompt sent 1,890 tokensturn 2 decision switched to pytestturn 3 blocker test_refresh_flow still redstatus rate-limit reached · checkpoint saved
Decisions and blockers come straight from the same fields that end up in
resume.json, so the watcher is also a live preview
of what the handoff packet will contain.
Metrics — token and cost rollup
agent-relay metrics walks the local session store and prints a rollup.
By default it reports the current repo's history:
agent-relay metricsOutput:
session agent turns tokens cost wall
─────────────────────────────────── ──────────── ─────── ───────── ──────── ──────
01J9X3M7K5VBHQEN6T2F4D8RPZ claude-code 14 187,420 $1.41 12m
01J9X9N7Q2C5VFGMP4HTSXKDBE codex 9 102,840 $0.78 6m
01J9XAEYR3D2BHQEN8T2F4D8RX claude-code 17 214,950 $1.62 14m
─────────────────────────────────── ──────────── ─────── ───────── ──────── ──────
total 505,210 $3.81 32mCost is estimated from each provider's published per-token rates as of
the time the session ran. The rate table ships with agent-relay-tool
and is refreshed on agent-relay-tool upgrades — there is no network
call at metrics time.
Common filters
agent-relay metrics --chain 01J9X3M7K5VBHQEN6T2F4D8RPZWalks the resume-packet links and only includes sessions that descend from the given start.
Why local-only matters
Both watch and metrics operate on files already on your disk. There
is no telemetry, no third-party service, no API key required. If you
delete .agent-relay/sessions/, the rollups disappear too — because the
source of truth is your repo, not a vendor's database.
This is the same property that makes Agent Relay safe to use on private codebases without an enterprise procurement review.