← All Writing
July 9, 20267 min read

What Claude Code Actually Costs Me

Anthropic announced it was moving Agent SDK and headless claude -p usage onto a $100-a-month API-credit cap — and I realized I had no idea how much of my flat-rate subscription was already being spent by background agents I’d set running and forgotten about. So I built a weekly audit that inventories every AI-calling job, splits real dollars from subscription load, and flags new ones that sneak in. Real spend, it turns out: under $2 a month.

YieldA weekly self-audit of every automated job that calls Claude — a canonical inventory, a real-dollars-vs-subscription-load cost estimate, and a drift alert when a new or changed AI job appears — emailed to me every Sunday morning
DifficultyBeginner-to-intermediate (a few small Python scripts, a JSON registry, a scheduled task, and one email + phone-push digest — no new infrastructure)
Total Cook Time~3 hours in one afternoon — inventory, cost math, drift detector, and the weekly digest

Ingredients

The Problem: I Had No Idea What I Was Spending

The trigger was an announcement. Anthropic said it was moving programmatic usage — the Agent SDK and headless claude -p calls — onto a metered $100-a-month API-credit cap. My first reaction wasn’t about the $100. It was the uncomfortable realization that I had no idea how much of my subscription those background agents were already burning through, because I’d never once looked.

Over the past few months I’ve built a small zoo of automated jobs, and a lot of them call Claude. A morning market briefing that asks Claude to explain why markets moved. A soccer-club bot that grades its own decisions. A classifier that reads news posts and decides which ones matter. A weekend fitness recap. Each one, on its own, felt trivial. But they add up, they run on their own schedules, and I’d stopped counting.

The honest truth is I couldn’t have told you how many jobs called Claude, which models they used, or what the whole thing cost me per month. As a product manager, that’s exactly the kind of “we’ll figure out the unit economics later” blind spot I’d flag in a review. So I turned it on myself: build the dashboard, get the number, stop guessing.

The Twist That Reframed the Whole Project

Here’s the twist. That $100-a-month cap I mentioned up top? Mid-build, I learned Anthropic had paused it before it ever went live. No metered cap, no credit pool — at least not yet. Which meant the exact question I’d set out to answer (“how much of my $100 have I used?”) no longer had an answer, because the number didn’t exist.

That sounds like it kills the project. It actually clarified it. Because once the credit was off the table, the real cost picture came into focus, and it turns out there are two completely different kinds of “cost” hiding in the word “cost.”

Two buckets, one word

Not every Claude call costs money the same way. Some run against my flat-rate subscription — the same monthly plan I use for interactive Claude Code — so they don’t add a cent unless I blow through the plan’s limits. Others use a raw pay-as-you-go API key, billed by the token. Only the second bucket is real dollars. Lumping them together would have told me a scary, wrong number.

Subscription Load vs. Real Dollars

My automated jobscron + agents calling Claudea few Haiku jobsMetered API keypay-as-you-go, by the token~$2 / monthreal dollarsmost jobsMax subscriptionflat monthly rate~$14 / month of usenot billed per call
Every job that calls Claude lands in one of two buckets. Only the metered API-key lane costs real dollars — about $2 a month. The rest rides the flat-rate subscription: real usage, but not billed per call.

This distinction is the entire point of the audit, so it’s worth being precise about it:

For the subscription jobs, I still wanted a way to rank them — which ones eat the most of my plan? So the tool computes a “shadow dollars” figure: what each subscription job would cost if it were billed at that model’s API rate. It’s not a real charge. It’s just a common yardstick so I can see which automation is the heavy one, purely for load-ranking.

How the Audit Works

Three small Python scripts, one hand-maintained inventory file, and a weekly schedule. No database, no web framework, no new servers. The whole thing is maybe a few hundred lines.

🔧 Developer section: the three scripts

