Claude Code 的 auto-compact 运行时会把整段对话替换为简短摘要,并不会保留最后 1M tokens。约 967K 的触发点只出现在 1M 模型上;等到 967K 才压缩时,此前每条消息都包含整个对话、占用较多 token,其中大部分是便宜的缓存读取,但仍计入用量。使用 /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