<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap">

rafal@arasz:~$cat blog/agent-cost-part-2.md

What AI Coding Agents Actually Cost, Part 2: A Full Month of Data

TL;DR

Twenty-four days of local transcripts, read with ccusage 20.0.18: $9,774.52 for Claude Code and $679.09 for Hermes Agent, $10,453.61 together across 18.2 billion tokens. Those are estimates of what the API would have charged. Nobody billed me at those prices — this machine runs on a subscription, and for Claude Code every dollar figure is rebuilt from token counts. Two numbers explain most of the rest: 97.81% of all input-side tokens were cache reads, and 4.8% of sessions produced 60.8% of the cost. Cost per active day tripled inside the month.


One Machine, Twenty-Four Days

Part 1 put three coding agents side by side for two weeks and asked which one was cheaper. Part 2 asks the narrower question I actually needed answered: inside one agent-heavy month, on one machine, where does the money go? Which model, which project, which shape of session.

Every session transcript on disk, read by one tool. No winner named at the end.

Two of the numbers below come with a warning ccusage never prints: one flag cuts the bill in half without saying so, and the tool's own combined total does not match the sum of its parts. Both are in here. Neither is fixed.


What ccusage Measures, and What It Doesn't

ccusage reads local session transcript files. For Claude Code that is the JSONL under ~/.claude/projects/ — 5,765 files, 1.6 GB on this machine. It never contacts a billing API. It is a log reader, not an invoice, and that difference matters more than any single figure below.

For Claude Code, every dollar in this article is synthetic. I checked instead of assuming. Running ccusage claude daily --mode display — the mode that reports only the cost values already stored in the transcripts — returns $0.00 across the entire history. --mode calculate and the default --mode auto return the identical total. That is proof, not a guess: these subscription-plan transcripts carry no cost field at all, so ccusage worked out every figure from token counts times a price table. The price table comes from LiteLLM; ccusage pins a version of it and refreshes it on a schedule.

The Hermes numbers come from somewhere else, and it is a weaker source. ccusage's Hermes support is officially marked experimental. The adapter reads state.db from $HERMES_HOME, or from ~/.hermes/ when that is not set, and the guide says it prefers recorded actual cost over estimated cost — so the $679.09 may be partly recorded rather than fully rebuilt. I did not work out the split. Read the Claude figures as list-price rebuilds, and the Hermes figure as part recorded and part estimated, in a mix I cannot separate.

Fetching that price table is the default. Running the same command without a network does not fail, and that is the problem.

Two more things to know before anyone quotes a number from below.

Measuring the bill changes the bill. Between the snapshot and a check run eleven minutes later, the Claude total moved from $9,774.52 to $9,792.69 — +$18.17, because the session doing the analysis was writing transcripts of its own. ccusage's active-block projection reported a spending rate of $112.21/hour at that moment. Every figure here is the 17:00:28Z snapshot on 2026-07-31; do not trust the last decimal.

The totals do agree with themselves. Six separate report paths all land within $0.74 of each other, a spread of 0.008%, and that spread is itself explained by live drift across sequential runs. Whatever else is uncertain here, the arithmetic adds up.

the six report paths
Six commands, run one after another. Largest gap between any two: $0.74.
Report pathClaude total
claude daily$9,774.52
claude session$9,774.93
claude blocks$9,774.93
claude daily --instances$9,774.85
claude weekly$9,775.26
claude monthly$9,775.26

The Totals, and Which Run to Trust

The obvious command is ccusage daily, which merges every agent it can find and returns one number: $10,447.65. That is the only time it appears in this article. It sits about $2.76 below the sum of the two per-agent totals, and it counts about 3.46 billion fewer cache-read tokens. I could not work out why, so I trust the per-agent runs instead.

Which is two runs, not one. ccusage 20.0.18 is not a Claude-only tool any more, and of all the agents it can read, only two had data on this machine.

which agents ccusage found

Version 20 offers 15 agent-scoped command groups. I probed every one of them with ccusage <agent> daily --json.

  • Claude Code — 17 active days.
  • Hermes Agent — 9 active days.
  • The other thirteen — codex, opencode, amp, droid, codebuff, pi, goose, kilo, copilot, gemini, kimi, qwen, openclaw — all returned an empty list and zero totals.

