Tool-Specific Guides
How to spend the least on each major tool. Costs are billed in different units — tokens, credits, characters, requests — but the moves rhyme.
Claude & Claude Code
Billed in tokensCache hard, prune often, tier your models.
Best for: Long-context reasoning, agentic coding, tool use.
Key levers
Prompt caching
Cached reads ~90% cheaper. Writes cost +25% (5-min TTL) or +100% (1-hour TTL). Mind the 5-min default since early 2026.
Keepalive ping
For high-value caches, send a tiny request every ~4 min to keep the 5-min cache warm.
Context editing
Auto-prune stale tool results & thinking blocks at configurable thresholds.
Compaction
Use /compact at breakpoints and /clear between unrelated tasks in Claude Code.
Model tiers
Plan/triage with Haiku, build with Sonnet, escalate hard reasoning to Opus.
Batch API
~50% off for offline jobs; stacks with caching.
Do this
- Front-load stable system prompt, policies, and tool defs so they cache.
- Keep a tight CLAUDE.md with architecture & conventions; avoid bloating it.
- Use subagents for parallel work but route them to cheaper models.
- Turn extended thinking on only for genuinely hard steps.
Avoid this
- Editing the cached prefix (dates, whitespace) — it busts the cache.
- Carrying every tool output forward for the whole session.
- Running Opus for boilerplate edits.
Pro tip: Stability is the whole game for caching: same instructions, same attached context, same thread. Caching rewards sameness.
Caching & batch at a glance
| Provider | Cached read | Cache write | Min tokens | TTL | Batch |
|---|---|---|---|---|---|
| Claude (Anthropic) | ~90% cheaper reads | +25% (5-min) / +100% (1-hr) | Model-dependent | 5 min default (since early 2026) / 1 hr option | ~50% |
| OpenAI | ~50–90% on cached input | No surcharge (automatic) | ~1,024 tokens | Short, automatic | 50% (input+output) |
| Gemini (Google) | ~90% (implicit & explicit on 2.5+) | Implicit: none. Explicit: storage cost | ~2,048 tokens | Implicit: short/auto. Explicit: you set it | ~50% (batch mode) |
Discounts and TTLs change often — confirm against each provider's current docs before budgeting.