How to Reduce Token Costs When Using Claude Code

83.3K views
•
August 6, 2026
by
Chase AI
YouTube video player
How to Reduce Token Costs When Using Claude Code

TL;DR

Keep long Claude Code conversations active within the one-hour cache window, because cached history is described as costing $1 per million input tokens versus $20 per million when written again. If the cache has expired, consider clearing the conversation and rebuilding context from project files instead of immediately resending hundreds of thousands of tokens at the higher rate.

Transcript

You might be paying 20 times more for your Claude code tokens than you need to and not even know it. Understanding how to get the most out of your Claude code tokens is one of the most important skills you can master. And it goes well beyond simply putting a line in your cloud. MD file saying, "Be brief." Because if you don't understand things like... Read More

Key Insights

  • Prompt caching is the largest cost-saving mechanism discussed because it allows Claude to read accumulated conversation history at a much lower rate than writing that history into a new cache. The transcript describes a 20-fold price difference between these two input-token operations.
  • Every follow-up message includes the prior conversation context, so sending a short new request does not mean only that request is billed as input. As the conversation expands, each turn may involve thousands or hundreds of thousands of historical tokens.
  • The context window is the available token budget for a conversation. The transcript says the discussed Claude models have a one-million-token context window, and both user inputs and model outputs accumulate within that window as the exchange continues.
  • Output tokens are priced separately from input tokens and are described as generally costing five times more. The transcript lists output pricing of $50 per million tokens for Fable and $25 per million for Opus, while emphasizing that caching primarily affects input history.
  • The prompt cache remains available for one hour without activity. Each new message refreshes that period, so a message sent after 59 minutes resets the counter, while returning after more than an hour can require the entire conversation history to be written again.
  • A cached 500,000-token history costs about 50 cents to read at the stated $1-per-million rate. If the cache expires, writing that same history at the stated $20-per-million rate costs about $10, even when the user's new message is extremely short.
  • Cache resets can be triggered by more than inactivity. The transcript identifies switching models, changing effort level, using fast mode, connecting or disconnecting an MCP server, changing plugins, denying tools, compacting a conversation, and upgrading Claude Code as reset conditions.
  • Clearing an expired conversation can be more economical than restoring its entire history. In a code project, files may preserve enough evidence of completed work for Claude Code to inspect the codebase, reconstruct the current state, and continue within a fresh conversation.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How does prompt caching reduce Claude Code token costs?

Prompt caching stores the accumulated conversation history in a document that Claude can repeatedly read at a reduced rate. The transcript states that reading cached input costs $1 per million tokens, while writing input into the one-hour cache costs $20 per million. Because every follow-up request includes earlier context, preserving the cache can prevent a long conversation from being repeatedly charged at the higher rate.

Q: Why can a short Claude Code message still cost a lot?

A follow-up message does not send only its newly typed words. It also sends the conversation history required for Claude to understand the request in context. A very short message can therefore involve hundreds of thousands of prior input tokens. If that history remains cached, it is read cheaply. If the cache has expired or reset, the same history can be charged at the higher cache-write rate.

Q: How long does the Claude Code prompt cache last?

The prompt cache lasts for one hour without activity, according to the transcript. That does not mean every session ends exactly one hour after it starts. Each message refreshes the timer, so sending another request after 59 minutes starts a new one-hour period. If no activity occurs for more than an hour, the cache disappears and the next turn may need to write the full history again.

Q: What happens when a long Claude Code cache expires?

When a long conversation's cache expires, its accumulated history is no longer available at the cheaper cache-read rate. The next message may require the full history to be written into a new cache at the stated $20-per-million-token rate. In the transcript's 500,000-token example, this changes the historical-input cost from about 50 cents with a cache to about $10 without one.

Q: What actions can reset the Claude Code prompt cache?

The transcript says the cache can reset when the user switches models, changes the effort level, changes fast mode, connects or disconnects an MCP server, modifies plugins, denies tools, compacts the conversation, or upgrades Claude Code. A reset matters because the next request may write the accumulated history at the higher rate instead of reading it from the existing lower-cost cache.

Q: When should you clear a Claude Code conversation?

Clearing is useful after the cache has expired when the previous conversation is large and its details are already reflected in the project files. The slash-clear command wipes the conversation history and starts fresh. Claude Code can then inspect the codebase, determine what work has already occurred, and rebuild only the context needed to continue, avoiding the cost of restoring an unnecessarily large transcript.

Q: How are cached and uncached input tokens priced in the example?

The transcript describes a one-hour cache write at $20 per million input tokens and a cache hit at $1 per million input tokens. Newly added prompt content is written at the higher rate, while previously cached conversation history is read at the lower rate. On the following turn, that newly added content becomes part of the cached history, provided the cache remains valid.

Q: Why should Claude Code users consider compaction before the context becomes very large?

Compaction is presented as an option when a conversation has grown long or its cache has been lost. The transcript recommends not waiting for automatic compaction after reaching very large token counts, mentioning conversations in the hundreds of thousands of tokens. Compaction can reduce retained conversational context, although it is also listed among the actions that reset the cache, so its timing affects the next request's cost.

Summary & Key Takeaways

  • Claude Code sends the accumulated conversation history with every follow-up message, not merely the newest prompt. This can make input usage grow rapidly as a session reaches thousands or hundreds of thousands of tokens. Prompt caching reduces the cost of repeatedly reading that history while the cache remains active.

  • The one-hour prompt cache refreshes whenever another message is sent, but it disappears after an hour without activity. The transcript states that cached history costs $1 per million tokens to read, while a one-hour cache write costs $20 per million, creating a 20-fold difference for repeated context.

  • When a cache is lost, users can clear the conversation and let Claude Code reconstruct relevant context from files in the project. Compaction is another stated option, although the transcript recommends considering it before reaching very large context sizes. Model changes, configuration changes, plugins, and tool connections can also reset caching.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Chase AI 📚