A weekly digest script stitches all three together — runs the drift scan, runs the cost estimate, writes a log, and sends me a formatted email plus a push to my phone. Once a week, Sunday morning, I get one message that answers “did anything change, and what am I spending?” and then I forget about it again.

Estimates, honestly labeled

The dollar figures are estimates, not metered from actual token counts — they’re driven by my calls-per-week and average-token guesses in the registry. I decided that was the right first version: a rough number I trust the shape of beats a precise number I’d never get around to instrumenting. If a job ever looked expensive, that’d be the signal to go measure it for real. So far none has.

A Detail That Mattered: Scan by Project, Not by File

My first instinct for the drift detector was to key everything on the exact file that makes the Claude call. That produced a mess of false alarms. Real projects don’t call Claude from one obvious place — they route the call through wrappers and imports, so the actual API call lives a couple of files deep from where the job kicks off. File-level tracking kept screaming “this file disappeared, a new file appeared!” every time I refactored, when nothing had actually changed.

The fix was to track drift at the project level: does this project call Claude, yes or no, and with which model? That collapsed all the noise and left only the alerts I actually care about — a whole new project starts using AI, or an existing one changes model. Same lesson I keep relearning: alert on the thing you’d act on, not on every raw event, or you’ll train yourself to ignore the alerts.

The Number

Here’s what the audit actually reports. Across a handful of small Haiku jobs running on the pay-as-you-go key, my real spend is about $1.86 a month. Not a typo. Under two dollars.

Meanwhile, the subscription jobs — the heavier, more frequent ones running against my flat-rate plan — carry a shadow cost of roughly $14 a month if you imagine billing them by the token. But I don’t pay that. It’s absorbed by the monthly subscription I was already paying for anyway. The single biggest “cost” in my whole automation stack is a job that, in reality, costs me nothing incremental at all.

Weekly digest — the bottom line
# Real pay-as-you-go (Haiku API-key jobs):
~$1.86 / month

# Subscription load (shadow $, NOT billed):
~$14 / month — absorbed by the flat-rate plan

# Drift check:
none — registry matches live jobs ✓

The whole point in one screen: a tiny real bill, a bigger load number that costs nothing extra, and a clean drift check.

Why so cheap? Because the expensive-per-token work all runs on the flat-rate subscription, and everything on the metered key is Haiku doing small, well-scoped tasks. Cheap model plus narrow job plus predictable volume equals a bill that rounds to a rounding error. The lesson isn’t “AI is free.” It’s “match the model to the job and know which meter you’re on.”

The Best Part Was the Drift Check

I built this expecting the cost number to be the payoff. It wasn’t. The payoff was that on its very first run, the drift scanner caught two jobs my own manual inventory had missed. I’d sat down, listed every Claude job I could think of by hand, and still forgot two of them. One was a scheduled job quietly calling Claude that I’d simply overlooked. The other turned out to be an on-demand tool with no schedule at all, which I then correctly marked as excluded.

That’s the whole argument for the tool in one anecdote. Left to my own memory, I was already wrong about my own systems after a few months. A cheap automated check that says “actually, you also have these” is worth far more than the cost estimate it ships alongside. Going forward, the value isn’t the number — it’s the weekly “nothing changed” (or the occasional “hey, this is new”).

How It Grew: From “Track My Credit” to “Track My Drift”

The shape of this project changed completely between the idea and the finish, and that’s the interesting part:

It’s a small, real example of a thing product work does to you: the feature you set out to build gets invalidated, and if you’re paying attention, the underlying need points you at a better one.

What went fast

What needed patience

The satisfying thing isn’t that the number came back small — though it did, and that was a relief. It’s that I no longer have a blind spot where a dozen automated jobs used to quietly call an AI on my behalf. Once a week I get a note that says everything’s where I left it and I’m spending less than a coffee. If you’re running your own automation against any paid AI, I’d recommend auditing it the same way — you might be pleasantly surprised, and you’ll almost certainly find something you forgot you built.

← Back to all writing