AI does a lot of our work. We’re a ten-person startup, and we use it to write code, to review it, and to look for bugs in other people’s code. Being a startup, we’ve always kept an eye on what that costs: which tools we use, how many tokens a project uses, whether a plan’s allowance will last the month. For a long time, our answers were estimates. A subscription is a flat fee and a usage allowance. An API key is one monthly number per provider. Neither tells you what a piece of work cost or which tool did it.
So for a while now we’ve been building a tool to answer those questions. It will be open source, and it’s already part of how we work every day. We’ll say more about it soon. First, here’s one piece of work we counted, and what we learned from it.
What ten hours of bug hunting found
Between 18 and 23 November, over about ten hours of active work, we used Claude Code, running Claude Opus 5.5, to look for security bugs: in the open source file server that runs in our office, in SQLite, which ships inside our product, and in our own code.
It found ten new bugs in the file server and in SQLite. The file server reports are private bugs in that project’s tracker until its advisory is out, so we won’t name the project or say anything about the bugs yet. The SQLite reports are on its public bug forum (the first, the second), and the SQLite team fixed both in trunk within hours of us posting them. The fixes will ship in the next release.
We then worked out what it had cost. Our first estimate was $650. The correct figure is $287.
The bill
We use Claude on Anthropic’s Team plan, so none of this arrived as an invoice. To see what the work itself cost, we priced every request at API list prices.
| Active time | List price | |
|---|---|---|
| File server | 3 h | $46 |
| SQLite | 3 h | $115 |
| Two reviews of our own code | 4 h | $126 |
| Total | 10 h | $287 |
That’s about $16 per upstream bug, and about $28 for every hour the agent was working. Kept up for a 40-hour week, the same pace comes to about $1,100 for one engineer at list price.
Cache reads, the agent re-reading its own context, were 98% of the tokens but only 57% of the bill. Output was 0.4% of the tokens and a fifth of the cost.
A detour: the refusal on day one
While we were setting up the file server review, a safety classifier stopped the session twice and pointed us to Anthropic’s Cyber Verification Program. That’s fair: sanitizer builds and bug reproducers for a file server look a lot like attack tooling. The program lets verified security professionals work with fewer of those interruptions. We applied the same afternoon, were approved, and have worked under it every day since. If you do this kind of work, apply before you need it.
Why the first number was wrong
We counted this one with a short script over Claude Code’s own logs, to see exactly what a tool has to get right. All the data was on our own disk, and our first estimate was still more than twice the real cost:
- The transcript writes one line per content block, and every line repeats the same usage numbers. Add up the lines and many requests get counted two or three times.
- A side question forked the SQLite session into a second file, which held 749 of the same requests.
- Subagents write to their own files. Leave those out and SQLite looks 60% cheaper than it was.
- On Opus 5.5, cache reads cost 5% of the input price, not 10% as on older models. And after the refusal, some requests ran on a different model at different prices.
To count it right, read every transcript file under ~/.claude/projects/, including the subagents/ folder next to each session. Count each response once by its message ID across all of those files, which also takes care of forked sessions. Then price each token type at the rate of the model that served it: input, output, cache reads, and 5-minute and 1-hour cache writes. The script we used is in a gist. It needs only Python 3 and reports cost by project, session, model or day.
At a larger company
That was one person, one tool and ten hours, at a company of ten. A company with a few hundred engineers has more AI tools, more providers and more ways to pay: subscriptions, extra usage, API keys. The questions are the same, but harder to answer:
- Which AI tools are we using, and which providers do they talk to?
- What does each team and project spend, at the price we actually pay?
- How much of each plan’s allowance is used up?
Cost isn’t the only reason to ask. The same answers show where your code and data go.
Today, answering them means writing a script like ours for every tool. That’s what we’re building, and we’re looking for early testers. If you have the same problem, we’d love to hear from you. More soon.
How exposed are your workloads?
Run the NHI Security Audit Checklist, 8 questions to map your credential exposure, attribution gaps, and lateral movement surface across your own environment. Takes about 15 minutes.
Run the ChecklistFollow us on LinkedIn and X for more updates.