claude thermos is an open source network proxy that keeps Anthropic's Claude Code coding agent cheap to resume after long pauses.
A long Claude Code session delegates a chunk of work to a subagent and waits. While the subagent runs past five minutes of inactivity, the main agent's prompt cache ages out, and the next user turn re-encodes 200,000 to 500,000 tokens of conversation history at the 1.25x write rate instead of reading them back at 0.1x. One developer's open-source workaround, claude-thermos, sits in front of the Anthropic API and replays warm-up calls so the cache stays alive.
Claude Code is Anthropic's paid coding-agent CLI. The prompt cache is the system that lets the model resume a long session without re-reading every prior message from scratch. Anthropic prices cached reads at roughly a tenth of fresh writes, so a cache hit saves real money, and a miss costs roughly twelve times more. The catch is the cache prefix: every request carries an ordered token signature that identifies the cached state, and a Claude Code subagent runs under its own prefix. While the subagent is working, it is not refreshing the parent session's prefix, and the TTL keeps ticking.
That is the gap claude-thermos is built to fill. It is a small Python wrapper, installable with uvx claude-thermos and requiring Python 3.11 or newer, that points the ANTHROPIC_BASE_URL environment variable at loopback. The proxy watches traffic to the real Anthropic API and, when the main agent is idle, fires off a steady drip of warm-up calls against the same cache prefix so the TTL clock resets. The default cycle is 270 seconds of idle, followed by a 270-second warm-up interval, capped at four cycles per subagent window of 540 seconds. Setting CLAUDE_WARMER_DISABLE=1 skips the behavior for any run the user wants to keep off the cache-warming path. All traffic still terminates at Anthropic's API, and the proxy never serves a response of its own.
Across roughly 185 local sessions, the project's author reports cache-rebuild re-encodes at about 22% of his total Claude Code spend, money he says went to re-encoding content that had been cached minutes earlier. The figure is internal telemetry, and the README presents it as a developer's own observation, not a vendor-validated statistic. The HN thread surfaces two important wrinkles.
The first is the audience split. Anthropic ships Claude Code's prompt-cache TTL at one hour for Pro and Max subscribers, and at five minutes for users who bring their own API key. The 1-hour option is priced at roughly twice the rate of the 5-minute default, so subscribers pay more per token in exchange for keeping the cache alive longer. That means the 22% figure is a real number for API-tier users whose long sessions regularly exceed five minutes of subagent work, and largely irrelevant for Pro or Max subscribers who already ride the longer TTL. The project README notes that the author himself is on the API tier.
The second wrinkle is that warming traffic is not free. Every keep-alive call is a paid write, and the wrapper fires one every 270 seconds by default, so the savings calculation has to subtract the warmer's own cost from the avoided re-encodes. The HN thread also flags a softer side effect: Anthropic has been reported to deallocate idle VMs between sessions, and a constant drip of warm-up calls can put the user close to rate-limit pressure on a shared API key. claude-thermos exposes the relevant knobs: --idle, --interval, --max-cycles, and --subagent-window, so a user can dial the cost of warming down, but the math is per-session, not universal.
For a developer running long Claude Code sessions on an API key, the decision is roughly this: model your own usage against the five-minute TTL, add a subagent that runs longer than that window, and ask whether the avoided re-encodes on your typical prompt sizes outweigh the warmer's own write traffic. For Pro and Max subscribers, the same proxy sits in front of an API whose default cache already survives an hour of idle, and the value proposition narrows to a narrow edge case. Either way, claude-thermos is a workaround for Anthropic's cache-lifecycle policy, not a fix to the underlying cost curve. The relevant moving parts are Anthropic's cache policy, the tier split, and the rate card. A longer default TTL, a CLI-integrated warmer, or a rate-card revision would all shift the math.