Fundamentals
Why Optimize Tokens?
Every token you send to an AI model costs three things: money, context-window space, and latency. Most developers silently burn 70–90% of their budget on tokens that buy nothing — re-sent history, uncached preambles, filler, and noise. Token optimization is the practice of eliminating that waste, and the returns are unusually concrete.
The Three Costs of Every Token
Money is the obvious one: API pricing is per token, in and out, and agent workflows multiply it — the whole conversation is re-billed as input on every turn. Context space is subtler: windows are finite, and every wasted token is room the model can't use for reasoning or for remembering turn 5 by turn 40. Latency rounds it out: more input tokens means more prefill work before the first output token arrives. Optimize tokens and all three improve together — the rare optimization with no trade-off, provided you only remove what carries no meaning.
Exhibit A: The Config Change Worth 73%
The single most persuasive example isn't compression at all — it's prompt caching. When a model provider sees the same content at the start of a conversation (your CLAUDE.md, system prompt, reference files), it caches those tokens and charges roughly 10× less for them on every subsequent hit.
That sounds incremental. It isn't. A Claude Code session with a 10,000-token preamble costs about $0.15/turn at premium rates without caching; with it, about $0.015. Over a 30-turn session that's $4 back; at two sessions a day, roughly $240 a year — from a config change that takes sixty seconds: put stable content first, volatile content (dates, task notes) last, so the cached prefix stays intact. One developer's bill dropped 73% from this alone. The mechanics, pricing, and failure modes are covered in the prompt caching guide.
Exhibit B: The Waste You're Already Sending
Beyond caching, measured waste in everyday usage clusters into a few categories, each with its own guide:
- Filler and politeness — 15–20% of typical prompts (the politeness tax)
- Oversized tool output — 30–60K-token diffs and log dumps (git diff compression)
- Stale context — file reads re-billed every turn (context window diet)
- Formatting overhead — 8–12% of long outputs (the markdown token tax)
None of these require better prompt-writing skill. They're plumbing problems, and plumbing problems have mechanical fixes.
Objections, Answered
"Token prices keep falling." Per-token prices fall; usage grows faster. Agentic workflows send orders of magnitude more tokens than chat did, which is why AI line items rise while unit prices drop. Efficiency compounds with scale instead of being made irrelevant by it.
"It's cents per prompt." Per prompt, yes. Per developer-year of heavy use, waste reliably totals hundreds of dollars — and per team, thousands. Our real-world results include a 12-person team that recovered $1,400/month.
"Optimizing might degrade answers." Removing information degrades answers. Removing filler, duplicate context, and cache misses does not — and clearer, tighter prompts measurably reduce misinterpretation. The line between the two is exactly what a good optimizer automates.
Where to Start
- Fix caching order first. Highest leverage, one-time effort: stable content top, volatile content bottom.
- Automate prompt-level trimming. Terse strips filler and compresses pastes on-device, and its monitor shows your cache hit rate and per-turn cost live.
- Then fix the big payloads. Diffs, file reads, searches — the agent-session guides above, in that order.
Find Your 70% Waste
Terse shows live cache hit rates, per-turn cost, and per-source token usage — then optimizes prompts automatically. On-device, free to start.
Download TerseFrequently Asked Questions
Is token optimization worth it for casual AI users?
For light chat use, the dollar savings are small. The case strengthens sharply with agent tools like Claude Code, where conversation history is re-billed every turn and daily waste reaches hundreds of thousands of tokens.
What's the single highest-leverage optimization?
Prompt-caching structure: ordering your context so stable content comes first. Cached input costs roughly one tenth of normal input, so moving a large preamble from missed to hit outweighs any single compression technique.
Does optimizing tokens make responses worse?
Not when done correctly. Safe optimization removes only zero-information content — filler, duplicate context, formatting overhead, cache misses — and never touches code, negations, or facts. Quality issues come from removing meaning, which is precisely what rule-based optimizers are built to avoid.
Further Reading
- Terse Blog — all token optimization guides
- Prompt Caching Guide — the 73% config change, in detail
- Real Results — anonymized savings data
- Reduce AI API Costs — the complete playbook