cd /news/ai-tools/claude-code-pricing-what-you-re-actu… · home topics ai-tools article
[ARTICLE · art-138430] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Claude Code Pricing — What You're Actually Paying For ☕️

A developer's breakdown of Claude Code's token pricing shows that prompt caching is the dominant cost lever: cache reads cost 0.1× base input while cache writes cost 1.25× (5-minute TTL) or 2× (1-hour TTL), and an expired cache forces a full rewrite that can spike per-turn cost by 12.5× to 20×. The writeup notes that a single 1-hour cache rewrite on Opus 5 at 200k context runs about $2.00 versus roughly $0.10 to keep the cache warm, and that commands like /compact discard the warm cache mid-session. It recommends enabling terminal notifications, adding a status line, and running /usage to track cache hit rates and avoid silent rewrite costs.

by read4 min views1 publishedSep 23, 2026

Most developers are asking "how do I use fewer tokens?"

The better question is: how does the price actually form? Because once you understand that, you'll stop bleeding money in ways you didn't even know were happening.

There are 4 token types — and they're not priced equally.

(Using Claude Sonnet 4.6 as our baseline)

① Input tokens — 1×

Everything Claude reads: your messages, file contents, MCP tools, CLAUDE.md, system prompts. Your baseline cost.

② Output tokens — 5×

Everything Claude writes back. ~5× more than input. But here's the sneaky part: that output becomes input on the next turn. Every token Claude generated gets re-sent as context in your next message. Bloated responses compound across a session.

③ Cache write tokens — 1.25× or 2×

When Claude caches your context, you pay a write premium — paid upfront, and again every time the cache expires and gets rewritten. The exact cost depends on which TTL tier you're on (more on that below).

④ Cache read tokens — 0.1×

This is where the magic lives. Reading from cache costs 10× less than fresh input. That gap is what makes Claude Code economically viable for large codebases.

There are two cache durations — and they have different write prices:

TTL Write cost Read cost
5 minutes 1.25× base 0.1×
1 hour 2.00× base 0.1×

Both TTLs read at the same cheap 0.1× rate. The difference is only at write time.

The 1-hour write costs 60% more per token than the 5-minute write. That premium only pays off if you actually reuse the cache across a gap longer than 5 minutes — otherwise you paid extra for nothing.

Which one you get depends on how you run Claude Code:

So if you're on the API path, the coffee-break penalty is far more acute. A 6-minute that costs a subscriber almost nothing can trigger a full rewrite for an API user.

The TTL is rolling, not fixed from session start. Every cache hit resets the clock. Stay active and the cache stays warm indefinitely. The danger isn't a single long — it's not knowing the clock is ticking at all.

Go quiet past your TTL? The cache expires. Your next message triggers a full cache rewrite — that's a 12.5× price jump for 5m cache, and 20× for 1h cache, compared to a simple cache hit.

For Opus 5 at 200k context, a single 1h cache rewrite costs ~$2.00. Keeping it warm costs ~$0.10. That's per turn — let the cache expire three times in one session and you've spent $6.00 just on rewrites, without shipping a single extra feature. Miss enough cache windows in one session and you can double your bill without shipping a single extra feature.

These actions force a full cache rewrite — even mid-session:

/compact Each one blows away the warm cache and starts the write cycle again.

① Enable notifications

Open /config inside Claude Code and set Notifications to match your terminal (terminal bell, iTerm2, Ghostty, or Kitty). Claude pings you the moment it finishes, so you step away after it responds, not during. Come back, send the next prompt, cache stays warm.

② Add a status line

Claude Code supports a live status line in your terminal showing context size, cost, and cache hit rate. Watching that number drop is the earliest signal your TTL is about to expire — before the expensive rewrite hits.

③ Run /usage

Shows a full breakdown of token consumption including cache hits, cache writes, input and output. Helps you spot if you're bleeding money on rewrites without realizing it.

Token Type Cost When it triggers
Input Every turn, fresh content
Output Everything Claude writes
Cache write (5m TTL) 1.25× API default — first write, or after expiry
Cache write (1h TTL) 2.00× Subscriber default — pays off across longer gaps
Cache read 0.1× Every turn within TTL (same for both tiers)

Cache is your biggest lever. Writing it costs a little. Reading it costs almost nothing. Letting it expire costs you both.

Stay in the window. Use notifications. Don't change your model mid-session without a reason.

Go make your coffee. Just come back before the clock runs out. ☕🙃

What's your current Claude Code cost per active day? Drop it in the comments — curious where people land.

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-pricing-…] indexed:0 read:4min 2026-09-23 ·