claude-thermos is a new utility designed to mitigate an issue within Claude Code where the prompt cache can expire. This expiration occurs when the main agent waits on a subagent for more than five minutes, leading to the re-encoding of the entire conversation history at a higher cost rather than retrieving it from the cache at a lower rate.
Claude Code's prompt cache has a five-minute Time-To-Live (TTL). If no requests are made on the same cache prefix within this period, the cache expires. The primary cause for this gap is when a main agent is blocked by a subagent. Subagents have different system prompts and tool sets, meaning their requests do not refresh the main agent's cache. While the subagent is active, the main agent's cached history ages and expires, forcing a full re-encode upon the subagent's return.
Re-encoding large conversation histories after cache expiration can be expensive. Measurements across 185 local sessions indicated that these rebuilds accounted for approximately 22% of the total API bill. This cost is incurred for re-encoding content that was recently cached.
claude-thermos functions as a local reverse proxy. It intercepts /v1/messages traffic, groups it into sessions and lineages, and identifies when a main lineage is at risk of expiring while a subagent is active. The tool then automatically warms the cache in the background to prevent expiration. Users run Claude Code through claude-thermos, and existing Claude arguments pass through directly. It requires Python 3.11+ and the Claude CLI.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A new tool called claude-thermos addresses an issue in Claude Code where the prompt cache expires if a subagent runs for more than five minutes, leading to costly re-encoding of conversation history. This tool operates as a local reverse proxy to keep the main agent's cache warm, potentially reducing API costs by approximately 20% for users with long sessions involving multiple subagents.