~/.codex/sessions/ exists but is empty. ~/.gemini/ and ~/.config/github-copilot/ hold configuration only, with no usage records in them.

Totals over all available history, snapshot 2026-07-31T17:00:28Z
Claude CodeHermes AgentCombined
Window07-08 → 07-3107-22 → 07-3124 calendar days
Active days17920
Fresh input tokens513,013127,086,357127,599,370
Cache-create tokens330,854,152733,296331,587,448
Cache-read tokens14,795,263,4962,920,582,05517,715,845,551
Output tokens58,198,0097,236,98165,434,990
Total tokens15,184,828,6703,058,184,38918,243,013,059
Estimated cost$9,774.52$679.09$10,453.61

Claude Code is 93.5% of the estimated spend and 83.2% of the tokens.

Read that last bar together with its caveat. The week is six days long and stops in the middle of the 31st, and it still holds 69% of the month's entire spend — 9.56 billion of the 15.18 billion Claude tokens.

Day to day, the range is brutal: $23.69 to $1,992.73, a factor of 84. The mean active day is $574.97. The median active day is $469.08.

Every day with recorded activity. Four calendar days in the window had none. 07-31 is partial.
DateClaude $Hermes $Combined $Sessions started
07-0831.8131.813
07-1138.8338.832
07-12469.08469.0820
07-13453.75453.7519
07-14470.81470.8120
07-1524.1624.160
07-18213.68213.6811
07-19742.42742.4227
07-20454.25454.25107
07-2198.3198.3152
07-2223.6978.17101.861
07-23155.34155.340
07-24265.10265.100
07-2554.4754.471
07-26569.1467.60636.7420
07-27995.027.861,002.8835
07-281,339.9611.681,351.6440
07-291,992.731,992.73629
07-301,034.571.771,036.34156
07-31822.3137.10859.41122
Total9,774.52679.0910,453.611,265

Claude recorded no spend on 07-23, 07-24 and 07-25 — exactly the three days Hermes was busiest. I had hit the Max plan's weekly usage limit. Hermes carried the work that could not wait. The gap ends on the day I moved to the 20× subscription, which I did to get the job-search assistant finished. The transcripts cannot show a rate limit or a plan change. They only show the hole, and the faster spending that follows it.


Where the Money Went

By Model

ModelCost% cost% tokensActive days
claude-opus-5$5,108.4652.3%46.6%6
claude-fable-5$2,046.8820.9%7.9%14
claude-sonnet-5$1,611.7216.5%35.9%16
claude-opus-4-8$939.939.6%7.7%7
claude-haiku-4-5$67.530.7%1.8%12

opus-5 ran on six days out of seventeen and took over half the money. The other four models split what is left.

The contrast with sonnet-5 is the useful part: sonnet ran on 16 of 17 days, carried the second-largest token volume by a wide margin — 35.9% against opus-5's 46.6% — and cost a third as much. At the other end, haiku-4-5 ran on 12 days for $67.53 total: 0.7% of spend for 1.8% of tokens, which is close to free.

Hermes is even more concentrated. xiaomi/mimo-v2.5-pro is $634.05 of the $679.09 — 93.4% — with openai/gpt-5.6-luna-pro at $37.10, deepseek/deepseek-v4-pro at $7.91, and z-ai/glm-5.2 at three cents.

By Project

Three repositories did all the work this month: the job-search assistant, ai-badger, and this blog. ccusage claude daily --instances reports 20 distinct paths — every git worktree and scratchpad counts as its own path — but each one maps 1:1 to one of the three parent repos, so the merged view is the honest one.

ProjectCost%
job-search-ai-assistant≈ $6,84270.0%
ai-badger≈ $2,16022.1%
arasz-home-page$771.507.9%

The ≈ marks the merge: parent repo plus its worktrees and scratchpads. The largest single worktree — an Aspire orchestration branch of the assistant — carried $125.52 on its own. One product took seven of every ten dollars.

