Claude 的 auto-compact 机制在运行时会将完整对话替换为简短摘要,并非保留 1M 上下文。在 1M 模型中默认约 967K tokens 时触发压缩,压缩本身是一次主要走缓存读取的单次请求,但在此之前每条消息都会携带全量历史上下文并计入用量。用户可执行 `/autocompact 400k` 将触发点提前至 400K,避免单条消息上下文规模过大。
原文澄清了自动压缩机制的计费与缓存逻辑,提供了主动调整触发阈值以控制用量的方法。
Just to avoid some confusion: auto-compact does summarize. When it runs, your whole conversation is replaced by a short summary. It doesn't keep the last 1M tokens around.
The ~967K is only when it runs on 1M models. Compacting itself is just one request that reads about as many tokens as the message you sent right before it, and it's mostly cache reads if your cache is still warm.
What @rohit3a found is that waiting until 967K means every message before that point uses a lot of tokens, because each one includes your whole conversation so far. Most of it is read from the cache, which is much cheaper (so this is usually fine as long as your cache is warm), but it still counts toward your usage and adds up as your conversation grows.
/autocompact 400k makes it summarize at 400K instead, so your messages never get that big.
holy fuck. so auto compact basically loads last 1M tokens into context by default on claude? and here i thought they were summarising and reducing the context loads. no wonder people used to burn anywhere from 2%-15% 5h limits simply for auto compacting their sessions.在 X 查看被引用的帖子
来源:Lydia Hallie ✨ · x.com