Cost attribution is not accurate.
Will not be able to give too much info here, but the cost attribution for a run I had was not accurate.
One of my runs gave me the following report at the end:
Workflow ID: xxxxxxx-xxxxxxxx
Status: completed
Duration: 107m 31s
Total Cost: $35.0974
Agents: 12 completed
Agent Breakdown:
- pre-recon (19m 48s, $5.2004)
- recon (24m 20s, $5.8979)
- injection-vuln (18m 58s, $3.0686)
- injection-exploit (10m 11s, $1.2789)
- xss-vuln (11m 41s, $1.9719)
- auth-vuln (23m 50s, $3.6361)
- auth-exploit (6m 43s, $1.3697)
- ssrf-vuln (32m 40s, $4.5704)
- ssrf-exploit (8m 3s, $1.4074)
- authz-vuln (26m 0s, $4.1535)
- authz-exploit (10m 21s, $1.7223)
- report (5m 15s, $0.8203)
================================================================================
But Anthropic billing said the cost was $190.18.
No changes were made to the repo at the time of the run, CLAUDE_CODE_MAX_OUTPUT_TOKENS was set to 64000.
Total token usage was around ~160,000,000 with claude-sonnet-4-5-20250929
Thanks for the details. That’s definitely not expected.
The “Total Cost” and per-agent breakdown are computed by the Claude Agent SDK, and we believe there is a bug in the older SDK version we are currently running that is under-reporting costs (we saw some related GitHub issues). This seems to be like it's been addressed in newer Agent SDK releases.
We are in the process of upgrading, but the latest version include some breaking changes, and we are working through the migration now. Will keep you posted.
Still cheaper than a pen tester!
The underlying issue was a bug on the older version of Claude Agent SDK we were running (all cost estimates come straight from this) https://github.com/anthropics/claude-agent-sdk-typescript/issues/80 We have upgraded the sdk and in our preliminary testing looks like it's fixed.