Anthropic tells Claude Code users how to stop wasting tokens

Anthropic tells Claude Code users how to stop wasting tokens

N
News Editor
2026-08-16 00:05:10
Anthropic has published a blog post explaining why Claude Code sessions can become unexpectedly expensive and how developers can cut token bills without changing the work itself. The company outlined six practical steps: clear sessions after finishing a task, lock in the model and effort level at the start, attach files with @ instead of typing paths, reduce noisy command output with quiet flags, run /compact before cache expiry, and offload large-output work to subagents. The post also breaks down the pricing mechanics behind Claude Code. Anthropic says usage costs are shaped by both model choice and reasoning intensity, with output tokens priced at five times input tokens because decoding is sequential while prefill runs in parallel. It lists pricing for Opus 5, Sonnet 5, and Haiku 4.5, and says developers spend about $13 a day on average, or roughly $150 to $250 a month. A large part of the savings comes from prompt caching. Anthropic says cache reads cost one-tenth of normal input pricing, but cache invalidation can erase that benefit if users switch models, change effort settings, toggle Fast mode, compact conversations, let cache windows expire, or resume old sessions. The post frames token management as a new developer skill as AI-assisted coding becomes more deeply embedded in day-to-day workflows.

Anthropic has published a new blog post aimed at a problem many Claude Code users have already felt in practice: token costs can climb quickly if a session is handled poorly.

The company’s message is blunt. Developers do not need to keep burning tokens on avoidable overhead, and much of that overhead comes from long conversations, cache misses, large command output, and unnecessary model switches.

Six ways Anthropic says users can spend less

Anthropic opens the post with six specific recommendations for cutting Claude Code costs:

  • Use /clear after a task is finished. Once a bug is fixed, clear the current conversation so files and command output from the previous task do not keep occupying context in the next one.
  • Set the model and effort level at the start of a session. If either is changed later, previously accumulated prompt cache is invalidated and the full conversation history has to be priced again at full cost.
  • Attach files with @ instead of manually typing paths. That lets Claude access the file directly instead of spending an extra tool call to find and read it.
  • Add quiet flags to noisy commands. Anthropic points to configurations such as --reporter=dot in CLAUDE.md so test runs return a short summary instead of hundreds of lines of detailed output.
  • Run /compact before stepping away. If the conversation is still within the cache window, compacting it costs only one-tenth of the normal amount. If the cache has already expired, Claude has to reread the conversation at full price before compressing it.
  • Send large-output work to a subagent. A subagent runs in its own context window and returns only the conclusion, while the files it reads and the command output it produces stay out of the main conversation.

How Claude Code charges for usage

According to the post, Claude Code usage can be billed through the API on a consumption basis, while subscription tiers range from $20 to $200 per month across three plans.

Anthropic says developers consume about $13 in tokens per day on average, with monthly spending landing between $150 and $250. It also notes that even for the same bug fix, costs can vary by several multiples depending on how the request is phrased.

One reason is structural: every round of a conversation carries all previous rounds with it. As a session grows longer, each new turn becomes more expensive.

Anthropic tells Claude Code users how to stop wasting tokens 3

Input and output tokens are priced differently

Anthropic breaks a request into two stages.

The first is prefill, where the model reads the entire request at once. That includes the system prompt, CLAUDE.md, the user message, and everything accumulated in the earlier conversation. Those are input tokens.

The second is decode, where the model generates tokens one by one. That includes its thinking, tool calls, and the final text the user sees. Those are output tokens.

The distinction matters because prefill is parallelized, processing all input tokens in a single pass across the GPU. Decode is sequential. Each generated token requires another model run. A 200-token answer, in Anthropic’s framing, means 200 separate computations.

That is why output tokens are priced at five times the cost of input tokens.

Model selection and effort level shape the final bill

The post lists the following model prices:

Anthropic tells Claude Code users how to stop wasting tokens 4

  • Opus 5: $5 per million input tokens and $25 per million output tokens
  • Sonnet 5: $2 per million input tokens and $10 per million output tokens
  • Haiku 4.5: $1 per million input tokens and $5 per million output tokens

The other major variable is reasoning intensity. Anthropic says most output tokens in a session are thinking tokens, and effort level determines how many of those are produced. Higher effort means the model thinks longer and emits more reasoning tokens. The gap between max and low can be severalfold.

The company’s practical advice is straightforward: use Sonnet for simpler work and reserve Opus for harder problems, rather than paying premium rates where they are not needed.

Prompt caching is one of the biggest cost levers

Anthropic presents caching as another major factor in Claude Code pricing.

Each request often begins with the same prefix: the system prompt, tool definitions, CLAUDE.md, and conversation history. If that prefix is byte-for-byte identical to the previous request, the server does not need to recompute it and can instead reuse the previous result.

Cache reads cost 0.1x normal input pricing, the post says, which cuts 90% of that part of the bill. Cache writes are more expensive, at up to 2x, but that write happens only once. Every later turn can then benefit from 0.1x cache reads.

Anthropic tells Claude Code users how to stop wasting tokens 5

