Claude Code成本与额度约 2 分钟

离开前趁缓存还在compact

Compact before the cache expires

要点

  1. Anthropic 的建议:提示缓存约一小时过期,离开前先 /compact。
  2. 缓存还在时摘要更便宜,过期后再总结等于重付写入。
  3. 订阅侧默认可能是 1 小时,API 常是 5 分钟,除非打开 1 小时缓存。
  4. 靠人记很容易忘,真正省钱要把 compact 做成离开前的固定步骤。

原帖开头

Anthropic just published HOW to run Claude Code without burning tokens. Your prompt cache expires after an hour. Run /compact BEFORE you step away, while it is still cached. Summarizing later costs more.