coding.sh stats
Sessions, failures, cost, tokens and latency per day or week, split by agent, model, repo or flag. Every option of coding.sh stats, from its own --help.
coding.sh stats [options]
Sessions, failures, cost, tokens and latency per day or week, split by agent, model, repo or flag
Options
-m, --measure <MEASURE> What the trend shows (default: sessions)
--by <GROUP> One row per group, with its trend (default: one row per day or week)
--per <BUCKET> Bucket size (default: day)
--since <WHEN> Only at or after this time: 7d, 12h, 30m, today, yesterday or a date. A date without a zone is local time: 2026-11-09 is local midnight (default: 30d)
--until <WHEN> Only before this time (exclusive): 7d, 12h, today or a date in local time; --until 2026-11-09 leaves that day out (default: now)
--all Count subagent sessions as their own rows (default: top-level sessions only)
--where <QUERY> Only sessions matching a query, e.g. 'agent:codex cost>0.5 tool:Bash -flag:compaction' (keys: coding.sh sessions --help)
--fresh Wait for every pending capture to be ingested (default: answer after 1.5 s)
Examples
coding.sh stats
coding.sh stats --measure cost --by model --since 30d
coding.sh stats --measure failure-rate --by agent --per week --since 90d
Notes
Days and weeks start at local midnight (weeks on Monday). FAIL% = sessions with a failure flag (a flag with no colon). TOOL ERR% = failed tool calls / tool calls. P95 LLM = the 95th percentile of the sessions' own p95 model-call latency; TTFT = the median of their median time to first token.
With --by flag a session with several flags counts once in each; past the 6 largest groups the rest add up in "other". The same numbers: GET /api/metrics in coding.sh ui and coding.sh serve.
With --json, an answer given before every capture was indexed carries "pending": {"files": N, "indexing": true|false} (files still to ingest; indexing: an ingest is still running). The field is absent once all are indexed.