Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Keeping an Eye on Cost and Tokens: How Usage Works

Keeping an Eye on Cost and Tokens: How Usage Works

~6 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

Claude Code is a powerful tool, but using it isn't free - just like the context window from chapter 22 has a fixed size, usage also has a measurable size: tokens. This chapter explains the basics, without overloading you with pricing details that can change over time anyway.

What tokens are

A token is roughly a piece of a word - text gets broken down into such small units for processing. Both what you input (your prompt, but also every file read and every tool result) and what Claude answers are measured in tokens. Usage is usually billed based on the number of tokens processed.

What consumes tokens

  • Long files that get fully read in with Read from chapter 6.
  • Verbose tool results, like a very long test output or an extensive git diff.
  • A long, uncompacted conversation history, before compaction from chapter 22 kicks in.
  • Very lengthy, rambling prompts that contain more information than the task actually needs.

Keeping usage in view

The /cost slash command from chapter 16 shows you an overview of usage for the current session. It's especially worth checking after particularly long or expensive tasks - for example after a subagent from chapter 19 has run a larger research task across the entire recipe planner project.

Terminal
> /cost

Controlling cost sensibly

The good news: many of the principles from this series lower usage as a side effect, because they avoid unnecessary detours:

  • Clear, precise prompts from chapter 5 prevent follow-up questions and failed attempts that would otherwise cost extra tokens.
  • Subagents from chapter 19 keep the main session lean, instead of filling it with the intermediate steps of a research task.
  • Deliberate /clear for new, unrelated topics prevents an already very long history from being unnecessarily carried forward.
  • A well-maintained CLAUDE.md from chapter 10 saves you from re-explaining the same context in every session.

Tipp: Controlling cost sensibly doesn't mean skimping on prompt quality - quite the opposite: a single unclear prompt that leads to a wrong result and a time-consuming correction usually ends up costing more overall than a slightly longer but precise first prompt.

Exactly how much a given amount of usage costs in detail, and which models or pricing plans are available, changes over time - it's worth checking Anthropic's current pricing overview once concrete numbers matter.