@realfxw: Lately, when running long tasks with Claude Code, do you often feel like the 5-hour quota is draining away like water? …

X AI KOLs Timeline News

Summary

一位推主根据 Anthropic 工程师 Lydia Hallie 的官方解释,澄清了 Claude Code 的 auto-compact 机制:默认在接近 967K 上下文时才触发压缩,导致长任务持续携带巨量上下文而快速消耗 5 小时配额。文中建议通过 /autocompact 400k、autoCompactWindow、promptCacheTtl 等配置提前压缩并优化缓存。

Lately, when running long tasks with Claude Code, do you often feel like the 5-hour quota is draining away like water? There was even someone in the community griping that it doesn't do any context compression at all, secretly stuffing in tokens like crazy behind the scenes. Today, after reading a detailed explanation from Anthropic's official engineer Lydia Hallie, I realized everyone has been misunderstanding its mechanism—the real issue lies in the default strategy being way too aggressive. A lot of people don't know this, but auto-compact is actually genuinely doing summarization. As soon as it's triggered, all the previous history gets outright replaced by a very short summary—there's no way it's retaining millions of redundant tokens in the context. So why does everyone's quota still plummet so fast? The key is that under the 1M context model, the system defaults to holding out until nearly 967K before kicking off auto-compression. That's a real killer—in that long stretch of conversation before hitting 967K, every single message you send is silently dragging along a massive context of seven or eight hundred K, or even close to a million tokens, in the background. Even if most of it hits the Prompt Cache with super low read costs, once the base balloons to that scale, every round of dialogue is still voraciously eating into your 5-hour usage. Some folks also fret that "compression will alter the prefix, invalidate the cache, and rewriting it all from scratch would be a total bloodbath." But nope, not at all. Generating the summary itself mostly rides on hot cache reads, and once invalidated, you just need to pay a tiny Cache Write fee for that super-short new summary—which in return slashes the base for all future interactions in half. In the long run, it's absolutely a steal. If you don't want your quota vanishing into thin air for no reason, here's a quick tip: make these two tweaks right away. When you're at the terminal, just type /autocompact 400k on the fly, or set up autoCompactWindow in ~/.claude/settings.json to force it to compress early and keep the context from snowballing to over 900K. Also, for personal subscriptions, the cache stay-alive time defaults to 1 hour, but background subagents only get 5 minutes. If you're pausing on code for a while and the cache goes cold, rewriting does sting— if you need to, tweak promptCacheTtl and subagentPromptCacheTtl in the config. And if your main session is running Opus, swap the background grunt-work subagent to a lighter model on the side; your quota will suddenly last way longer.
Original Article
View Cached Full Text

Cached at: 10/10/26, 12:50 PM

Lately, when running long tasks with Claude Code, do you often feel like the 5-hour quota is draining away like water? There was even someone in the community griping that it doesn’t do any context compression at all, secretly stuffing in tokens like crazy behind the scenes. Today, after reading a detailed explanation from Anthropic’s official engineer Lydia Hallie, I realized everyone has been misunderstanding its mechanism—the real issue lies in the default strategy being way too aggressive.

A lot of people don’t know this, but auto-compact is actually genuinely doing summarization. As soon as it’s triggered, all the previous history gets outright replaced by a very short summary—there’s no way it’s retaining millions of redundant tokens in the context.

So why does everyone’s quota still plummet so fast? The key is that under the 1M context model, the system defaults to holding out until nearly 967K before kicking off auto-compression. That’s a real killer—in that long stretch of conversation before hitting 967K, every single message you send is silently dragging along a massive context of seven or eight hundred K, or even close to a million tokens, in the background. Even if most of it hits the Prompt Cache with super low read costs, once the base balloons to that scale, every round of dialogue is still voraciously eating into your 5-hour usage.

Some folks also fret that “compression will alter the prefix, invalidate the cache, and rewriting it all from scratch would be a total bloodbath.” But nope, not at all. Generating the summary itself mostly rides on hot cache reads, and once invalidated, you just need to pay a tiny Cache Write fee for that super-short new summary—which in return slashes the base for all future interactions in half. In the long run, it’s absolutely a steal.

If you don’t want your quota vanishing into thin air for no reason, here’s a quick tip: make these two tweaks right away.

When you’re at the terminal, just type /autocompact 400k on the fly, or set up autoCompactWindow in ~/.claude/settings.json to force it to compress early and keep the context from snowballing to over 900K.

Also, for personal subscriptions, the cache stay-alive time defaults to 1 hour, but background subagents only get 5 minutes. If you’re pausing on code for a while and the cache goes cold, rewriting does sting— if you need to, tweak promptCacheTtl and subagentPromptCacheTtl in the config. And if your main session is running Opus, swap the background grunt-work subagent to a lighter model on the side; your quota will suddenly last way longer.

Similar Articles

@dotey: If you're using Claude Code, another recommendation: remember to run /autocompact 300k (the original tweet suggested 400k, but in my experience, 300k is enough; of course, you can decide which to use). Auto-compact condenses an entire long conversation into a brief…

X AI KOLs Timeline

Baoyu recommends that Claude Code users run /autocompact 300k to lower the automatic compaction threshold from the default of approximately 967K to 300K, keeping the conversation history concise and significantly reducing token consumption in long conversations. Lydia Hallie adds that auto-compact replaces the entire conversation with a brief summary.

@RealYDT: Doing performance optimization with Claude — why does everything keep getting bloated? It's all because everyone immediately asks the AI to "add a cache". Just came across a set of hardcore directives for slowness: force Claude to rewrite in data-oriented (DOD) style — flatten hash tables into arrays, pack hot data into the high bits of indices, convert AoS to SoA …

X AI KOLs Timeline

The article shares a set of prompt techniques for performance optimization with Claude: rewrite code using data-oriented design (DOD), flatten hash tables into arrays, replace pointers with array indices, convert AoS to SoA, and even delete all caches entirely — to truly squeeze hardware performance instead of using caches to mask slow designs.

@AYi_AInotes: Just now Boris, the father of Claude Code, shared the most underestimated feature of Claude Code, can directly boost your coding efficiency by 5x! It seems auto mode is truly the killer feature! No permission popups, no more clicking 'allow' every 30 seconds, you can start a session and let it run through the entire...

X AI KOLs Timeline

Boris Cherny, the father of Claude Code, shared the most underestimated feature—auto mode. No permission popups, can run multiple sessions simultaneously, boosting programming efficiency by 5x. Pro plan now supports Sonnet 4.6 and Opus 4.7.