Maximizing Value in Claude Code Sessions: Token Efficiency Tips

Anthropic published a practical guide on getting more value from every token spent in Claude Code sessions. It covers the mechanics of token pricing and offers six concrete tactics to reduce waste without switching models.
What Determines Token Cost
You're billed per token, but you're really paying for GPU inference time. Three factors decide the price of a token: model size, input vs output, and caching. Output tokens cost roughly 5x input because decode runs the model once per token. Cached input tokens are cheaper, and prompt caching expires after an hour.
Six Ways to Cut Token Waste
- Run
/clearbetween tasks — prevents irrelevant prior context from being sent to the model, reducing token usage. - Set your model and effort level before starting — changing them mid-conversation busts the prompt cache, increasing cost.
- @-mention files instead of naming them — the file attaches directly to your message, saving a Read call or a repo search.
- Add quiet flags to noisy commands, or run them in a subagent — command output stays in the conversation for the rest of the session.
- Run
/contextonce in a fresh session — shows what's loaded (CLAUDE.md, MCP tools), so you can cut unnecessary items. /compactbefore you take a break — the prompt cache expires after an hour, and summarizing while cached is cheaper.
The guide emphasizes that being token-efficient isn't about using fewer overall, but making sure the ones you use go toward the actual task. For example, in one session Claude reads the test and the file it covers, edits, and finishes in a few turns. In another, it greps around, reads a dozen files to reach the same two, and drags all that context into every subsequent turn — costing more and making the model think about irrelevant files.
📖 Read the full source: HN AI Agents
👀 See Also

How 40 Prompt Revisions Turned Claude AI Summaries Into a Product: A Tutoring Platform Case Study ($19K MRR)
A tutoring platform with $19K MRR iterated their Claude-generated session summary prompt 40+ times over 12 months. The journey from vague v1 to personalized v40 shows how prompt engineering transforms a feature into a product.

Trellis 2 Successfully Running on ROCm 7.11 with AMD RX 9070 XT
A developer got Trellis 2 working on Linux Mint 22.3 with an AMD RX 9070 XT using ROCm 7.11, fixing two key issues: ROCm instability with high N tensors and a broken hipMemcpy2D in CuMesh.

OpenClaw Agent Cost Analysis: From $340 to $112 Monthly with Five Optimizations
A developer tracked 18,000 API calls across four OpenClaw agents for 30 days, finding 70% of tasks didn't need GPT-4.1. By implementing prompt caching, shortening system prompts, batching analytics, switching to cheaper models, and adding max token limits, costs dropped from $340 to $112 monthly.

Interactive Explainer Maps Claude Code Agent Loop Designs, from Single Calls to Self-Mutating Prompts
An interactive site built with Opus 4.7 visualizes 11 real agent loop designs for Claude Code, from basic calls to agents that rewrite their own prompts, with SVG animations showing memory and loop mechanics.