128 ways to spend fewer tokens
The 22 Beginner tips are free to read. The 106 advanced tactics unlock with Pro — plus a fresh tip in your inbox every morning.
Count Tokens Before You Hit Send, Not After the Bill Arrives
Measure a prompt's token count before sending it, so you catch oversized context while trimming it is still free.
Set Hard Spend Caps in the Provider Console
Configure provider-side usage limits, budgets, and alerts so a bug, a retry storm, or a leaked key cannot quietly run your bill far past a ceiling you set in advance.
Cap the loops by count, not tokens: spawn and search limits in Claude Code
Claude Code 2.1.212 added session caps on subagent spawns and WebSearch calls, both defaulting to a non-binding 200. Lower them to match your actual workload so a mis-planned agent hits a hard stop at 12 searches instead of quietly burning a full context window and the spend behind it.
Log input_tokens and output_tokens on Every Call to Find Your Real Waste
Persist the usage object from every API response with a feature tag, so you can see exactly which feature and which token type is draining your budget.
Give Each Feature a Token Budget and Enforce It with max_tokens
Set an explicit per-feature output ceiling instead of leaving max_tokens at a huge default, and reserve big budgets only for features that truly need them.
Keep agent threads under the long-context price cliff
GPT-5.6 switches to a higher long-context rate once a single request crosses ~272k tokens. Agent harnesses that quietly raised their window push routine threads past that line and double the per-token bill. Cap each thread below the cliff — compact or start fresh before you cross — and you keep paying the base rate.
Tag Every Call So You Know Which Feature Burns Tokens
Attach feature, user, and environment labels to every API call so your bill breaks down by what actually drives cost instead of one undifferentiated total.
Measure Cost-Per-Success, Not Cost-Per-Call
Compare two prompts or models on cost divided by successful outcomes, including retries and rework, so you stop chasing cheap calls that quietly fail and get redone.
Wire Up Spend Alerts and a Token Circuit Breaker Before You Need Them
Combine provider budget alerts with an in-app token meter that hard-stops a feature once it blows past its expected per-period budget.
Give Your Agent Fleet a Real Dollar Ceiling: --max-budget-usd Now Halts Background Subagents
Before Claude Code 2.1.216, hitting --max-budget-usd denied new subagent spawns but let already-running background subagents keep burning past the cap. 2.1.216 halts them at the ceiling and adds CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (default 20) to bound how many contexts draw tokens in parallel. Upgrade and set both to give a long fan-out a true spend ceiling plus a parallelism throttle.
Score Agent Runs in Effective Tokens, So Your "20% Cut" Is a Real 20%
Raw token counts treat a cheap cache-read token and an expensive flagship output token as equal — across token classes and tiers they can differ by 50x or more in price. Roll every run up into one price-weighted Effective Token number so a reported X% reduction maps to a real X% spend cut.
Optimize the Bill, Not the Token Count — Caching Can Make Compression Backfire
With prompt caching on, a stable prefix bills at a fraction of base input, so the tokens you change cost far more than the tokens you keep. Trimming context can raise the actual bill and tank task success — measure success-adjusted billed cost instead of raw token count.
Cap Each Agent's Spend and Degrade the Model at the Soft Limit
Autonomous agents fan out into tool calls, sub-agents, and retries, so after-the-fact dashboards never actually bound spend. Put a pre-call gate in front of every request that enforces a per-agent hard ceiling and quietly drops to a cheaper model at a soft threshold instead of failing hard.
Run Every Agent Thread Off One Shared Token Ledger That Aborts at the Budget Line
Per-agent caps still let a multi-agent run overspend in aggregate: ten threads each "under budget" blow past the total, and a sub-agent or compaction call drawing context after the work is done is invisible to any single counter. Settle every thread, sub-agent, and compaction call against ONE shared ledger, abort each turn at its next usage-accounting boundary when the ledger hits zero, and feed the remaining balance back into the model's context so it steers its own spend.
Like what you see?
Get a fresh one in your inbox — weekly free, daily on Pro.