Reads the logs the agents already wrote (~/.claude/projects, $CODEX_HOME or ~/.codex) and prices them from data/prices.json (dated, editable).
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --since 7d
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --provider codex --format json
--from and --to (ISO times) cut the window and --project <absolute path> keeps one project's rows; the console's mission page uses them for a mission's spend. An explicit --from/--to replaces the default 7-day look-back.
/usage is authoritative for the live Claude session; the Console or provider dashboard is authoritative for invoices.data/prices.json.message.id + requestId; Codex uses deltas of the running total_token_usage (never also last_token_usage), cached input is a subset of input, and forked rollouts are de-duplicated.If the log directory is missing, say so; do not invent numbers.