This is also where the tool stops helping. --instances exists only for Claude Code. ccusage cannot tie Hermes usage to a project at all — the Hermes adapter offers daily, monthly and session and nothing else: no weekly report, no 5-hour blocks, no per-project breakdown. The $679.09 is one flat number that cannot be opened up.


The Shapes That Drive Cost

I had assumed the bill roughly tracked how many sessions I started. It does not, and it is not close.

Across 1,265 sessions the mean is $7.73 and the median is $0.0425. Not a typo — four cents. 1,114 sessions (88.1%) cost under a dollar and 944 cost under ten cents. The median session lasts almost no time at all; most of them are short-lived subagent sessions that barely register.

The money is somewhere else entirely. The top 10 sessions are 52.1% of all cost. The single most expensive one — 49.5 hours in ai-badger, across four models — is $996.19 on its own, 10.2% of the month. The top 50 reach 88.2%; the top 100 reach 97.5%.

So it is tempting to conclude that heavy days are busy days. They are not:

DateCostSessions startedMean $/sessionShape
07-19$742.4227$25.20few, large
07-20$454.25107$2.13many, tiny
07-28$1,339.9640$35.23few, large
07-29$1,992.73629$3.96both at once
07-30$1,034.57156$0.76many, tiny
07-31$822.31122$5.03mixed

Session count does not predict cost. 07-30 started 156 sessions for $1,034.57; 07-28 started 40 for $1,339.96 — a quarter of the sessions, a third more money. A day of many small subagent runs is cheap. A day of one long orchestration is not.

The number that settles it: 61 of 1,265 sessions (4.8%) span more than one calendar day, and they account for 60.8% of all cost. Long-running orchestration sessions drive the bill. Crowds of small subagents barely move it.

The 5-hour billing blocks say the same thing from another angle. Across 52 blocks the median is $133.05 and the mean $187.98. But four of the six most expensive blocks in the entire history are consecutive blocks on 2026-07-29 — 04:00, 09:00, 14:00 and 19:00 UTC. One continuous run of roughly twenty hours, $2,069 against a $133 median block.

There is a trap here, and it is why no figure in this section is divided by another: ccusage gives a session's full cost to the whole period it spans, so per-day shares of session cost add up to more than 100% on any day a multi-day session started. Session-level and day-level numbers are quoted separately here, never mixed.


The Cache Is Doing Almost All the Work

Of 15,126,630,661 input-side tokens on the Claude Code side:

ClassTokensShare
Fresh input513,0130.0034%
Cache write330,854,1522.19%
Cache read14,795,263,49697.81%

Ninety-eight percent of what this workload paid for on the input side was re-reading text it had already sent. Each cached token is read back 44.7 times on average, and the input-to-output ratio is 260:1. This is not a generation workload with some context attached. It is context replay with a little generation on top.

Hermes gets to the same place by a different route — 4.2% fresh input, 95.8% cache reads, and almost no cache-write spend at all.

Which raises the obvious question: what would this cost without caching?

ccusage reports tokens and a total, but not the price of each token class, so I had to recover those prices from the data myself. The rates I fitted reproduce ccusage's own total to −0.06%, and the one assumption they need from outside the data checks out against a published Anthropic price to within 4%.

methodology

I recovered the rates by least squares over 113 project-by-day-by-model observations from --instances. A four-parameter fit fails: fresh input is 0.003% of the volume and simply cannot be identified, and ccusage merges 5-minute and 1-hour cache writes into one field. The three-parameter fit holds up. Median residuals run from 0.46% to 3.58% per model, the fitted rates reproduce ccusage's own totals to −0.06% ($9,768.42 against $9,774.52), and every model lands within ±1.2%.

The no-cache figure then needs one assumption from outside the data, which I want labelled rather than buried: Anthropic prices cache reads at 0.1× the base input rate, so the implied input price is ten times the fitted cache-read price. That assumption can be checked against a public number. Haiku 4.5's fitted cache-read rate of $0.104/Mtok implies $1.04/Mtok for input, against Anthropic's published $1.00/Mtok. A 4% match.

On those rates, charging every cache token at the full input rate makes the month roughly 7× more expensive.

