Where the tokens actually go
- Context resend: each turn includes everything relevant that came before. Turn 20 carries the freight of turns 1 through 19.
- File reads: every file the agent opens becomes input tokens, and often stays in context for the rest of the session.
- Tool output: test runs, build logs, and diffs are all tokens in. A noisy failing test suite is surprisingly expensive to look at repeatedly.
- Iteration loops: try, fail, read the error, try again. Necessary, and each cycle repays the whole context toll.
Prompt caching blunts a lot of this, cached context rereads at a tenth of the fresh rate per prompt caching economics, which is precisely why agent harnesses lean on caching hard. It is also why cost per session still grows with session length: the fresh increment each turn is what compounds.
Subscription or API: measure, then choose
The flat subscription versus per token API question has one honest answer: measure a typical week of your usage in tokens, price it at current API rates (live at useweckr.com/pricing.json), and compare. Heavy daily agent use tends to favor bundled plans; bursty or occasional use tends to favor pay per token. The trap is deciding from vibes, usage feels bigger than it is on light weeks and smaller than it is on heavy ones. The same measure first discipline as estimating AI feature cost, pointed at yourself.
The transferable lesson: you are about to ship this problem
If your product has or will have an agentic feature, research assistants, multi step workflows, tool using chat, you are shipping Claude Code’s cost profile to your own customers, with two differences that matter. Your users trigger the loops, not you, so the burn is involuntary from your side. And it scales with your user count, so one looping integration is not a bad afternoon, it is a bad invoice. The failure pattern and its detection are covered in AI agent loop detection and AI agent cost control; the short version is that velocity, tokens per user per minute, is the signal that catches runaway agents while they are running, not at month end.
Weckr ships that detection tuned for agent workloads: velocity alerts when any user burns abnormally fast, per user caps that block or downgrade before the next call, and per feature cost so you know what your agent features cost per customer against what they pay. Two lines around the client you already have.
FAQ
Why does Claude Code use so many tokens?
Because agentic coding is context hungry by design. Every turn resends the conversation so far, plus file contents it read, tool outputs, and diffs. A session that reads a dozen files and iterates on changes accumulates a large context that gets reprocessed on each step. It is not waste in the pejorative sense, it is what letting a model see your codebase costs, but it explains why coding agents burn tokens far faster than chat.
Is Claude Code cheaper on a subscription or the API?
Depends entirely on your volume. Subscriptions bundle generous usage at a flat price and win for heavy daily use. API billing is pure pay per token and wins for light or bursty use. The honest way to decide is to measure a typical week of your own usage in tokens, price it at API rates, and compare against the subscription. Guessing systematically favors whichever option you already emotionally prefer.
How do I reduce Claude Code token consumption?
Scope the context. Point it at specific files rather than letting it explore, keep CLAUDE.md lean since it loads every session, start fresh sessions instead of continuing very long ones (context compounds), and use cheaper models for mechanical tasks where the harness allows. The biggest single lever is session length: cost per turn grows with everything that came before it.
Do the same economics apply to AI agents in my own product?
Yes, and more dangerously, because your customers trigger the loops instead of you. Any agentic feature you ship inherits the same context compounding: multi step tasks resend accumulated context each step, so cost per task grows superlinearly with steps. The difference is that in your product, a runaway loop lands on your bill at scale, which is why per user velocity detection and caps exist.
How do I see what my own AI coding or agent features cost per user?
Tag every model call with the user and feature, log token counts including cache reads and writes, and price them at current rates. For products, Weckr does this in two lines and adds loop detection tuned for exactly the agentic pattern: a velocity alert fires when any user burns tokens abnormally fast, before the invoice arrives.
Keep reading
Agents are worth it. Unwatched agents are not.
The token burn is the cost of capability; the risk is running it blind at customer scale. Weckr watches the burn per user and per feature and stops the runaways automatically. See the loop detection on the live demo, free for 50,000 requests a month, or start with the AI cost and margin guide.