Give Me 14 Mins and I'll Save You Millions of Claude Tokens

Duncan Rogoff | Learn Claude Code

Key takeaways

Claude Code saves tokens by reusing cached context, but long chats, cache-expiring breaks or model switches, oversized startup instructions, excessive test output, and costly defaults can still increase usage. The practical fixes are to clear chats between jobs, keep the same model during a job, keep `CLAUDE.md` lean, trim test output, and choose settings appropriate to the task.

Context rereads are the central source of avoidable cost: `/compact` requires an extra read and is mainly useful when a chat is nearly full or continuing into a related project, while a handoff document preserves selected details across a cleared chat. Compare `/usage` before and after changes; lower usage means more monthly-plan capacity or a smaller API bill.

Video Flow

  1. 0100:00

    Token costs and a fresh chat

    Each new message includes the conversation context, so longer chats and files read earlier can raise the cost of later messages. Use `/clear` for a new job; `/rename` lets you find and reopen an earlier chat.

  2. 0201:19

    Cache reuse and expiration

    Claude Code can reuse unchanged chat context from its cache at a fraction of the normal reading price, but a model change forces a full reread. The stated cache window is about an hour on a monthly plan and five minutes for API or extra-credit use.

  3. 0303:17

    Connectors, long results, and sub-agents

    Claude Code loads connector details only when needed, saves very long results separately, and returns a short summary from sub-agents. Connectors and sub-agents still have token costs, so sub-agents are worthwhile mainly for large, messy jobs.

  4. 0404:22

    When compact helps—and when to clear or hand off

    `/compact` reads the chat to create a summary, so it is not a cost-saving shortcut; use it when a nearly full chat must continue or when carrying a related project into its next phase. For an unrelated job, use `/clear`; for a wrong turn, use `/rewind`; for a continuing job that needs a fresh chat, a handoff document can preserve chosen details.

  5. 0507:04

    Cache-expiry rereads and model changes

    After the cache expires, the next message rereads the full chat at full price; recent Claude Code versions may compact a large idle chat before expiration, though this still requires a full read and can lose details. Switching between Opus and Sonnet also forces a reread, so choosing a model before a job and sticking with it avoids that extra cost.

  6. 0609:06

    Keep startup context and tools lean

    `CLAUDE.md` is read at the start of every chat, so keep it under 200 lines and use it as an index to job-specific files; skills can load instructions on demand and use scripts to perform repeatable calculations locally. Disable unused connectors with `/mcp`, inspect context with `/context`, and check setup issues with `/doctor`.

  7. 0711:26

    Trim test output before it enters context

    Long test output can add many lines to the chat and be reread on later messages. A hook can filter test results so Claude sees failures rather than every passing line.

  8. 0812:02

    Choose economical defaults and precise targets

    Opus and extended thinking can cost more than routine tasks need, so use Sonnet for builds and low effort for simple work; plan mode can establish an approach before changes begin. Specific targets such as the checkout file help avoid reading unrelated files, while shorter prompts alone have little effect on the context Claude reads.

  9. 0913:14

    Verify usage over a week

    Keep the cache useful by staying on one model during a job, continuing while it is fresh, and clearing the chat when the job ends; use compact only when space is needed. Check `/usage` before and after a week of changes: lower usage means more room on a monthly plan or a lower API bill.

Tools & Resources

Its chat context and slash commands are the basis for the token-saving workflow.

  1. 01
    Its chat context and slash commands are the basis for the token-saving workflow.00:07
  2. 02
    Its chat context and slash commands are the basis for the token-saving workflow.02:13
  3. 03
    Its chat context and slash commands are the basis for the token-saving workflow.03:23
  4. 04
    Its chat context and slash commands are the basis for the token-saving workflow.04:44
  5. 05
    Its chat context and slash commands are the basis for the token-saving workflow.07:43
  6. 06
    Its chat context and slash commands are the basis for the token-saving workflow.09:15
  7. 07
    Its chat context and slash commands are the basis for the token-saving workflow.11:28
  8. 08
    Its chat context and slash commands are the basis for the token-saving workflow.12:13
  9. 09
    Its chat context and slash commands are the basis for the token-saving workflow.13:53

Anthropic's engineering write-up describes cache-use alerts as an emergency-level operational concern.

  1. 01
    Anthropic's engineering write-up describes cache-use alerts as an emergency-level operational concern.03:00

Named as an example app that Claude can access through a connector.

  1. 01
    Named as an example app that Claude can access through a connector.03:26

Named as an example platform that Claude can access through a connector.

  1. 01
    Named as an example platform that Claude can access through a connector.03:26

A user-requested file captures the goal, completed and remaining work, decisions, and failed attempts for a new chat to read.

  1. 01
    A user-requested file captures the goal, completed and remaining work, decisions, and failed attempts for a new chat to read.06:36

Named as the larger, more expensive model in a comparison with Sonnet.

  1. 01
    Named as the larger, more expensive model in a comparison with Sonnet.08:11
  2. 02
    Named as the larger, more expensive model in a comparison with Sonnet.12:16

Named as a less expensive model for most jobs in a comparison with Opus.

  1. 01
    Named as a less expensive model for most jobs in a comparison with Opus.08:11
  2. 02
    Named as a less expensive model for most jobs in a comparison with Opus.12:40

Keep this startup instruction file under 200 lines and use it to point to job-specific guidance.

  1. 01
    Keep this startup instruction file under 200 lines and use it to point to job-specific guidance.09:23

Skills load task instructions on demand and can include scripts for recurring work.

  1. 01
    Skills load task instructions on demand and can include scripts for recurring work.10:14

A hook can trim test output to failures before Claude receives it.

  1. 01
    A hook can trim test output to failures before Claude receives it.11:47

Share a little
cookie?

Your cookies help us understand visits and how you use Vigest, so we can make it better. We use Google Analytics. You can use the service without agreeing.

You can change your choice anytime.
Saved in this browser for 180 days.

Privacy notice