Two other things in this section are weaker than they look and should be read that way. The spend split — cache reads 66.3%, cache writes 23.4%, output 10.3% — rests on fitted output rates, the least well identified of the three parameters. And none of it covers work the transcripts never record, such as failed or retried requests that were never written to JSONL. That work happened. This method cannot see it.


Cost per Active Day Tripled

Split the window in half and the change is hard to miss.

PeriodActive daysCostPer active day
07-08 → 07-2110$2,997.10$299.71
07-22 → 07-317$6,777.42$968.20

3.23×, inside one month. Not because prices moved. Because the work changed: longer orchestration runs, more parallel subagents, bigger contexts held open across days. The 07-29 spike — 629 sessions started, four record blocks in a row, $1,992.73 — is what the second half looks like at its peak.

So this measures a habit that was still changing, not a steady state. I was learning to hand off more work while the meter was running, and the bill followed. Anyone reading $574.97 per active day as a steady rate is reading it wrong.


Caveats I Cannot Remove

The window is not something I chose. Nothing on this machine predates 2026-07-08, and Claude Code's default cleanupPeriodDays is 30, which I have not changed — so at 24 days nothing has been deleted yet, and the window starts where my use started rather than where a cleanup cut it. That stops being true on 2026-08-07. Any later run of this analysis will lose its oldest days and will not say so. And 2026-07-31 is a partial day either way, cut at 17:00 UTC.

The rest is known, and work on it has started. Costs are estimates, and for Claude Code entirely so — nothing here was billed at these prices. The unified total still disagrees with the sum of its parts by $2.76, and I still do not know why. The Hermes adapter is still experimental, and its cost figures still mix recorded and estimated values in a mix I did not measure. What is changing is the measurement itself: ai-badger, the agent framework I develop and run these sessions on, now records what its own machinery does — which hooks ran, in which project, at which version, what its retrieval layer recommended and why, and which skills actually get used. That is behavior data, not billing data. But it is recorded at the source instead of rebuilt from transcripts afterwards, and the next part of this series gets to use it.


What Part 3 Might Measure

The gap in all of this is that cost is measured and value is not. Nothing above says whether the $6,842 spent on one product bought $6,842 of anything. The interesting version of Part 3 divides these numbers by something real: cost per merged PR, cost per shipped feature, cost per bug that reached production. That means joining ccusage sessions to git history, which is real work rather than a report flag.

Two smaller questions are worth following too. The $2.76 gap between the unified total and the per-agent sum is either a bug or a definition I do not understand, and I would rather be told which than keep quoting a total I cannot explain. And the 4.8%-of-sessions finding suggests an obvious experiment: cap orchestration session length on purpose for a week and see whether the bill follows the sessions down, or whether the work simply moves somewhere else.

That experiment only pays for itself if the effect is big enough to see through an 84× swing between days — which, on this data, it might not be. I would rather say that up front than run it and report noise.


Method and Tools

  • Tool: ccusage 20.0.18, installed globally with bun. The Hermes adapter guide documents that adapter's experimental status, its state.db source, and its preference for recorded cost.
  • Snapshot: 2026-07-31T17:00:28Z. All totals drift upward while the machine is in use.
  • Window: 2026-07-08 → 2026-07-31, 24 calendar days, 20 with recorded activity.
  • Source data: local transcripts only. ~/.claude/projects/ for Claude Code (5,765 JSONL files, 1.6 GB); ~/.hermes/state.db for Hermes Agent. No billing API was contacted.
  • Pricing: LiteLLM price table, fetched online. Do not reproduce this with --offline.
  • Currency: all figures in USD.

Commands worth having if you want your own version of this:

bash
# Per-agent totals — prefer these over the unified report
ccusage claude daily --json
ccusage hermes daily --json

# Prove to yourself what is recorded vs reconstructed
ccusage claude daily --mode display

# Per-project attribution (Claude Code only)
ccusage claude daily --instances

# Per-model breakdown, sessions, and 5-hour blocks
ccusage claude daily --breakdown
ccusage claude session --json
ccusage claude blocks --json

Run the --mode display line first. If it comes back $0.00, you are on a subscription, and every dollar figure after it — mine included — is a rebuild, not a bill.


Part 1: What AI Coding Agents Actually Cost — three agents, two weeks, and the 80/20 strategy.