How to Save Tokens on the Claude API — Practical Tips
Cut your Claude API bill in half. Long sessions, prompt caching, smart model choice, shorter prompts — simple, plain-language tips that actually work.
Why Tokens Drain So Fast
Every message you send to the Claude API is billed by tokens — both what you send (input) and what Claude writes back (output). The more text travels in and out, the more you pay. The trick to a low bill is not "use Claude less" — it's use Claude smarter: give the model the same context fewer times, and let prompt caching do the heavy lifting.
Tip 1 — Work in Long Sessions, Not Many Short Ones
This is the single biggest lever. When you code with Claude Code, Cursor, Cline or any other IDE agent, try to keep one task inside one long conversation instead of opening a fresh chat for every step.
Inside the same session, the Claude API enables prompt caching: the system prompt, the project files, the rules, the previous turns — all of that repeating context is billed at roughly 10% of the normal input price on every follow-up message. Open a new session, and the cache resets — the full context is sent again at full price.
Tip 2 — Pick the Right Model for the Job
Don't use Opus for everything
Opus is the most powerful Claude model, but also the most expensive. For day-to-day coding, refactors and answers, Sonnet handles 90% of tasks at a fraction of the price.
Use Haiku for simple tasks
Autocomplete, classification, short answers, quick lookups — Haiku is several times cheaper than Sonnet and more than fast enough.
Tip 3 — Keep Prompts Short and Specific
Output tokens cost about 5× more than input tokens, but input still adds up — especially when you stuff in entire files "just in case". Two cheap habits that pay off:
- Paste only the relevant part of a file, not the whole file.
- Ask one clear question instead of dumping a wall of context and hoping for the best.
Tip 4 — Cap the Output Length
Most clients let you set max_tokens on the response. If you only need a function, a paragraph or a short answer, set the cap accordingly. The model will stop earlier and you'll pay only for what you actually used.
Tip 5 — Don't Spawn a New Session Per File Edit
This is the most common mistake we see in IDE agents. The user opens Cursor, asks one thing, gets a fix, then opens a new chat for the next tweak. Repeat 30 times a day and the balance evaporates.
Every new chat = new system prompt + new project context + new file uploads at full input price. The same 30 questions inside a single session would have cost a fraction, because everything after the first message hits the cache.
Tip 6 — Watch Your Usage
Open your dashboard once a day for the first week. You'll quickly spot the patterns that cost the most — usually a runaway agent loop, an oversized system prompt, or a forgotten "summarise the whole repo" request. Fixing one of these usually saves more than every other tip combined.
Quick Recap
- One task = one long session. Let prompt caching do its job.
- Sonnet by default, Opus only when you really need it, Haiku for simple stuff.
- Trim prompts. Cap
max_tokens. Don't paste whole files. - Stop spinning up new chats for every step in your IDE agent.
- Check usage regularly and kill the top spender.