claude-warmer
v0.1.1
Published
TUI tool that keeps Claude Code session caches warm by periodically resuming sessions
Downloads
234
Maintainers
Readme
claude warmer
Keep your Claude Code caches alive while you sleep, go for lunch, or touch grass. Periodically sends lightweight prompts to your sessions via claude --resume so that 1h TTL cache writes are refreshed.
Without warming, resuming a session older than 1 hour means a full cache write - $10 per M tokens for Opus 4.6. With warming, you pay $0.5 per M tokens for keep-alive instead. Cache reads and refreshes are 20x cheaper than 1h cache writes.
Usage is not recommended yet: As of Claude Code version
2.1.92, there is a bug where cross-processclaude --resumeresult in non-deterministic plugin skill and tool definitions, which invalidates most of the cached prefix. The fix (an upcoming attachment system) exists behind a feature flag in Claude Code. Once enabled, cross-process cache hits should reach >90%.
Not affiliated with or endorsed by Anthropic.
Install
npx claude-warmerOr install globally:
npm install -g claude-warmer
claude-warmerOptions:
-i, --interval <minutes>- Warming interval (default: 55, just under the 1h cache TTL)--prompt <string>- Prompt to send (default: "Reply 'ok'")
How it works
- Discovers all Claude Code sessions from
~/.claude/projects/ - Shows a TUI with session status (warm/cold/live), cached tokens, and estimated costs
- Select sessions to keep warm, press Enter to start
- The warmer spawns
claude --resume <id>in a PTY, sends the prompt, waits for a response, then exits - Sessions are refreshed every 30s to pick up new sessions and updated cache metrics
Keybindings
| Key | Action | |-----|--------| | Enter | Start/stop warming | | Space | Toggle session selection | | a | Select all live/warm sessions | | n | Deselect all | | i | Edit interval | | p | Edit prompt | | c | Copy session ID | | q | Quit |
Development
git clone https://github.com/ryanlyn/claude-warmer.git
cd claude-warmer
npm install
npm run devIf node-pty fails with posix_spawnp on macOS Apple Silicon, run:
chmod +x node_modules/node-pty/prebuilds/darwin-arm64/spawn-helperTests
npm test # unit tests (100% coverage required)
npm run check # lint + format + coverage
npm run test:e2e # E2E cache hit test (hits real API, slow)