agent-relay metrics
Walk the local session store and print a rollup of token counts,
estimated dollar cost, and wall time. Operates entirely on files in
.agent-relay/sessions/ — no network calls, no telemetry.
Synopsis
terminal
agent-relay metrics [flags]With no flags, prints a per-session table for the current repo's history.
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--chain | session id | none | Only include sessions descended from the given start via resume-packet links. |
--by | session|agent|day | session | Group rows by session (default), agent name, or day. |
--since | duration or ISO date | none | Window the rollup. Accepts 7d, 24h, or 2026-04-01. |
--agent | name | none | Filter to a single agent. Repeatable. |
--json | flag | false | Emit JSON instead of the formatted table. |
--no-color | flag | false | Disable ANSI colors. |
Sample output
text
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 each session ran. The rate table ships inside
agent-relay-tool and refreshes only on agent-relay-tool upgrades —
metrics never hits the network.
Examples
Exit codes
| Code | Meaning |
|---|---|
0 | Rollup printed successfully. |
1 | The requested --chain start doesn't exist. |
2 | No sessions matched the filters. |