Skip to content

Show HN: Aireceipts, itemized cost receipts for AI coding agents

github.com/anandgupta42
1 pointaaur0discuss
On HN

Hi HN. I built this at work for fun because I could not answer a basic question: what did that last agent session actually cost me?

It does three things:

1. A statusline under the agent's input box while it works: which model is billing you, cost so far, dollars per hour, and how much of your rate-limit window is gone. Waste like a stuck Bash retry loop gets flagged on the line as it happens. 2. "npx aireceipts-cli" after a session prints an itemized receipt: every tool priced, plus a "same tokens on a cheaper model" line that is arithmetic on the same token counts, not a prediction. 3. "npx aireceipts-cli pr --post" attaches the cost of the sessions behind a PR as a comment. There is a real one live on the repo's PR #189.

How it works: it parses the local transcripts your agent already writes. Claude Code, Codex CLI, and Gemini CLI get full per-turn parsing (models, tools, cache tiers). OpenCode is per-message. Cursor is an honest degraded mode: its logs carry no per-turn usage, so you get session totals only. No account, and transcripts never leave your machine.

Two design rules I cared about:

- Every price is cited: vendor URL, date observed, and a quoted excerpt, checked in CI. A daily tripwire cross-checks the price table against an independent dataset and opens an issue when they disagree.

- Receipts are deterministic: same transcript in, byte-identical receipt out, golden-tested on every commit, including the receipts shown in the README.

One disclosure: there is anonymous telemetry, on by default. The reason it exists: agent log formats change underneath me all the time, and parse-failure signatures and error classes tell me which agent broke before anyone has to file an issue. It never sends code, prompts, paths, titles, or dollar amounts. "aireceipts --telemetry-show" prints exactly what a run would send, and AIRECEIPTS_TELEMETRY=off or DO_NOT_TRACK=1 turns it off.

Apache-2.0, pre-1.0, so output can still change between minor versions. I am dedicating time to this every week, so feedback, bug reports, and requests for agents whose logs you want parsed are all welcome.

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.