messages.create calls don't use prompt caching — users pay full input price every turn
Author: r-latticeCreated Jul 19, 2026Updated Jul 19, 2026
Hi — ce3.py's client.messages.create(...) sends the conversation without cache_control, so every turn re-buys the whole prefix at full input rate. Adding an ephemeral cache block to the system/prefix cuts input cost up to ~90% on repeat turns for everyone running this. Happy to open a PR if useful.
(Context: I build a cost-analysis tool for agent workloads — https://lens.r-lattice.com — and this repo came up as one of the highest-impact uncached call sites in public Claude agents. No affiliation needed to take the fix.)
Source: Doriandarko/claude-engineer