Claude Code usage analytics: what is worth measuring

Most agent analytics stop at a total, which answers nothing. These are the four numbers that have actually changed a decision, where each one now comes from, and the ones that look important and are not.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Four metrics repay attention: cost by repository, cache hit ratio, edit acceptance rate, and cost per merged pull request. Anthropic publishes a benchmark to compare the first against: across enterprise deployments the average is around $13 per developer per active day and $150 to $250 per developer per month, with 90% of users under $30 per active day, as of August 2026. Lines of code, session count, total tokens, and raw spend move for reasons unrelated to whether the tool is working.

What you need to know
  • Spend is heavily skewed. Sort descending; the mean describes nobody.
  • Cost by repo is the most actionable cut, and no vendor endpoint has it.
  • A falling cache hit ratio means session hygiene has degraded.
  • Edit acceptance rate is now a first-class field, not a guess.
  • Anthropic publishes a benchmark: $150 to $250 per developer per month.

The distribution is the first finding

Before any particular metric, understand the shape. Agent spend follows a power law: a small number of long, unsupervised sessions account for most of a month.

A representative month for one engineer. Shape, not a benchmark.

Session bandShare of sessionsShare of cost
Top 5%5%~50%
Next 15%15%~30%
Remaining 80%80%~20%

The one average worth holding is the external one. Anthropic reports that across enterprise deployments Claude Code averages around $13 per developer per active day and $150 to $250 per developer per month, with 90% of users staying under $30 per active day, as of August 2026. If your own number is an order of magnitude off that in either direction, the interesting question is why, and it is usually answered by the next four metrics.

The four metrics worth tracking

Where each one comes from, as of August 2026.

MetricSourceAvailable from a vendor endpoint?
Cost by repositoryLocal session transcriptsNo. There is no repo dimension anywhere
Cache hit ratioToken counts by categoryYes, via OpenTelemetry or the Analytics API
Edit acceptance rateTool decisionsYes, both places
Cost per merged PRSpend plus your own git historyPartly. PR counts are reported, spend is estimated

1. Cost by repository

The most actionable cut available, and the one no organisation-level API can give you, because repository is only recorded locally in the working directory of each request.

A repo that costs three times another for comparable work is telling you something concrete: it is hard to navigate. In practice that means one of four things, in roughly this order of frequency: missing or stale project memory, a structure the agent has to rediscover every session, a test suite slow enough that the agent burns turns waiting on it, or generated files large enough that reading one blows the context window.

The fix is a change to the repository, not to how people prompt, and every human who works there benefits from it too.

2. Cache hit ratio

Cache reads divided by total input tokens. Healthy sustained sessions sit high, usually 70 to 90 percent, because the conversation prefix is stable and re-read at a tenth of the base input rate.

RatioReading
Above 80%Healthy. Long sessions on a stable prefix
50 to 80%Normal for short, varied tasks
Below 50%Investigate. Something is invalidating the prefix

A ratio that falls over time is context churn. The two common causes are a project memory file being edited constantly, and gaps longer than the cache lifetime: on a subscription the prompt cache lives about an hour, and it drops to five minutes once you are drawing on usage credits or working on an API key, so a lunch break costs a full context reprocess on the first message back.

3. Edit acceptance rate

How often a proposed edit is accepted rather than rejected. This used to be a guess and is now a field in two places.

The same number, two sources.
# Analytics API, per user per day
rate = accepted / (accepted + rejected)
  over tool_actions.{edit_tool, multi_edit_tool, write_tool, notebook_edit_tool}

# OpenTelemetry, live
sum(rate(claude_code_code_edit_tool_decision_total{decision="accept"}[1d]))
  / sum(rate(claude_code_code_edit_tool_decision_total[1d]))

It is the only routinely available signal about whether output quality is going up or down, and it moves before anyone files a complaint. A step change after a model switch, a new convention in project memory, or a plugin rollout is worth taking seriously the same week.

4. Cost per merged pull request

Total agent spend divided by pull requests merged. It is crude and it is the only metric on this list that connects spend to something delivered. Watch the trend, not the level: the level depends entirely on how big your PRs are.

If you have connected the GitHub integration, Anthropic attributes merged PRs to Claude Code and labels them claude-code-assisted, which gives you a denominator you did not have to build. The attribution is deliberately conservative: it matches added lines against session output over a window from 21 days before merge to 2 days after, ignores lines under four characters and generated files, and drops attribution entirely when a human rewrote more than 20 percent of the line. Treat the resulting count as a floor.

