Claude Code will now summarize your session at 400K tokens instead of 1M

Wait 5 sec.

Anthropic is making changes to Claude Code’s autocompact feature to avoid dragging the full weight of a long coding session into every prompt. On Tuesday, the company released Claude Code version 2.1.334, which will trigger autocompact on most current models with a 1 million-token context window at roughly 400,000 tokens instead of the usual 967,000. While many developers find the shorter context window an acceptable tradeoff for reduced token costs and better system memory utilization, others are pushing back. Anthropic also reiterated that while the 400,000-token context window cutoff is now default, users can adjust their autocompact settings and roll back to the earlier cutoff window if they choose. Auto-compact changes in version 2.1.334According to Anthropic’s documentation, the autocompact default update applies to all current-generation LLMs with a native 1M context window, including all the Fable models, Sonnet 5, Haiku 5.5, and Opus 4.7. Simply put, Claude Code will now summarize your session context as soon as it hits the cutoff length of 367,000 tokens instead of the previous limit of 967,000 tokens. This covers not only interactive sessions but also any Claude Code runs using scripts that use the -p flag and Claude Agent SDK runs. Anthropic is rolling it out progressively, but the update is already live for users who run Claude Code through third-party providers or those who disable tracking via the Telemetry feature. If you’re affected, you’ll see a one-time message that reads, “Autocompact now defaults to 400k tokens.” If you run the /config command in your CLI or navigate to the Config tab in the Claude Code desktop app, you should also see a new row that says “Auto-compact window.” How this impacts long coding sessionsLydia Hallie, a software engineer on Anthropic’s technical team for Claude Code, posted Wednesday on X that the new default “should help with your usage if you run longer sessions.” Anthropic’s documentation explains that this is because running compaction sooner helps keep sessions smaller overall, which reduces token costs. But this is about more than just the performance gains. Context rot, a phenomenon where models have trouble recalling details pertinent to your current request, gets worse the more your context window increases in size. Brian Scanlan, a senior principal engineer at Fin (formerly Intercom), has already run A/B tests on more than 700 of the company’s Claude Code users. He wrote on X that going from 320K to 500K for the autocompact trigger raised costs by about 10% while halving the number of compactions, adding that compaction at 400K seemed to be Claude Code’s “sweet spot.” “The lower default is a very reasonable trade-off,” Scanlan wrote in his December 2 post. He said that while some users complained purely because they disliked the idea of compaction, they could not point to any actual degradation in response quality and neither could he when reviewing their session transcripts. Not all developers are happyWhile many users welcome the change, some developers who work on complex projects remain skeptical. “I’d rather it wait on a long refactor,” a senior backend developer at Tencent wrote on X. Meanwhile another user questioned if Claude Code manages to keep reasoning chains intact with the shorter context window. It’s not for nothing because Anthropic’s own context engineering guide notes that compaction can erase “subtle but critical context” if done aggressively. But as Scanlan’s tests showed, compacting less often can raise token costs and reduce quality during long-running sessions. Chroma’s context rot study from 2025 also reached the same conclusion, stating that “performance grows increasingly unreliable as input length grows” across the 18 models tested. We’ll likely know more about real-world performance impact once the update has fully rolled out and more developers share their experiences. In the meantime, users can easily roll back to the 967,000 token context window by running /autocompact 1m on their terminal CLI. Developers can also run /compact with specific instructions on what to retain over a session, such as /compact focus on the auth migration. If you’re running Claude Code in a cloud environment, you can set CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 for the same effect. If you’re unsure if you’ve been impacted by the update during the gradual rollout, you can enter /autocompact by itself to see what the current defaults are.The New Stack reached out to Anthropic for additional information. The company did not respond by publication time.The post Claude Code will now summarize your session at 400K tokens instead of 1M appeared first on The New Stack.