How Much AI I Actually Use

Every tool that talks to a model now keeps a local record of what it sent and got back. I read those records on three machines — a Mac, one Linux box at home, and one FPGA server at the lab — merge them on the Mac once a day, and commit the result to this repository. The chart below is the merge: what I used, not what I paid.

There is a reason to publish it rather than keep it in a spreadsheet. Subscriptions hide the quantity. A flat monthly fee makes a heavy day and a quiet day look identical, and it is easy to believe that most of the cost comes from the few long sessions. For me it does not: a handful of agent loops dominate everything, and the rest of the year is noise on the same axis.

    Reading…

    What is counted

    Each machine reads its own logs, so nothing leaves except daily totals per tool and model. The sources are Claude Code, Codex and OpenCode session logs, plus Cursor’s dashboard, which is the one tool that keeps usage server-side and is therefore read from the Mac only.

    The accounting rules that matter:

    • One request is counted once. Claude Code writes a line per content block and copies responses into several transcripts; rows are deduplicated by message id and request id, the same rule ccusage uses. Codex reports cumulative snapshots, so repeated totals are dropped, and a sub-agent’s replay of its parent’s history is not counted again.
    • Cached input is separate. Uncached input, cache reads and cache writes are three columns, not one, because their prices differ by an order of magnitude.
    • Everything is priced at list. The chart shows what the same tokens would cost at official API rates, using a price table checked into the repository. Subscription plans make the real bill smaller, sometimes much smaller; that is the point of comparing.
    • History outlives the logs. Claude Code drops logs after about thirty days, so the collector keeps its own per-machine history and merges by keeping the larger count for a day. Days do not shrink when a log is pruned.

    How it runs

    A launchd job on the Mac runs at nine every morning. It connects to the other two machines over ssh, pipes a standard-library-only Python script to each one, merges the three results, and commits assets/ai-usage/data.json only if the rows changed. The push rebuilds this site, so the chart above is a static file — no server, no API, and the history is in git.

    Adding a machine is one line of configuration; adding a tool backend is one function. The collector and its tests live in _scripts/ai-usage.