Running Claude Code in the terminal can burn through tokens faster than expected. Prompt caching and automatic context management run behind the scenes, yet bills climb quickly if you do not know what drives token consumption. Here is how to inspect and control the main cost drivers.

Measuring Tokens and Managing Context

Start by checking where your tokens go. Run /usage in the terminal to inspect session token counts and spend, and run /context to see what occupies the current context window. Clearing clutter before the window fills up keeps per-turn costs down.

Three mechanisms reset or shrink context: /compact summarizes conversation history into key points, /clear wipes prior turns completely, and auto-compaction triggers when the context limit approaches. Compacting periodically during long sessions prevents bloated history from being resent on every turn.

Choosing Models and Trimming MCP Overhead

Not every task needs the largest frontier model. Routine edits and file lookups run fine on smaller models or lower Thinking depth settings. Reserve deep thinking budgets for multi-file architecture changes or tricky refactors.

Connected MCP (Model Context Protocol) servers also add hidden token overhead. Every active MCP server injects its tool schemas into the base prompt on each turn. Disable unused MCP servers to shrink baseline context size. Because prompt caching drops cache-read pricing to 0.1x for follow-up requests within 5 minutes, working in focused bursts pays off.

Spend guardrails depend on your billing setup. Teams on Anthropic Console can set hard spend limits to block runaway bills, while AWS Bedrock deployments can tie usage quotas directly into cloud monitoring alerts. Matching context hygiene and model tier to the task keeps daily usage predictable.

Summary

  • Inspect live token spend and context breakdown with /usage and /context
  • Disable unused MCP servers so their tool definitions do not inflate every base prompt
  • Work in sub-5-minute bursts to take advantage of prompt caching, which cuts cache-read cost to 10%