Anthropic illustrates the effect with a 50,000-token conversation history. Without cache, rereading that history costs full price every turn. With cache hits, the same 50,000 tokens cost one-tenth as much. Over 20 or 30 turns, the accumulated savings become large.

Six common ways cache gets invalidated

The weak point is that caching only works when matching stays continuous from the first byte of the request. If something changes partway through, the cache is broken from that point forward.

Anthropic lists six situations that commonly invalidate cache:

  1. Changing models with /model. Each model keeps its own cache, so moving from Sonnet to Opus means the entire history must be prefetched again at Opus pricing.
  2. Changing reasoning intensity with /effort. Effort level is part of the cache key, so a change forces the conversation history to be recomputed.
  3. Toggling Fast mode. Anthropic says the effect is the same: cache is lost.
  4. Using /compact. Once the conversation is rewritten into a summary, the previous content no longer matches.
  5. Letting the cache expire. Cache lasts one hour for subscription users and five minutes by default for API users. After that, the next request triggers a full recomputation.
  6. Restoring an old session. If enough time has passed, cache is usually gone and the conversation has to be priced again at full cost.

The post advises users to lock the model and effort level at the beginning of a session and avoid switching them during the task. It also recommends saving /compact for the point when a user is about to take a break.

Anthropic also points to a less obvious trap: opusplan mode switches models when entering and exiting plan mode. Each transition invalidates cache and adds another full-price prefill.

Context keeps growing, and the cost curve approaches O(n²)

Cache can cheapen repeated history, but it cannot stop the history itself from getting larger.

Anthropic tells Claude Code users how to stop wasting tokens 6

Anthropic says that every time Claude reads a file, that file content is appended to the conversation. Every time it runs a command, the command output is added as well. From the turn where that material enters the session, it keeps being carried forward and resent in every later turn.

By turn 40, the session is effectively sending the accumulated contents of turns 1 through 39 all over again. The company describes this growth as approaching quadratic, or O(n²).

Claude Code does have a safeguard. If command output exceeds 30,000 characters, it is not inserted directly into the conversation. Instead, it is written to a temporary file and represented by a short summary. But output below 30,000 characters is not automatically handled that way.

Anthropic gives the example of a test framework printing 400 passing lines, with each line containing a few dozen characters. That can stay under the 30,000-character threshold, which means the full output remains in the conversation history and gets resent in later turns.

How Anthropic suggests trimming context

The blog expands on several practical ways to keep sessions lean.

Anthropic tells Claude Code users how to stop wasting tokens 7

Attach files with @

Instead of typing a path and making Claude search for the right file, users can attach the file directly with @. That avoids exploratory grep searches and trial openings of several files, all of which would otherwise become part of the conversation history.

Quiet noisy commands

One example in the post is adding a line such as run tests with npx vitest run <file> --reporter=dot to CLAUDE.md, so test commands return only a few dot-style lines rather than a full verbose log. Anthropic frames it as a one-time setup that can remove hundreds of lines of context from future sessions.

Use subagents for large-output work

Subagents operate in separate context windows and return only the answer to the main conversation. The files they read and the lengthy command output they generate are discarded from the parent session. Anthropic highlights jobs such as scanning logs for anomalies or reviewing a large file, where the user wants the conclusion rather than the full path taken.

Use /clear between tasks

Anthropic places heavy emphasis on /clear. Once a bug is fixed, the files, command output, and exploratory steps tied to that bug no longer help with the next task. If they remain in context, they keep consuming tokens in every later turn.

For users who do not want a full reset, /compact is the alternative. Anthropic says a conversation of 10,000 to 20,000 tokens can be compressed to 1,000 to 3,000 tokens.

/rewind can remove unhelpful recent turns

The post also mentions a less prominent but free option, /rewind. If the last few turns went off track, users can cut those turns away while preserving the cache for the earlier part of the session.

Anthropic tells Claude Code users how to stop wasting tokens 8

Anthropic frames token control as a new developer skill

Anthropic closes by arguing that these habits amount to a new layer of developer literacy. The issue is no longer only frameworks and programming languages. It is also knowing which model to pick, how to manage context, how to preserve cache, and how much reasoning intensity a task actually needs.

The company says that skill set did not exist a year ago, but it now determines whether the same task costs $3 or $30.

Anthropic points to its own internal use as evidence. The post says 80% of its code is written with AI, code merges increased eightfold over a year, and benchmark testing sped up by 52x. At that level of usage, the company argues, unmanaged token spending would quickly eat through budget.

From that perspective, the blog is not only about a few tricks to save money. It is also a guide to operating in an AI-assisted coding workflow where each action carries a measurable token cost.

The reference cited is Anthropic’s blog post, maximizing the value of your claude code sessions. This article is based on a MarsBit report sourced from the WeChat public account 「新智元」, written by 「ASI启示录」 and edited by 「摩西」.

This article was originally published by Bit.Fan. For more cryptocurrency news and market insights, visit www.bit.fan.
140

Disclaimer:

The market information, project data, and third-party content displayed on this platform are for industry information sharing only and do not constitute any form of investment advice or return commitment.

Cryptocurrency trading carries high risks. Users should fully assess their risk tolerance and make independent decisions. All profits, losses, and legal responsibilities are borne by the users themselves.