How to Stop Claude Code From Forgetting Details by Disabling Automatic Context Compaction
In a column for Khanlist, tech journalist Mahnoor Faisal argues that disabling certain automatic settings in Anthropic’s Claude Code improves the tool’s ability to handle long-term tasks.
Faisal suggests that users can gain better reliability by manually managing the “context window”—the amount of information an AI can process at once—rather than relying on the software’s default automation. While Anthropic’s mainstream models feature 1-million-token context windows, Faisal notes that maintaining large histories can lead to “context rot,” where response quality declines as conversations grow longer.
The primary issue involves “automatic context compaction,” a feature that summarizes previous messages to free up space. When Claude Code v2.1.334 released on December 1, most models required less data to trigger automatic compaction.

| Trigger Type | Token Threshold / Condition |
|---|---|
| Previous Automatic Threshold | Approximately 967,000 tokens |
| New Automatic Threshold | Approximately 367,000 tokens |
| Idle Compaction | 200,000 tokens plus one hour of inactivity |
Faisal explains that the software also employs “idle compaction,” which can trigger after a session has sat untouched for about an hour once it reaches 200,000 tokens. She argues that this automation often causes the AI to lose critical nuances, such as the reasoning behind specific technical decisions or instructions provided during a session.
To prevent the AI from “forgetting” important project details, Faisal recommends using the “/config” command to toggle off both “Auto-compact” and “Idle compaction.” For those who prefer a middle ground, the “/autocompact” command allows for customization of the window.
Anthropic, PBC is an American artificial intelligence public benefit corporation headquartered in San Francisco whose flagship product is the Claude series of large language models. The company operates as a frontier AI developer, conducting research on mechanistic interpretability, safety, and alignment while deploying models through an online chatbot, an API, and agent harnesses including Claude Code, Cowork, Design, and Science.
In May 2025, Anthropic transitioned its coding assistant, Claude Code, from research preview to general availability, establishing it as a commercial tool for software development workflows. That same month, the company introduced new API capabilities such as the Model Context Protocol connector and a web search API, expanding its role as an infrastructure provider for real-time, context-aware AI applications.
Faisal notes that running “/autocompact 1m” can restore the previous million-token threshold. She concludes that she has stopped letting “an arbitrary token count or the amount of time I’ve spent away from my laptop determine when it’s worth sacrificing some of the context we’ve accumulated.”