Expand description
The named reports and the rollup behind warden query.
Every report in here is a pure consumer of crate::store::Scanner — none
of them opens an event file itself. A report’s whole job is
to turn a window of events into a Report; whether that reaches a terminal
or a harness is crate::output’s problem.
Three honesty rules are enforced here rather than in each report:
- A figure warden cannot derive is
Cell::Unsupported, never0. - An absent token count means “not applicable on this record”, because usage
is logged once per request and repeated on no sibling. Summing treats it as
contributing nothing, and
Notessays how many records carried usage. - Anything that would make a number differ from what a user sees elsewhere — sidechain events, unpriced models, skipped lines — becomes a note.
Modules§
- compare
warden report compare— this period against the one immediately before it.- files
warden report files— attributed tokens per file.- models
warden report models— usage split by model.- projects
warden report projects— tokens and est. cost per project.- query
warden query— a general rollup over named dimensions.- sessions
warden report sessions— the longest and most expensive sessions.- summary
warden report summary— totals for the period, broken down by day.- tools
warden report tools— tool call frequency, and the failure rate warden deliberately refuses to invent.
Structs§
- Cost
- Running cost for one bucket.
- Notes
- The observations that become a report’s
notes. - Report
Ctx - Everything a report is given besides the scanner.
- Scanned
- A completed scan, with the observations every report turns into notes.
- Totals
- Everything summed for one bucket of events.
Enums§
Constants§
- NAMES
- The named reports, in their documented order.
- NO_
PROJECT - The label for a bucket whose events recorded no working directory. Those
events are still real spend, so they get a row rather than being dropped —
under one spelling, because
projectsexplains it in a note andsessionsprints it. - SYNTHETIC_
MODEL - The model name Claude Code writes for records it synthesized itself. It is
not a model anyone is billed for, so it is counted in volume and excluded
from cost (see
Cost::add).
Functions§
- by_
weight_ desc - Heaviest bucket first, ties broken by key so output is deterministic.
- count
- A count cell, saturating rather than wrapping on an implausible total.
- day_of
2026-08-04in UTC. The store is UTC throughout, so days are too.- desc
- Descending float compare.
Ordering::Equalfor a NaN — a weight that cannot be compared must not reorder the rows around it. - event_
cost - What one event cost, priced from the current config.
- format_
span 1h12m,4m,12s— a wall-clock span, forsessions.- resolve
- Resolve a report name, listing the valid ones when it is not one.
- rollup
- Bucket events by a key.
Nonefromkeydrops the event from the rollup. - round_
money - Money is compared and diffed as a float but published at cent precision.
- run
- Build a named report end to end.
- scan
- Read the window through the one shared scanner.
- short_
id - Long ids are unreadable in a table; JSON keeps them whole.
Type Aliases§
- Builder
- A report by name.