Metrics that look useful and are not

Why each of these misleads.

MetricWhy it fails
Lines of code writtenMore lines is usually worse. An agent that writes 4,000 where 200 would do scores best
Number of sessionsMeasures habit, not value. Ten small sessions may be one avoided
Total tokensGrows with repo size and context, not with output quality
Total spendMeaningless without a denominator. $400 is cheap or expensive depending on what shipped
Time savedNot measurable. Every published figure is a survey of feelings
Active timeCounts keyboard and tool time, so a slow test suite scores as engagement

Where the money actually goes inside a session

Cost by repo tells you which project is expensive. The newer attribution data tells you which part of the agent is expensive, which is a different and often more surprising answer.

  • Subagents. The query_source attribute splits main from subagent and auxiliary. Delegating a verbose task is usually cheaper overall, but a subagent that re-reads the codebase is not.
  • Agent teams. Anthropic reports roughly 7x the tokens of a standard session when teammates run in plan mode, because each teammate carries its own context window.
  • MCP servers. Attributed individually, and one chatty server can dominate a session that felt cheap.
  • Skills and plugins. Attributed by name, so an over-eager skill shows up rather than hiding in the total.
  • Effort level. Thinking tokens bill as output. The effort attribute makes the trade visible instead of theoretical.

Inside the CLI, /usage shows the same breakdown for the last 24 hours or 7 days on a Pro, Max, Team, or Enterprise plan, and flags any behaviour that accounts for 10 percent or more of recent usage, such as long context or cache misses. Press d or w to switch window. Those figures are computed from local session history on that machine, so they exclude other devices and claude.ai.

Turning a finding into a change

FindingLikely causeChange
One repo costs 3x the othersHard to navigateWrite or fix its CLAUDE.md
A handful of sessions dominateUnsupervised long runsPlan mode first; check in periodically
Cache ratio fallingContext churn or long gapsStabilise project memory; /clear between unrelated tasks
Opus is most of the spendWrong defaultDefault to Sonnet, escalate per task
Acceptance rate fell after a changeA convention made things worseRevert it and re-measure
Cost per PR rising, PRs unchangedScope creep in promptsSmaller, named tasks
One MCP server dominates attributionChatty tool resultsDisable it, or prefer the CLI equivalent
Spend is 5x the published benchmarkAgent teams or unattended loopsCap team size; audit scheduled tasks

Questions people ask

Cost by repository, cache hit ratio, edit acceptance rate, and cost per merged pull request. Those four change decisions. Lines of code, session counts, total tokens, and raw spend do not.

Anthropic reports roughly $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, with 90% of users under $30 per active day, as of August 2026. Your own number depends heavily on model choice and session length.

Because an agent producing more code than the task required scores highest on it. It rewards verbosity, which is the specific failure mode you most want to avoid, and it is exported by default so it lands on dashboards without anyone choosing it.

Typically 70 to 90 percent for sustained agent sessions. Below 50 percent suggests the prefix is being invalidated repeatedly, often by constant edits to project memory or by gaps longer than the cache lifetime, which is about an hour on a subscription and five minutes on an API key.

Divide accepted by accepted plus rejected. The Claude Code Analytics API returns the counts per tool per user per day under tool_actions, and the OpenTelemetry exporter emits the same decisions live as claude_code.code_edit_tool.decision with a decision attribute.

Cost per merged pull request, tracked as a trend rather than an absolute. If you connect the GitHub integration, Anthropic labels attributed PRs claude-code-assisted, which gives you the denominator without building it yourself.

Cautiously, in aggregate, and only after telling people. Individual AI usage comparisons produce defensive behaviour quickly, low usage is often good judgement, and acceptance rate in particular rewards whoever reviews least carefully.

The distribution is a power law: a handful of long sessions account for most of the cost. The mean describes none of them. Sort descending and read the head.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code: manage costs effectively
  2. Claude Code: track team usage with analytics
  3. Claude Code: monitoring with OpenTelemetry
  4. ccusage on GitHub
Try it

The cuts that
change something.

Spend by repo, by model, by day, and per session sorted by cost, across every agent and every account you run. Free app.

free app · your subscriptions · local-first