Stop Wasting Money on Anthropic! Official Tips: Cost for the Same Task Can Vary by 10x
Anthropic officially breaks down Claude Code's token billing mechanism: costs for the same task can vary by 10x.
On August 14, Anthropic published an official blog post that thoroughly explained this matter: nine out of ten dollars you pay for Claude Code are not for "thinking," but for repeatedly resending things it has already read. The official post also provided six operational guidelines; following them will maximize token savings.
This article will first help you understand the mechanism (why the same task can differ by 10x in cost), and then break down each of the six official principles.
Layer 1: What consumes tokens isn't the "functionality," but re-reading files already read
Claude Code charges by the token. Every message you send, every file you read in, and every answer it generates are counted in tokens. The cost of a single request is determined by two phases:
- Prefill: Reading your input and context. The GPU can process this large chunk of text in parallel, so it's relatively cheap.
- Decode: Generating the answer token by token. Generation is serial—one token is generated before the next—so output tokens are roughly 5 times more expensive than input tokens.
Most people think the cost lies in "high output," but the real pitfall is elsewhere: Once a token enters the conversation, it gets resent in every subsequent round. By the 40th round, all the files read and command outputs run in the previous 39 rounds must be sent again. The official complete formula is: Number of tokens in context × Number of rounds they stay × Number of concurrent contexts.
A concrete example: You have it read a 5000-line configuration file and then modify three files. This configuration file stays in the context and is resent every subsequent round. The longer the task drags on and the more files are read, the higher this "resend tax" becomes—until one round you realize most tokens are paying shipping costs for history.
Worse is the pollution from "searching." A vague instruction—"fix the failing test"—might cause Claude to first grep, then tentatively open several files, and possibly pull in a bunch of search results. All these operations enter the conversation history, making every subsequent round more expensive.
And that's not even the most counterintuitive part.
Layer 2: Caching is the biggest cost-saving lever, and the most fragile switch
To prevent you from actually paying multiple times for the same thing, Anthropic implemented prompt caching: if a piece of context has been computed before, reading it again costs only 1/10th the price—a direct 90% saving.
This is the most cost-effective part of the entire saving system, but it's absurdly fragile:
- Switching
/model: Each model has independent caching; switching invalidates the entire segment (includingopusplanmode). - Adjusting
/effort: Reasoning intensity is part of the cache key; adjusting it once invalidates the cache. - Switching fast mode: This also participates in the cache key; if you want it on, turn it on at the start.
/compact: It replaces old dialogue with a shorter version, effectively actively invalidating the cache once.- Time: Caches expire. According to the official text, for subscribers it's about 1 hour; for API Key users it's shorter, but setting
ENABLE_PROMPT_CACHING_1H=1can extend it to 1 hour.
Thus, absurd situations arise: you painstakingly get the cache running, then casually switch /model, causing the entire history to be recalculated at full price; you come back after an hour's break, the cache expires, and it's recalculated at full price again. The official post even points out that restoring a massive old session might be the most wasteful request you make.
Understanding these two mechanisms makes the six principles all make sense.
Six Cost-Saving Principles: Understanding Starts Saving!
The six principles given by the official post can each be turned into a concrete action. Below, we break them down one by one: when to do it, how to do it, why it saves, how much it saves, and the most common pitfalls.
Principle 1: /clear between tasks
- When to do it: After one task is completed, before starting the next.
- How to do it: Type
/clearto start a clean page of dialogue. - Why it saves: All files read and command outputs run in the previous task remain in the context, and must be resent every subsequent round (the "resend tax" mentioned in Layer 1). Clearing means the new task only pays for itself, not for the history of the old task.
- How much it saves: The longer the old task and the more things read, the greater the benefit of clearing; this is the only principle among the six that "pays off more the more you use it."
- Common pitfall: Fear of losing the session. To keep it, first
/renameit with a name before/clear, and you can retrieve it anytime later; don't drag remnants into the new task because "you might need them."
Principle 2: Set /model and /effort at the start
- When to do it: Before each new session begins.
- How to do it: Use
/modelto select the model,/effortto set the reasoning intensity, and don't change them afterward. - Why it saves: Both model and reasoning intensity participate in the cache key. Switching midway invalidates all accumulated cache, causing the entire dialogue to be prefilled at full price again—the "discount" you built up on the old model is instantly zeroed.
- How much it saves: The cost of one mistaken switch is roughly equivalent to rereading the entire history at full price, often more expensive than what you saved.
- Common pitfall: Midway thinking "let's try a stronger model." If you really need to switch, do it after
/clearto minimize loss; each model has independent caching, andopusplanmode counts as a switch.
Principle 3: Use @ to reference files, don't type paths manually
- When to do it: Whenever you need to mention any file in the dialogue.
- How to do it: Directly
@filename; the file will be attached with the message, done in one step. - Why it saves:
@directly attaches, saving a tool call for file reading; just typing the filename forces Claude to first search and locate it, possibly tentatively opening several files—this entire series of actions enters the conversation history, becoming permanent pollution that burdens every subsequent round. - How much it saves: It saves the entire series of actions: "search + tentative opening"; individually these actions aren't expensive, but they stay in the context and drag down all future rounds, accumulating significantly.
- Common pitfall: "It's just one file, typing it will find it anyway"—the search process itself enters history; you're not saving a call, you're clogging history.
Principle 4: Add silent parameters to noisy commands, or delegate to sub-agents
- When to do it: When running commands with large output, especially tests, builds, logs.
- How to do it: Add parameters that output only summaries to commands, e.g., use
--reporter=dotfor tests, and write daily silent commands into CLAUDE.md for fixed effect; or delegate such tasks to sub-agents to run in independent contexts. - Why it saves: Command outputs enter conversation history like files and stay for the entire session—hundreds of lines of logs carried every subsequent round. Silent output keeps history light; sub-agents have independent context windows, files read and commands run don't pollute the main dialogue, only conclusions are passed back.
- How much it saves: One line of
--reporter=dotmight save a test session from carrying a lot of repetitive token fat. - Common pitfall: Output exceeding a certain scale is automatically written to files, leaving only a preview (adjustable with
BASH_MAX_OUTPUT_LENGTH), but the default preview also occupies context—what should be silent still needs silencing.
Principle 5: Run /context at the start of a new session
- When to do it: At the beginning of each new session.
- How to do it: Run
/contextto see what's currently loaded: CLAUDE.md, MCP tool definitions, skills, etc. - Why it saves: Every loaded item occupies context and is resent repeatedly. Seeing unnecessary big items, remove them; don't let "environment tax" keep pressing down.
- How much it saves: A single MCP server's tool definition can eat many tokens; with several servers attached, environment loading alone is a fixed overhead.
- Common pitfall: Letting CLAUDE.md become a junk drawer, growing longer and longer. A concise, stable CLAUDE.md is the "prime real estate" most worth keeping in cache.
Principle 6: /compact before taking a break
- When to do it: When you're leaving the computer but the session is still open.
- How to do it: While the cache is still hot, first
/compactto compress the dialogue into a summary. - Why it saves: The cost of compression depends on whether the context is still cached—compressing while cache is valid costs about one-tenth; compressing after cache expires (about 1 hour for subscribers, shorter for API Key) means rereading the entire segment at full price.
- How much it saves: One-tenth inside cache vs. full price outside cache—a 10x difference for the same action.
- Common pitfall: Wanting to remove only the last few rounds but using
/compact. For this scenario,/rewindis enough; it just rolls back a few steps, doesn't rewrite history, and is almost free on cache.
Three Widespread Misconceptions
- "Larger models are always more expensive"? Not necessarily. Larger models might solve problems in fewer rounds, making total cost lower; use smaller models for routine work, switch to larger ones for complex problems.
- "With caching, context can be as long as you want"? No. Excessively long contexts make models reason inefficiently, and code quality also declines.
- "Automated loops run for free"? No. Each iteration of a loop carries the full conversation context; running it in a session stacks costs several layers.
Session Template: Stringing the Six Principles into a Timeline
Start of Session (For Each New Task)
/clear, keeping only items relevant to this task.- Set
/modeland/effortupfront; don't switch mid-session. - Run
/contextonce to clear unnecessary loads.
During the Session
- Always use
@to reference files; never type paths manually. - For commands with heavy output, add silent parameters; write silent commands into CLAUDE.md.
- For high-frequency, high-output subtasks delegated to agents, assign a smaller model separately (Haiku or Sonnet).
- To discard the last few turns, use
/rewind, not/compact. - For low-intensity mechanical tasks, you can disable thinking tokens with
MAX_THINKING_TOKENS=0.
Before a Break
- While the cache is still fresh, compress once with
/compact.
In a nutshell: Ensure every token you send serves only the problem you're actually trying to solve right now.
How to Confirm You're Saving Money
/costor/usage: Check current session consumption and cache hit rate. A low hit rate suggests you might be frequently breaking the cache—review if you're often switching models or adjusting effort./usage-credits(Pro/Max subscription): Set a monthly spending cap to apply the brakes for yourself./status: Verify current configurations like model, effort, fast mode, etc., to confirm your starting posture is correct.
The evaluation is simple: Run the same type of task before and after implementing these changes, and compare the numbers and cache hit rate from /cost—don't rely on gut feeling.
Wrapping Up
A 10x cost difference for the same task is never about the model; it's about how you interact with the session. The official docs have laid out the mechanics; now it's your habits' turn—make /context and /cost part of your startup routine. Only then have you truly finished reading this piece.
References
- Anthropic Official Blog: Maximizing the Value of Your Claude Code Sessions — The original source interpreted in this article, where the official team breaks down the token billing mechanism and provides six money-saving tips.
- 36kr: Related Report — Coverage and interpretation of this official blog post by domestic media, serving as a supplementary Chinese perspective.
Scan with WeChat to share
Screenshot or long-press the QR code to forward it
📌 Related Posts
Cursor Advanced Usage Tips
Developers & entrepreneurs, bookmark this! Cursor's AI features can double your coding efficiency.
Cursor 0.50+ Model Selection Practical Guide: Optimal Balance Between Performance and Cost
Master Cursor 0.50.3: optimize dev efficiency and cost with new features, billing, and model pool changes.
Loop Engineering
Over two years, we've mastered AI prompting. Now Silicon Valley's new focus is Loop Engineering.
Subscribe to Updates
Leave your email to get the latest articles and project updates — or subscribe with your favorite RSS reader
Add 0to1.site/en/rss.xml to RSS readers like Feedly or Inoreader
Comments (no account needed, anonymous welcome)
No comments yet — be the first!