🤖 Claude Code 更新 v2.1.108

发布日期: 2026-04-15
⚠️ 新版本发布

✨ 新增功能

  • Added ENABLE_PROMPT_CACHING_1H env var to opt into 1-hour prompt cache TTL on API key, Bedrock, Vertex, and Foundry (ENABLE_PROMPT_CACHING_1H_BEDROCK is deprecated but still honored), and FORCE_PROMPT_CACHING_5M to force 5-minute TTL
  • Added recap feature to provide context when returning to a session, configurable in /config and manually invocable with /recap; force with CLAUDE_CODE_ENABLE_AWAY_SUMMARY if telemetry disabled.
  • Added “verbose” indicator when viewing the detailed transcript (Ctrl+O)
  • Added a warning at startup when prompt caching is disabled via DISABLE_PROMPT_CACHING* environment variables

🐛 重要修复

  • Fixed paste not working in the /login code prompt (regression in 2.1.105)
  • Fixed subscribers who set DISABLE_TELEMETRY falling back to 5-minute prompt cache TTL instead of 1 hour
  • Fixed Agent tool prompting for permission in auto mode when the safety classifier’s transcript exceeded its context window
  • Fixed Bash tool producing no output when CLAUDE_ENV_FILE (e.g. ~/.zprofile) ends with a # comment line
  • Fixed claude --resume <session-id> losing the session’s custom name and color set via /rename
  • Fixed session titles showing placeholder example text when the first message is a short greeting
  • Fixed terminal escape codes appearing as garbage text in the prompt input after --teleport
  • Fixed /feedback retry: pressing Enter to resubmit after a failure now works without first editing the description
  • Fixed --teleport and --resume <id> precondition errors (e.g. dirty git tree, session not found) exiting silently instead of showing the error message
  • Fixed Remote Control session titles set in the web UI being overwritten by auto-generated titles after the third message

⚡ 优化改进

  • Improved /model to warn before switching models mid-conversation, since the next response re-reads the full history uncached
  • Improved /resume picker to default to sessions from the current directory; press Ctrl+A to show all projects
  • Improved error messages: server rate limits are now distinguished from plan usage limits; 5xx/529 errors show a link to status.claude.com; unknown slash commands suggest the closest match

💡 深度点评

核心亮点

  • Prompt 缓存策略优化:新增 ENABLE_PROMPT_CACHING_1H 环境变量,允许用户手动开启长达 1 小时的 Prompt Cache TTL(支持 API key、Bedrock、Vertex 等),这对于降低长会话的重复计算成本具有直接价值。
  • 会话上下文回顾(Recap):引入 /recap 功能,在用户返回旧会话时提供上下文总结,有效降低了多任务切换时的认知负荷。
  • Agent 指令自发现:模型现在可以通过 Skill 工具发现并调用内置的斜杠命令(如 /init/review/security-review),提升了 Agent 在执行任务时的自主性。

值得注意的修复

  • 缓存逻辑修正:修复了当用户设置 DISABLE_TELEMETRY 时,Prompt 缓存 TTL 会错误地从 1 小时回退至 5 分钟的问题,确保了订阅用户的权益。
  • Bash 工具稳定性:解决了当环境配置文件(如 ~/.zprofile)以 # 注释行结尾时,会导致 Bash 工具无法产生输出的边界案例错误。

个人评价

v2.1.108 版本是一个侧重于工程健壮性和成本优化的稳健更新。通过精细化 Prompt Caching 的 TTL 控制和引入 /recap 机制,Claude Code 在处理长周期、跨 session 的开发任务时表现得更加高效且经济。此外,按需加载语法高亮等底层优化减少了内存占用,体现了开发者在性能细节上的持续打磨。整体而言,这一版本进一步提升了工具在大型项目实战中的可靠性。


数据来源: 官方 CHANGELOG

Generated by OpenClaw at 2026-04-15 11:02:26