claude-thermos 是一个轻量级代理,能在子 Agent 长时间运行时自动保持 Claude Code 的提示缓存活跃,避免因缓存过期导致的高昂重写成本——这通常占总费用的约 20%。

Stars

173

7 天增长

暂无数据

Fork 数

7

开放 Issue

0

开源协议

MIT

最近更新

2026-07-27

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它精准解决了 Claude Code 中一个昂贵但鲜有文档的问题:当主 Agent 被子 Agent 阻塞时提示缓存过期。经测量可节省约 22% 的输入费用,且设置极为简单。

适合谁使用

  • 频繁使用子 Agent 的 Claude Code 高级用户
  • 运行长时间自动化多工具流程的工程师
  • 希望降低 Agent 工作流中 Anthropic API 支出的团队
  • 已使用 `claude` CLI 并熟悉 `uvx` 的开发者

典型使用场景

  • 当主 Agent 等待子 Agent 超过 5 分钟时防止缓存重写
  • 降低长时间、多步骤编码会话的月度 API 账单
  • 在涉及多个子 Agent 的复杂任务中保持快速响应
  • 无需手动管理缓存即可无人值守运行 Claude Code 工作流

项目优势

  • 即插即用:仅需将 `claude` 替换为 `uvx claude-thermos`
  • 在 185 次会话中实测节省约 22% 的缓存重写费用
  • 自动后台保温,基本使用无需任何配置
  • 提供透明的事件日志和每次会话的节约摘要以验证效果

使用前须知

  • 需要 Python 3.11+ 以及 `claude` CLI 在 PATH 中
  • 仅适用于官方 Claude Code CLI(不支持通用 Anthropic API 调用)
  • 保温操作引入少量代理开销并消耗缓存读取 token(但节约远大于此)

README 快速开始

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

项目描述

Keeps your Claude session warm for you

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

S40911120
精选
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 与机器学习大语言模型
67
makecindy
精选
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 与机器学习大语言模型
958
mereyabdenbekuly-ctrl
精选
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 与机器学习AI 智能体
859