[BUG] Cost increased a lot

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 6 comments · opened May 17, 2025 · closed May 17, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: v0.2.115
  • Operating System: macOS 15.4.1
  • Terminal: Wezterm

Bug Description

I started using claude code and all went fine. Then suddenly it started to get very expensive. Even a short message like "hi" costs me 0.1 USD. I see it's using a lot of cache write, but i'm not sure if that is whats causing it. Asking it to install a cli tool with brew costed like 0.5 USD.

Steps to Reproduce

  1. <!-- First step -->
  2. <!-- Second step -->
  3. <!-- And so on... -->

Expected Behavior

Less cost for simple commands.

Actual Behavior

Saying Hi cost me 0.1 USD

Additional Context

hi

⏺ Hello! How can I help you with your code today?

/cost

⎿  Total cost: $0.0950
Total duration (API): 4.2s
Total duration (wall): 10s
Total code changes: 0 lines added, 0 lines removed
Token usage by model:
claude-3-7-sonnet: 4 input, 15 output, 0 cache read, 25.3k cache write

View original on GitHub ↗

6 Comments

dayowe · 1 year ago

Thanks for catching this! I downgraded to 0.2.108 and the cost of saying hi went from $0.10 to $0.0006!

npm install -g --force --prefer-online @anthropic-ai/claude-code@0.2.108

Edit:
The cost calculation in 0.2.108 is incorrect. Multiplying by 6.67 gave me approximately what my billing section says

Edit: i tested with the most recent version vs the 0.2.108 and both cost $0.1 according to billing. So the value in the most recent version is reflecting actual cost.

guidedways · 1 year ago

I've been experimenting a lot in the past and cost seems to fluctuate. At times I would launch Claude and immediately quit and it would say "Cost: $0.006" or something for doing nothing.

I've since switched to Claude Max. Never looking back. Excellent value for money as otherwise costs spiral out of control.

bcherny collaborator · 1 year ago

Hey! We recently fixed an inaccuracy in the /cost shown in the UI, so if the cost increased, it is now more accurate and should match what you see in your Anthropic Console. You might also be charged a few cents here and there for various background jobs (eg. summarizing your conversations to make them easier to browse in --resume mode). As @guidedways suggested, if cost is something you're worried about, we recommend the Max plan, which has quite generous rate limits (most people will never hit a limit).

sleipner42 · 1 year ago

Thanks for the quick responses. I updated, but I'm not sure if these costs is to be expected or not? (The cost per say it's not any problems, but would be good to know if these numbers are correct or not)

Here is the cost after implementing a feature, the number of input / output is not so much, but there is a lot of cach read / write.

/cost

⎿  Total cost: $5.91
Total duration (API): 9m 31.9s
Total duration (wall): 38m 42.9s
Total code changes: 150 lines added, 10 lines removed
Token usage by model:
claude-3-7-sonnet: 537 input, 16.2k output, 2.6m cache read, 1.3m cache write

arty-hlr · 1 year ago

I had the exact same experience tonight saying hello and asking simple questions in an empty directory with no context @sleipner42 .

@bcherny This is insane. We are billed for typing /cost and background API calls also cost tokens? What's up with the tens of thousands of input tokens used for simple questions, where do those come from? Is that also normal? Is upgrading to the max subscription plan really your answer to this cost madness? "if cost is something you're worried about, spend $100 a month instead"??? Sorry if I seem a bit unhinged but you closed the issue without addressing the actual problem as well, I don't find that very professional. I was just watching your recent "Mastering Claude Code in 30 minutes" talk and did NOT expect this to be my experience just trying it out for a few minutes, bleeding tokens left and right.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.