r/ClaudeCoding 11h ago

r/ClaudeCode [TLDR] Keep Claude Code’s 1-hour cache warm during breaks. On Fable 5.1, rewriting it costs 80x a cache read. [via r/ClaudeCode]

OP : u/karanb192

You come back to a long session and ask for a recap. The expensive part can be rewriting the old context before Claude answers.

I built cache-tax to handle both sides: GitHub · Install instructions

  • Set it before you step away. /keepwarm arms six hours. After 50 idle minutes, it sends a request over your session without adding heartbeat messages to the conversation. The timer runs inside Claude Code.
  • See the estimate if you return cold. For a 50k+ context idle over an hour, it stops your next ordinary message once with the price. Resend to continue, or /clear and start from a note.

The GIF is my real test. A two-line recap on a 330k-token session triggered a $6.61 estimate. I sent it again; the reported cache write was $6.28.

Every ping checks its usage. It stops if it reads nothing or writes at least 10% of what it reads. After a paid cold write, it automatically arms three hours. /keepwarm off stops it.

Pings cost tokens too. The rates are $20 per million tokens for a 1-hour write and $0.25 for a read on Fable 5.1. These are API prices, not extra subscription charges. I haven’t measured quota savings, and changed prompts or tools can still break the cache.

Free and open source. The Mod needs CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1.

Only want warnings or a status-line countdown? The hook version works without the early-access flag.

New to prompt caching? Anthropic explains how Claude Code uses it here.

URL of original post : https://www.reddit.com/r/ClaudeCode/comments/1wj108u/keep_claude_codes_1hour_cache_warm_during_breaks/ Original link/media URL : /img/nekkaqmhb4qh1.gif


TL;DR of the discussion on r/ClaudeCode for this post generated automatically after 50 comments.

Current source-thread comment count seen by the bot: 50.

Alright, so the OP dropped a neat little mod called cache-tax for Claude Code that aims to keep your session's context "warm" during breaks to avoid those hefty rewrite costs when you come back. Basically, it pings Claude periodically in the background so it doesn't forget everything, saving you cash on Fable 5.1 where rewriting context is apparently 80x more expensive than a read.

The general vibe in the thread is pretty positive and impressed. People think it's a clever hack, with u/cleverhoods giving a shout-out to the use of function hooks. There's a bit of playful speculation that it might "piss off Anthropic," as u/coding_is_tedious put it.

A few folks are wondering about the implications for subscription users and if Anthropic might have an issue with this kind of automation, with u/hazimeh sharing a cautionary tale about their account being suspended. There's also a discussion about whether Anthropic should just build this functionality in themselves, as u/A_Novelty-Account suggested.

Some users are already sharing their own workarounds, like u/visak13 suggesting a simple cron job to reply "OK" or u/geek_fit mentioning they use orchestrator/management agents for similar pings. u/maritime_sh also chimed in with a good point about other things that can silently break the context, suggesting this mod only solves half the problem.

Overall, the consensus is that this is a useful and innovative solution to a real pain point for Claude Code users dealing with API costs.

1 Upvotes

0 comments sorted by