Blog › Token saving, part 6
We audited Atomic Chat: Claude chats are never cached, and the agent can't be
Atomic Chat is a local-first chat app, and on local models it reuses its cache carefully. When you plug in a Claude API key, nothing asks Claude to cache, so every message pays full price again for the tools, the instructions and the whole conversation so far. Its agent mode is built for caching, but it sends Claude requests to an endpoint where caching isn't available.
Part 6 of a series on spending less per token. Part 5 audited nanobot, part 4 mem0, and part 1 explains caching if you're new to it.
The project and how we checked it
Atomic Chat is an open-source desktop and mobile AI app. It runs open models on your own machine through llama.cpp and MLX, and it can also connect to cloud models from Anthropic, OpenAI, Google, OpenRouter and others with your own API key. It has MCP tools, web search, document chat and an agent mode.
We ran our free LLM cost audit skill on commit a372b02 (2 December 2026), then followed every cloud request by hand from the chat screen, through the app's built-in local API server, to the provider. We didn't run Atomic Chat; the numbers below are estimates, and we say what they rest on.
What it already does well
- Local models reuse their cache. Requests to llama.cpp ask it to keep the prompt cached and pin the same slot, so an agent step doesn't reprocess everything before it.
- The agent prompt is built for caching. The parts that don't change (persona, rules, skills, the tool list) go in their own system message, apart from the parts that do.
- The agent has limits: 8,192 output tokens per step, 25 steps per run, and a 32,000-token cap on the conversation it sends.
- The default instructions include the date, not the time. A clock in the system prompt would break the cache on every message; a date changes once a day.
So the team clearly thinks about caching. The gap is on the cloud side, where Claude needs to be asked.
1. Chats with Claude are never cached
OpenAI and Gemini cache repeated prompts automatically. Claude only caches when the request says what to cache, with a cache_control marker. Atomic Chat sends every chat message through one call to the Vercel AI SDK, and that call sets no cache options. We found no cache marker anywhere in the app or in its local API server.
Two things make it costlier than it looks:
- Cloud conversations are never shortened. For local models the app trims history to fit; for cloud models it leaves the window to the provider. So each message resends the whole conversation.
- Web search is on by default. The Exa search tool is enabled out of the box, and its results stay in the conversation. Every later message pays for them again.
| How you reach Claude in Atomic Chat | Prompt cached? |
|---|---|
| Anthropic API key, chat | No |
| OpenRouter, Claude models, chat | No |
| Anthropic API key, agent mode | No (see 2) |
The fix (web-app/src/lib/custom-chat-transport.ts)
function withClaudeCacheBreakpoint(messages: ModelMessage[]): ModelMessage[] {
if (messages.length === 0) return messages
const last = messages[messages.length - 1]
return [
...messages.slice(0, -1),
{ ...last, providerOptions: { ...last.providerOptions,
anthropic: { cacheControl: { type: 'ephemeral' } } } } as ModelMessage,
]
}
// before streamText(...)
const messages = effectiveProviderName === 'anthropic'
? withClaudeCacheBreakpoint(request.messages)
: request.messages
One marker on the newest message is enough: Claude caches the tools, the instructions and every earlier message as one prefix, and the next message reads it back at a tenth of the input price or less. The same could be done in one place in the app's local API server, by adding Anthropic's top-level cache_control field to Claude requests. Claude models on OpenRouter need the marker on the last message too. We sent this fix to the maintainers in issue #463.
2. Agent mode sends Claude to an endpoint that can't cache
Atomic Chat's agent talks to every cloud model in the OpenAI chat format. For Anthropic, the app's local server forwards that to api.anthropic.com/v1/chat/completions, Anthropic's OpenAI-compatibility endpoint. Anthropic's own docs say prompt caching isn't supported there; it only works on the native Messages API.
That undoes the agent's careful prompt layout. A run can take up to 25 steps, and each one resends the system prompt and up to 32,000 tokens of conversation at the full input price. The fix is to send Claude agent steps to the native /v1/messages endpoint with a cache marker. The local server already contains converters between the two formats, so the pieces are there. We can't put a dollar figure on this one, because we don't know how often people run the agent on Claude.
3. A small one: the ChatGPT login route
Atomic Chat can also use a ChatGPT subscription. That route gives every request a new random prompt_cache_key, so messages from the same chat never share a cache key with OpenAI. Subscription users don't pay per token, so this costs speed and possibly usage limits rather than money. Using the chat's own id as the key would fix it.
What it's worth
Our estimate for one person chatting with Claude on their own Anthropic key, at list prices:
| Model | No caching (today) | With the fix |
|---|---|---|
| Claude Sonnet 5.5 | $35.00 | $10.78 to $20.75 −41 to 69% |
| Claude Opus 5.5 | $70.00 | $21.55 to $41.50 −41 to 69% |
How we got these numbers: 30 chats a month of about 20 messages each, with the conversation growing about 1,500 tokens a message plus a few web-search results. That's about 0.5M input tokens per chat, so 15M input and 0.5M output tokens a month. With the fix, 50% of input is read from cache (you pause longer than Claude's 5-minute cache between messages) to 85% (active chats); the rest is billed at the normal input price, and cache writes cost a little more, so real figures run slightly higher. List prices per million tokens: Sonnet 5.5 $2 input, $0.10 cached, $10 output; Opus 5.5 $4, $0.20, $20. Very short chats fall under Claude's minimum cacheable length and don't change.
Where the tokens are bought
Caching is the big lever here; the price per token comes second. SayGM lists Claude Opus 5.5 at $2.06 input and $10.30 output per million tokens, and Sonnet 5.5 at $1.03 and $5.15, against $4.00 / $20.00 and $2.00 / $10.00 from Anthropic. Atomic Chat lets you change a provider's base URL, so it can point at an Anthropic-compatible gateway; check that cache counters show up once the fix is in. The usual caveat applies: on Claude, Anthropic still processes the prompt whichever gateway you use, so keep secrets and client data on direct routes. And if you don't need Claude for a task, Atomic Chat's local models cost nothing per token.
Disclosure: we earn a reward if you sign up to SayGM through our links. Your price is the same.
Summary
| # | Finding | Fix | Effort |
|---|---|---|---|
| 1 | Chats with Claude (Anthropic and OpenRouter) are never cached | A cache marker on the newest message (#463) | ~15 lines |
| 2 | Agent mode sends Claude to the OpenAI-compatible endpoint, which can't cache | Use the native Messages API for Claude agent steps | Medium |
| 3 | ChatGPT login route uses a new cache key per request | Use the chat id as prompt_cache_key | 1-2 lines |
Check your own app for the same thing
- If your app reaches Claude through an AI SDK or a gateway, check that something sets
cache_control. Nothing does by default. - If you call Claude in the OpenAI format, check which endpoint it lands on. Anthropic's OpenAI-compatible endpoint doesn't cache.
- Look at
cache_read_input_tokenson the second message of a chat. Zero means you're paying full price every time.
Or let an agent do it: the LLM cost audit skill is free and runs locally.
Sources: Atomic Chat on GitHub (commit a372b02), Atomic Chat issue #463, Anthropic prompt caching docs, Anthropic OpenAI SDK compatibility, Anthropic pricing, SayGM prices. We didn't run Atomic Chat; token counts are estimates.