stats
Roadmap entry 109: Arthur keeps the tokens, cost and time of every job run and of every coordinator turn, in two append-only files of its own folder, <home>/stats/. It calls no model. Every cost is omp’s at list price, what the tokens would cost on the API, not money paid on a subscription.
Roadmap entry 111: the views of these files. arthur stats prints the spend of a span, the last 7 days by default, by role, project, model, day and ticket, with filters; /stats answers its total, by role and top 3 tickets on a channel; the morning report’s Spend section is the first two lines of arthur stats --since 1d (arthur stats --help).
Roadmap entry 110: the merged tickets’ report, which came with manage (61), is this plugin’s: arthur stats tickets prints it (arthur stats tickets --help), and the provided name stats.tickets, (project, since?) to the same report of the tickets merged at since or later, gives manage’s audit and retro prompts their ### Stats section (packages/manage/docs/manage.md).
Roadmap entry 112: arthur stats windows puts each usage window of the account, which the models plugin reads from the agent’s report and gives as models.windows, beside what Arthur spent at list price on that provider’s models in the window’s span, by role, each role’s part of the window an estimate marked ≈ and an upper bound, since the account’s use outside Arthur counts in the window too (arthur stats windows --help). Without the models plugin it says so in one line.
AR0739: arthur stats budget prints, per kind of ticket, what the workers of a project’s merged tickets cost, the median and the cost 9 in 10 stayed within, from the - Cost: line of each ticket’s outcome.md: the figure a worker’s budget is picked from (arthur stats budget --help).
plugins: [orchestration({}), stats()],It has no options but enabled; any other is refused at load (stats.<key>: unknown option; stats has no options but enabled).
Job runs: runs.jsonl
Section titled “Job runs: runs.jsonl”One line per job-ended, what that run added to the job’s record (arthur jobs --help, the record’s cost, usage and ran):
{"seq":812,"time":"2026-11-06T10:42:07.120Z","job":"2026-11-06-worker-0a1b2c3d","kind":"worker","project":"acme","tickets":["AC0012"],"machine":"local","state":"ended","reason":"finished","seconds":1260.5,"cost":3.4215,"usage":{"anthropic/claude-opus-5-5":{"messages":41,"input":120,"output":18200,"cacheRead":2100000,"cacheWrite":95000,"cost":3.4215}}}seqandtimeare the event’s;ticketsthe ids of the tickets its task names onTicket:;secondsthe time in the run,costUSD,usageper<provider>/<model>its messages, tokens and USD. A local model’s tokens come with a cost of 0.- Each number is the record’s total now less the job’s earlier lines: a continued job’s second run counts what it added, on the day it ran, and a second end of the same run (blocked, then stopped) adds 0.
- Only
arthur runwrites, once its plugins started. An end heard before (the replay of the event log at the start) waits for the start; a command’s process (arthur stop) hears its ownjob-endedand writes nothing. An end whoseseqis not above the highest one written is skipped, so a replay after a crash writes nothing twice. - A job whose record is already gone when its end is read (pruned while
arthur runwas down) gets a line with"missing": true, its numbers 0: unknown, not free. - The first start, with no
runs.jsonlyet, writes one"backfill": trueline, withoutseq, itstimethe record’ssince, for every recordarthur jobsstill holds whose run is over: its cost, seconds and tokens, the tokens only when its record hasusage(entry 108). A job then in a run gets its whole spend at its end. A job pruned before is not counted.
Coordinator turns: sessions/<session>.jsonl
Section titled “Coordinator turns: sessions/<session>.jsonl”The plugin gives orchestration an OMP extension, packages/stats/src/session-extension.ts, which the coordinator’s agent and each project agent’s load (arthur coordinator --help, coordinator.extension) with ARTHUR_STATS_FOLDER naming the plugin’s folder. At each real end of a turn (agent_end that does not go on) it appends one line to sessions/<session>.jsonl, the session being what ARTHUR_ORCHESTRATION_SESSION names, agent:<project> in a project agent’s (sessions/agent:shop.jsonl), else coordinator (sessions/coordinator.jsonl):
{"time":"2026-11-06T10:45:00.000Z","session":"coordinator","seconds":38.2,"until":1794480299512,"cost":0.8125,"usage":{"anthropic/claude-opus-5-5":{"messages":3,"input":9,"output":1400,"cacheRead":310000,"cacheWrite":4200,"cost":0.8125}}}- The numbers are those of the assistant messages whose
timestampis afteruntil, the last one counted, which the line keeps; at its start the extension reads it from the file’s last line withoutsub. So a turn that goes on after itsagent_end(willContinue) is counted once at its real end, and a restarted coordinator (--continue) counts none of the conversation it already counted. secondsruns from the turn’s firstagent_start.- A session without a UI, a
tasksubagent, writes its turns to the same file marked"sub": true[INFERENCE: omp loads the coordinator’s extensions into its subagents, as the other extensions’hasUIguards assume]. - The coordinator’s spend before the plugin is installed is not imported.
The files
Section titled “The files”- Each line is one append ending in a line break. A last line a crash cut gets its line break before the next one, and a reader skips a line it cannot parse.
- Each file has one writer:
runs.jsonlthe onearthur runof the home, a session’s file that session’s single omp. - Lines hold numbers, ids, kinds and model names, never text. The folder is outside Git, and
arthur pruneleaves it alone; the files are kept for ever. - omp’s own side calls (its compaction, the
--smolmodel) count only when they come as assistant messages, as for a job’scost.
arthur stats budget
Section titled “arthur stats budget”Usage: arthur stats budget [--project <name>]. Comes with the stats plugin (AR0739). Answered without the model, for one project, the main one unless --project names another; it runs inside a job too.
What the workers of a project’s merged tickets cost, per kind of ticket, so a worker’s budget is picked from what such a ticket cost before, not guessed: a budget at or under the median stops about every second worker of that kind before it is done, and each stop costs the owner a budget question.
Worker cost of the merged tickets of acme, by kind:feat: 12 tickets, median $5.82, 9 in 10 within $13.62fix: 7 tickets, median $2.28, 9 in 10 within $9.69docs: 1 ticket, median $1.53, 9 in 10 within $1.53Left out: 2 tickets whose outcome.md names no worker cost- One line per kind, the kind with the most tickets first, kinds with as many in name order. The kind is the one word of the
- Kind:line under the ticket’s## Goal(arthur ticket --help); a ticket without one, or whose line holds more than a word, counts underno kind. - The cost is the workers’ alone, the first amount of the
- Cost:line of the ticket’soutcome.md(arthur merge --help): every worker of the ticket and every run of each together, an earlier worker whose branch a fresh one took over included (AR0750); the reviews’ amount is not part of it, as a review has its own budget. medianand9 in 10 withinare each the cost of one of those tickets, by the nearest rank: with the costs in order, the one at half of them and the one at nine tenths of them, rounded up. Of 10 tickets they are the fifth and the ninth; of 11, the sixth and the tenth; of one, that ticket’s cost twice.- The coordinator’s role takes the
9 in 10 withinfigure of the ticket’s kind as a worker’s budget, in the approval question and at the spawn, and names it with this command as its source. - A merged ticket whose
outcome.mdis missing, has no- Cost:line, or saysn/afor the worker (a worker’s cost file was missing at the merge) is left out and counted on the last line, which is left out when there is none.
With no merged ticket, one line says so: No merged ticket in <project> yet. It reads only: nothing is written. More than nothing after budget prints usage: arthur stats budget [--project <name>] and exits 2; an unknown project exits 1 with the board’s refusal.
arthur stats tickets
Section titled “arthur stats tickets”Usage: arthur stats tickets [--project <name>]. Comes with the stats plugin (roadmap entry 61, moved from manage in 110, under tickets since 111, when bare arthur stats became the spend view: arthur stats --help). Answered without the model, for one project, the main one unless --project names another; it runs inside a job too. The same report, of the tickets merged since the last audit or retro, is the ### Stats section of their prompts, which manage asks the stats plugin for as stats.tickets (packages/manage/docs/manage.md).
How the merged tickets went: one line per merged ticket, in the order they were made, then six lines over all of them:
Stats of acme: 3 merged ticketsAC0001 Shop: 2 rounds (FAIL, PASS), $3.50, 2 daysAC0002 Cart: no review, cost unknown, 0 daysAC0003 Fix the total: 1 round (PASS), $0.40, 1 day, autopilot
Mean review rounds: 1.5 over 2 reviewed ticketsFirst-round PASS: 1 of 2 (50%) reviewedAutopilot: 1 of 3 (33%) mergedMost expensive: AC0001 $3.50, AC0003 $0.40; cost unknown for 1 ticketFAIL findings:- AC0001 review-1: 1. `src/cart.ts:12` - the total ignores the discount.Where each comes from, all in the ticket’s folder in the project’s checkout (spec/features/<id>-<slug>/):
- Rounds and verdicts: its
review-N.mdfiles, in the order of N, each the verdict of its- Verdict:line,nonewhen it is notPASSorFAIL. A ticket with no review file saysno review. - Cost: the
- Cost:line of itsoutcome.md(arthur merge --help), the worker’s and the reviews’ amounts added. Anoutcome.mdthat is missing, has no such line, or saysn/afor either amount (a job’s cost file was missing at the merge) iscost unknown, never $0: it counts in neither the most expensive nor any sum. - Days: from the
dateof itsticket.md’s JSON block, the day it was made, to the day of its last move on the board, to merged, incore.timeZone. Either missing isdays unknown. autopilot: itsticket.mdholds a- YYYY-MM-DD: Pre-approved by policy:line (arthur coordinator --help, “Autopilot”).
Over all merged tickets:
- Mean review rounds: the review files per ticket, over the tickets with at least one; a ticket without reviews is left out, not counted as 0.
- First-round PASS: of the reviewed tickets, those whose
review-1(the lowest N) is PASS. - Autopilot: of every merged ticket, those pre-approved by policy.
- Most expensive: the 3 with the highest known cost, highest first, and how many have none known.
- FAIL findings: for each FAIL review,
<id> review-N:and the first line of each of its findings. The findings are the section under the first heading of its final message that namesFindings(## Findings,## Review Findings,**Findings**,Findings:), up to the next#heading or a boldNotesorChecks; each finding is a line that opens as the section’s first does: a number (1.), a bullet (-,*), or bold (**) after a blank line. A section that opens with plain text is one finding; a review with no such heading gives the first line of its final message.
With no merged ticket, one line says so: No merged ticket in <project> yet., and asked with a time as stats.tickets, No merged ticket in <project> since <YYYY-MM-DD> <HH:MM>. in core.timeZone. It reads only: nothing is written. More than nothing after tickets prints usage: arthur stats tickets [--project <name>] and exits 2; an unknown project exits 1 with the board’s refusal.
arthur stats windows
Section titled “arthur stats windows”Usage: arthur stats windows. Comes with the stats plugin (roadmap entry 112), and needs the models plugin, which reads the account’s usage windows from the agent’s report (arthur usage --help) and gives them to stats as models.windows. Answered without the model; the report is fetched again when the last one is 10 minutes old, as arthur usage does. Every project.
One line per window of the report, beside what Arthur spent at list price (arthur stats --help) on that provider’s models in the window’s span, by role:
Usage windows, each beside Arthur's spend at list price on its provider's models in its span; by role, its share ≈ its part of the window, at most: the account's use outside Arthur counts too.- anthropic Claude 7 Day 40% used, since 2026-11-07 11:00: $13.00; worker 46% ≈ 18%, coordinator 35% ≈ 14%, review 15% ≈ 6%, plan 4% ≈ 2%- anthropic Claude 5 Hour 13% used, since 2026-11-13 06:00: $0.00- anthropic Claude 7 Day (fable) 90% used: the report gives no span- The span runs from the window’s reset less its length (
durationMs) to now, its start incore.timeZone; a window whose report gives no reset is taken as the span of that length before now; one whose report gives no length has no span, and nothing is compared. - The spend in the span is that of the runs and turns of
<home>/stats/whose usage names a model of the window’s provider (anthropic/...foranthropic): only those models’ cost counts. A run whose record had nousage(a backfill line of a record older than roadmap entry 108) or was gone (missing) counts for no window. - Each role, the most expensive first, has its share of that spend, then
≈the window’s used share times it: an estimate, and an upper bound. omp’s report gives one used share per window for the whole account, nothing per session or call, and the owner’s own use of the account outside Arthur counts in the window too, so a role’s real part is at most the figure. The cost is at list price, what the tokens would cost on the API, whatever the account pays.
Without a window to show, one line, exit 0: no usage windows: the models plugin is not loaded; no usage windows: the agent has no usage report (<why>), also when the last fetch failed; no usage windows: no account reports one.
Refused: a word after windows prints usage: arthur stats windows and exits 2. Inside a job, Arthur’s home is hidden from the job’s sandbox: it prints the spend view’s refusal (arthur stats --help, “Refused”) and exits 1.
arthur stats
Section titled “arthur stats”Usage: arthur stats [--since today|yesterday|<n>d|YYYY-MM-DD] [--project <name>] [--role <role>] [--ticket <id>] [--model <provider/model>], arthur stats tickets [--project <name>], arthur stats budget [--project <name>], or arthur stats windows. Comes with the stats plugin (roadmap entry 111). Answered without the model, from the plugin’s own files, <home>/stats/runs.jsonl and <home>/stats/sessions/*.jsonl (packages/stats/docs/stats.md); it reads only. Every cost is omp’s at list price, what the tokens would cost on the API, not money paid on a subscription.
arthur stats tickets is the merged tickets’ report of one project, which bare arthur stats printed before entry 111: arthur stats tickets --help. arthur stats budget is what the workers of that project’s merged tickets cost, per kind of ticket, by which a worker’s budget is picked (AR0739): arthur stats budget --help. arthur stats windows puts each usage window of the account beside this spend in its span, by role (entry 112): arthur stats windows --help.
The spend
Section titled “The spend”By default the last 7 days of every project:
Spend since 2026-11-06 11:00 (7 days), every project: $17.00 at list price, 6 runs (2 failed or stopped), 1 turn, 0h35mTokens: 202 in, 2.6K out, 1.2M cache read, 50K cache writeBy role:- worker: $9.00 (53%), 3 runs (1 failed or stopped)- coordinator: $4.50 (26%), 1 turn- review: $2.00 (12%), 1 run (0 failed or stopped)- audit: $1.00 (6%), 1 run (1 failed or stopped)- plan: $0.50 (3%), 1 run (0 failed or stopped)By project:- acme: $11.00 (65%), 4 runs (1 failed or stopped)- no project: $4.50 (26%), 1 turn- other: $1.50 (9%), 2 runs (1 failed or stopped)By model:- anthropic/claude-opus-5-5: $16.00 (94%), 162 in, 2.6K out, 1.2M cache read, 50K cache write- not recorded: $1.00 (6%), 0 in, 0 out, 0 cache read, 0 cache write- ollama/qwen: $0.00 (0%), free, 40 in, 4 out, 0 cache read, 0 cache writeBy day:- 2026-11-10: $1.00 (6%), 1 run (1 failed or stopped)- 2026-11-11: $3.00 (18%), 1 run (1 failed or stopped)- 2026-11-12: $13.00 (76%), 4 runs (0 failed or stopped), 1 turnMost expensive tickets:- AC0012 (merged): $8.00: worker $6.00, review $2.00- AC0013 (dropped): $1.50: worker $1.50- AC0014 (in-progress): $1.50: worker $1.50- OT0001 (status unknown): $0.50: plan $0.50Whether it pays:- on 1 ticket merged since 2026-11-06 11:00 (7 days): $8.00, $8.00 per ticket- on dropped tickets: $1.50- on runs that failed or were stopped: $4.00 in 2 runs- on work with no ticket (the coordinator, audits): $5.50Unknown: 1 run whose record was gone, 2 lines not read- The first two lines are the total: cost, the job runs and how many of them failed or were stopped, the coordinator’s turns, the time, then the tokens. The morning report’s Spend section is these two lines of
arthur stats --since 1d. - A run is one line of
runs.jsonl: what one run of a job added to its record. A turn is one line of a session’s file; a subagent’s turn (sub) adds its cost and tokens to its session’s but is no turn of its own, and its time is inside its session’s. - A run’s role is its job’s kind (
worker,review,plan,audit, …), a turn’s its session’s name (coordinator). A run failed or was stopped when its reason starts withfailed,stoppedorlimit:(arthur spawn --help). - By role, project and model, the most expensive first, each with its share of the total; by day in order, the day in
core.timeZone. A turn has no project (no project). A model whose cost is 0 is markedfree, its tokens still counted (a local model);not recordedis the cost of runs whose record had nousage(a backfill line of a record older than roadmap entry 108). - Most expensive tickets: the 5 with the highest cost, each split by role, with its board status,
status unknownwhen no board of the project list holds it or its board cannot be read. A run that names several tickets gives each an equal share. - Whether it pays: the spend on the tickets the board shows merged with their last move in the span, and per such ticket; on tickets the board shows dropped; on the runs that failed or were stopped; on the runs and turns that name no ticket.
- Unknown: the runs whose record was gone when they ended (
"missing": true, numbers unknown, never counted as free), and the lines that are no JSON object or have no time it can read (cut by a crash, edited by hand), which nothing else counts.
With nothing in the span, one line: No job run or coordinator turn since <when>, <scope>., and the Unknown line under it when a line was not read.
Filters
Section titled “Filters”--since:todayandyesterdayfrom that local day’s start incore.timeZone;<n>d, the last n times 24 hours, n from 1 to 99999 (--since 1dthe last 24 hours);YYYY-MM-DD, a real date, from that local day’s start. 7 days when left out.--project <name>: only that project’s runs; for this command it narrows, where other commands switch to that project. Turns have none, so they are left out.--role <role>: only that kind’s runs, or that session’s turns.--model <provider/model>: only that model’s share of each run and turn, its cost and tokens; a line with nothing of it is left out.--ticket <id>: that ticket’s runs instead, one per line, the oldest first, under one line of their total:
Runs of AC0013 since 2026-11-06 11:00 (7 days), every project: $1.50 at list price, 1 run- 2026-11-11 09:00 worker, anthropic/claude-opus-5-5+ollama/qwen, ended: failed: no verdict, $1.50 (its share of $3.00, 2 tickets), 50 in, 104 out, 0 cache read, 0 cache write, 0h10mThe filters combine; each narrows every section, the total too.
/stats
Section titled “/stats”/stats [today|yesterday|<n>d|YYYY-MM-DD] [<ticket id>], in either order, on a channel: answered without the model, every project, the last 7 days by default. Without a ticket, the total, by role and the 3 most expensive tickets; with one, its runs as --ticket prints them. Any other words reply usage: /stats [today|yesterday|<n>d|YYYY-MM-DD] [<ticket id>].
Refused
Section titled “Refused”- Wrong usage (an unknown flag, a word after
statsbuttickets,budgetandwindows, a flag without its value, a--sincenone of the above) prints the usage line and exits 2. - Inside a job (
arthur help --help), Arthur’s home is hidden from the job’s sandbox, the plugin’s folder with it:arthur statsprintsarthur stats: the spend is kept in Arthur's home, which a job cannot read; arthur stats tickets and arthur stats budget run hereand exits 1, and/statsreplies the same, without the prefix.arthur stats ticketsandarthur stats budget, which read only the board and the tickets’ folders, run there.