Keep Claude Code's prompt cache warm while idle — meet cwarm
Keep Claude Code's prompt cache warm while idle — meet cwarm If you use Claude Code , you've probably hit this: you're deep in a session, step away for a meeting, come back — and it feels like it re-reads the entire conversation before answering. That's a prompt-cache miss . Why it happens Anthropic's prompt cache has a time-to-live: roughly 1 hour on Max and 5 minutes on Pro . Idle past that and the cache expires, so your next turn pays the full cost of re-reading the context. On macOS/Linux you can poke the session with something like tmux to keep it warm — but on Windows-native (Git Bash) there was no clean path . That's where cwarm started. What cwarm does It runs claude inside a pseudo-terminal (PTY) it controls, and when you've been idle past your plan's threshold it injects a tiny keepalive so the cache stays warm. The key part: the injection is an in-process PTY write , unrelated to window state — so it keeps working when the window i...