claude-thermos is a lightweight proxy that automatically keeps Claude Code's prompt cache warm during long subagent runs, preventing expensive cache rewrites that can waste ~20% of your API bill.

Stars

173

7-day growth

No data

Forks

7

Open issues

0

License

MIT

Last updated

2026-07-27

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It directly solves a costly and under‑documented problem in Claude Code: prompt cache expiry when the main agent is blocked on a subagent, saving roughly 22% of total input costs with minimal setup.

Who it is for

  • Claude Code power users who frequently spawn subagents
  • Engineers running long automated sessions with multiple tools
  • Teams trying to reduce Anthropic API spend on agentic workflows
  • Developers already using `claude` CLI and comfortable with `uvx`

Use cases

  • Prevent cache rewrites when a main agent waits >5 minutes on a subagent
  • Reduce monthly API bills on long, multi‑step coding sessions
  • Maintain fast response times on complex tasks involving many sub‑agents
  • Run unattended Claude Code workflows without manual cache management

Strengths

  • Drop‑in replacement: just replace `claude` with `uvx claude-thermos`
  • Measured 22% savings on bill from avoided rewrites across 185 sessions
  • Automatic background warming with zero configuration for basic use
  • Transparent event logs and per‑session savings summary for validation

Considerations

  • Requires Python 3.11+ and the `claude` CLI on the PATH
  • Only works with the official Claude Code CLI (not general Anthropic API usage)
  • Warming adds a small proxy overhead and consumes cache‑read tokens (though heavily outweighed by savings)

README quick start

claude-thermos

Stop paying to rebuild your Claude Code cache. When your main agent waits on a subagent for more than 5 minutes, its prompt cache silently expires, and the next turn re-encodes your entire conversation at the write rate instead of reading it back cheap. On long sessions with many subagents that's roughly 20% of your bill. claude-thermos keeps the cache warm so you never pay that tax.

Use

Run Claude Code exactly as you normally would, but through claude-thermos with uvx:

uvx claude-thermos                     # instead of: claude
uvx claude-thermos -p "fix the bug"    # any claude args pass straight through

Requires Python 3.11+ and the claude CLI on your PATH.

That's it. Warming runs automatically in the background. To disable it for a run without changing the command, set CLAUDE_THERMOS_DISABLE=1.

Tuning (all optional):

FlagDefaultMeaning
--idle270Seconds the main agent must be idle before warming kicks in
--interval270Seconds between warming cycles
--max-cycles4Max warms per idle episode (auto for unlimited)
--subagent-window540Seconds a subagent counts as "still active"

Choosing which claude to run

By default claude-thermos launches the claude found on your PATH. Point it at a different binary with --bin, or the CLAUDE_THERMOS_BIN environment variable. A bare name is looked up on PATH (so --bin claude-nightly works); a full path is used as-is. This is handy for a vendored build or a wrapper that exports a different CLAUDE_CONFIG_DIR per account.

claude-thermos --bin /path/to/bin/claude -p "fix the bug"
# or
export CLAUDE_THERMOS_BIN=/path/to/bin/claude
claude-thermos -p "fix the bug"

The flag must come before any passthrough claude args.

Daemon mode (shared proxy for the IDE and multiple terminals)

The default command warms only the claude process it launches. Clients that launch claude themselves — the VSCode/Claude Code extension, which spawns its own bundled binary — never go through it, and neither do other terminals.

`claude-ther

Description

Keeps your Claude session warm for you

Related repositories

Similar projects matched by category, topics, and programming language.

S40911120
Featured
S40911120 GitHub avatar

recensa

Recensa is a self-hosted web viewer that indexes Claude Code session transcripts into a local SQLite database, enabling full-text search, replay, and audit of all past agent conversations without uploading data anywhere.

AI & Machine LearningLarge Language Models
67
makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958
mereyabdenbekuly-ctrl
Featured
mereyabdenbekuly-ctrl GitHub avatar

clodex-ide

Clodex is an open-source, local-first agentic IDE that combines persistent AI tasks, code, terminal, browser, Git, models, memory, and governed execution in one Electron workspace, currently in technical preview.

AI & Machine LearningAI Agents
859