Prompt caching is the single biggest cost lever for most agent workloads. A session with a 3000-token system prompt and 10 turns saves 90 percent of input token cost when the prompt is cached. This page covers what caching does, when it works, and how ClawMetry shows you whether yours is actually landing.
Anthropic's prompt caching (cache_creation_input_tokens + cache_read_input_tokens) and OpenAI's cached-prompt-tokens both charge input tokens at a fraction of the normal rate when the prompt prefix matches a previous request within the cache window (typically 5 minutes but longer for some tiers). It works on long system prompts, on tool definitions, and on the invariant chunk at the top of an agent transcript. It does not work on the user's message, so short chats gain nothing.
Tool outputs that are deterministic given their inputs (read_file, list_directory, most database lookups) are cache-safe on your side. Wrap them in a hash → response map. ClawMetry surfaces tool-call frequency per session so you can see which tools are called with the same args many times in a row; those are the free wins.
The largest per-token difference in real workloads is not Claude vs GPT, it is Sonnet vs Opus (or gpt-4o-mini vs gpt-4o). Route routine work (formatting fixes, summaries, single-file edits) to the small model and expensive turns (multi-file changes, architecture, complex reasoning) to the big model. ClawMetry's Cost tab shows per-model spend per session, so you can spot a session pinned to Opus when Sonnet would have finished it.
The single number that matters. Anthropic-cached sessions with a hit rate above 80 percent are your baseline; sessions below 50 percent are your fix list. ClawMetry computes hit rate per session, per model, and per prompt, so you can identify the specific prompt shapes that are cache-missing and confirm caching is actually landing after you enable it (a common bug: the cache breakpoint drifts and hit rate silently drops to zero).
For every LLM call ClawMetry parses the usage block and separates cache_read_input_tokens from uncached input tokens. Cost is computed cache-aware (cache-reads at the cache rate). The Cost tab has a hit-rate column per model and per session. Runtime pages (clawmetry.com/runtimes/<slug>) document which cache signals each runtime's native store carries.
Start the free trial →