AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 5, 2026, 22:00 JST

aiUsage CLI turns Claude Code and Codex logs into CSV

aiUsage CLI turns Claude Code and Codex logs into CSV

3 Key Points

  1. What happened

    The Rust-built aiUsage CLI aggregates Claude Code and Codex local logs into usage.csv, one row per model, covering normal input, cache read, cache write, output tokens and API-rate USD.

  2. Why it matters

    Monthly per-model spend is otherwise assembled by hand, so this may cut that reporting work to a single command for people who track their AI usage.

  3. What to watch

    The USD column is a reference conversion, not a subscription bill, and unreadable pricing leaves it blank with a warning. Summary rows, charts and plan comparisons must be built in a spreadsheet.

WHO IT HITSDevelopers and individual AI-tool users who track monthly Claude Code and Codex consumption, and anyone publishing per-model usage write-ups, can run one command instead of tallying logs by hand.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The tool exists because its author writes a monthly article on AI usage and, each time, had to dig through saved logs, total tokens per model, and convert them at API rates. aiUsage compresses that routine into one command, and the distributed build needs no Rust, Python or API key.

Its design choices follow from that reporting purpose. Output is one row per model with no total row, on the assumption that totals, graphs and comparisons against subscription fees belong in Excel or Google Sheets. Amounts come from a pricing table bundled into the executable, which is why they are labelled a reference conversion rather than an actual subscription payment, and why models missing from that table get tokens but a blank amount plus a terminal warning.

Accuracy work sits mostly in the cache handling. Claude Code logs distinguish five-minute and one-hour cache writes and aiUsage reflects that; Codex treats what is left after subtracting cache reads from input as normal input, and its reasoning tokens are already inside output so they are not added again. Repeat updates to the same Claude Code response and Codex's cumulative counters are not simply summed, with Codex differences anchored on records from before the period start. That last point is probably where the numbers are most sensitive, so users comparing months may want to check the bundled pricing table and how a period boundary falls before treating the figures as final.

FAQ
Does aiUsage send my logs anywhere or include my conversations?
No. Aggregation runs locally, the saved logs are not sent externally, and the CSV does not contain conversation text.
Which periods can I specify?
You can pick a single day, a month, a year, an arbitrary from-to range, from a date to now, up to a date, or the entire log history. --day, --month, --year and --all cannot be combined with --from or --to.
Does the ChatGPT option cover the ChatGPT web and iOS apps?
No. Specifying chatgpt means aggregating Codex local logs; ChatGPT web and iOS conversation history is not included.
Why does aiUsage split out cache tokens?
Normal input, cache read, cache write and output each have different rates, so applying the normal-input rate to total tokens would change the amount greatly.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleStrata runs 125B Qwen3.8-Flash-Next on gaming PCs