SEO Guide · 3k vs 30k

Claude Code Token Saving Guide

/cost, Prompt Cache, CLAUDE.md, and settings.json

The same task can cost 3k tokens for one user and 30k for another. The difference is usually not the model, but conversation habits, tool usage, and project setup. This guide breaks down the main token sinks in Claude Code and how to control them.

1. Why the Same Task Can Cost 3k or 30k Tokens

In Claude Code, token usage is usually driven less by model capability and more by workflow quality. How you ask, what Claude reads, what extensions are enabled, and how long a session grows all affect the bill.

Your real input is not just your latest prompt. It also includes system prompt, CLAUDE.md, MCP / Skills / Plugins metadata, conversation history, tool outputs, and the current user message.

2. Understand Where Claude Code Tokens Go

LayerWhat it containsTypical issue
SystemSystem prompt, CLAUDE.md, MCP / Skills metadataFixed overhead grows silently
HistoryAll previous conversation messagesGets more expensive over time
ToolsRead, Grep, Bash outputsMost likely to spike suddenly
CurrentYour current messageUsually the smallest part

Tool output and session history are usually the biggest hidden multipliers.

Prompt Cache

When the leading prefix is unchanged, Claude can reuse cached computation. That is why stable CLAUDE.md, stable model choice, and short idle gaps matter.

Read /cost Correctly

/cost

input
output
cache read
cache write

cache read going up is usually good. cache write going up without a clear reason usually means you are rewriting large prefixes.

3. Input Habits That Quietly Waste Tokens

Raw logs and giant diffs

Do not paste thousands of lines of logs if only a handful of lines matter. Filter first, then ask Claude.

grep -E "FATAL|Exception|^\s+at\s" crash.log
tail -100 build.log
git diff --stat

Vague prompts

Ask for the exact directory, file, module, or function you care about instead of requesting a general project exploration.

Drip-feeding requirements

If you already know the full goal, say it upfront. Multi-turn accumulation is one of the easiest ways to pay repeatedly for the same context.

Breaking cache by accident

Long resumes and frequent model switching are common cache killers.

4. Claude's Work Style Also Changes Token Usage

Read the minimum needed

For targeted edits, prefer Grep to find the line, then read only the nearby context instead of the entire file.

Plan mode is situational

Planning first is worth it for uncertain, cross-module work. For small and obvious edits, it often adds overhead.

Use subagents for noisy tasks

Repository-wide scanning tasks are often better delegated so their heavy read results do not pollute the main session.

/compact vs /clear

/compact only pays off if you are about to continue the same task for multiple more turns. For unrelated work, use /clear.

5. Infrastructure Can Silently Burn Tokens Every Turn

Block generated and build output

{
  "permissions": {
    "deny": [
      "Read(**/node_modules/**)",
      "Read(**/dist/**)",
      "Read(**/build/**)",
      "Read(**/.next/**)",
      "Read(**/generated/**)",
      "Read(**/*.generated.*)"
    ]
  }
}

MCP and Skills overhead

Every enabled capability adds metadata to the system side of the prompt. Keep only what you actively use.

Keep CLAUDE.md lean and stable

Put coding rules and operational conventions there, not timestamps, sprint status, dynamic TODOs, or long historical notes.

6. Practical Claude Code Token Saving Checklist

ActionWhy it helps
Learn /cost firstYou need visibility before optimization
Filter logs and long outputsCuts tool-side blowups
State full requirements upfrontReduces history repetition
Grep first, then local ReadAvoids importing irrelevant files
Use plan mode only when neededAvoids unnecessary planning cost
Delegate noisy scans to subagentsKeeps the main session clean
Deny generated/build readsPrevents accidental huge context loads
Remove unused MCPs and SkillsShrinks fixed prompt overhead
Keep CLAUDE.md stableImproves prompt cache hit rate

Summary

Claude Code token efficiency comes down to four themes: cleaner input, narrower reads, lighter context, and slimmer infrastructure.

The /cost number is not just a bill. It is also a signal of which engineering habits are helping or hurting you.

Need Claude Code relay setup first?

Set up Claude Code first, then come back and optimize your token usage

View Claude Code Setup Guide
Claude Code Token Saving Guide: /cost, Prompt Cache, CLAUDE.md, settings.json | ProxyCC