I turned off one Claude Code setting, and it finally stopped forgetting what we were working on

I turned off one Claude Code setting, and it finally stopped forgetting what we were working on

2026 was the year things really turned around for Anthropic. Claude seemed to go from a tool spoken of in hushed, almost reverential tones within niche developer circles to one that people from basically every line of work were suddenly finding a use for. Naturally, this meant Anthropic went all-in on making Claude more capable by launching new features and commands.

Some of these launches, while helpful in theory, can end up having a bit of a counterproductive effect depending on how you use Claude Code. Turning off one of these features has made a surprisingly big difference to how reliably Claude Code can work on longer tasks without losing sight of what we were working on in the first place.

Claude Code has a finite amount of context to work with

Even a million-token context window has its limitations

Claude Code context command showing 126k of 1M tokens used by category on Opus 5.5

LLMs, both local and cloud-based, have what’s known as a context window. Think of this as the amount of information an AI model can work with at any given point in time. Everything from the prompts you send and the responses you receive to the contents of files the model reads and the outputs of tools it uses takes up space within this context window. At the time of writing, all four of Anthropic’s latest mainstream models have a 1-million-token context window.

Though that sounds like a lot of room to work with, it’s very easy to burn through your context window when you’re working on a project. What’s more, just because an AI model is capable of working with a million tokens doesn’t necessarily mean you’re better off giving it that much information to work with.

As Anthropic itself acknowledges, the quality of Claude’s responses can deteriorate as a conversation grows longer, a phenomenon referred to as context rot. Token consumption is another major issue. With every subsequent request, Claude has to work with an increasingly large conversation history, which, even with prompt caching, can eat into your usage allowance. So, even if you’re nowhere near exhausting your context window, there’s an argument to be made for keeping the amount of information Claude actively works with relatively small.

Anthropic’s solution to these problems is a feature called automatic context compaction, which comes enabled by default in Claude Code. I’ll get into how it works below, but I’ve since turned it off, not because I disagree with the reasoning behind compaction, but because I’ve found that I’m much better off deciding when to compact a conversation myself.

Claude Code takes context management into its own hands

Blink, and your conversation’s been compacted

The idea behind context compaction is relatively straightforward. Rather than continuing to retain every little detail of your conversation, Claude generates a summary of what you’ve discussed and uses that in place of the original messages, freeing up room for new information.

Given all of the above, it’s understandable that Anthropic wouldn’t want to leave the responsibility of managing Claude Code’s context window entirely up to the user. While you can manually compact a conversation at any point by running the /compact command, Claude Code also does this automatically once your conversation reaches a certain size. This is what’s known as automatic compaction.

Up until recently, Claude Code would, by default, automatically compact conversations on its million-token models at around 967,000 tokens. However, with the release of Claude Code v2.1.334 on December 1, Anthropic started rolling out a change that brings that threshold down to approximately 367,000 tokens for most of these models.

Claude Code doesn’t necessarily wait for you to reach this threshold to automatically compact a conversation, either. There’s also something called idle compaction, which, by default, can kick in once a conversation has accumulated at least 200,000 tokens and has been sitting idle for approximately an hour.

As someone who frequently switches between entirely different tasks throughout the day, I inadvertently trigger idle compaction quite often. I’ll leave a Claude Code session open with every intention of returning to it in a few minutes, get caught up in something else, and voilĂ . By the time I return to the session, Claude is working with a condensed version of our conversation rather than the conversation I left it with.

This comes with a rather frustrating trade-off

The devil is in the details Claude forgets

claude code context window page

The biggest problem I have with context compaction is that what’s worth retaining from a conversation is largely left up to Claude to decide. Unfortunately, what Claude deems insignificant isn’t necessarily what I’d deem insignificant.

For instance, when I’m working on a project with Claude Code, a good chunk of our conversation tends to revolve around discussing different ways of approaching something before eventually settling on one. While the summary Claude generates during compaction might retain the approach we ultimately decided to go with, it doesn’t typically retain the reasoning behind that decision or why we ruled out certain alternatives. I’ve had instances where, following compaction, Claude suggested doing something we’d already spent a considerable amount of time discussing and explicitly decided against.

The same applies to instructions I give Claude throughout a session. Unless I’ve explicitly added an instruction to my CLAUDE.md file, there’s no guarantee it’ll survive compaction. Though I’ve gotten into the habit of having Claude document important instructions and decisions as we work, I don’t necessarily remember to do so every single time.

Something else that frustrates me is that automatic compaction can happen at a point when much of the information that’s accumulated in the context window is still relevant to what we’re working on. There’s a considerable difference between compacting a conversation once we’ve wrapped up a particular task and doing so when we’re halfway through figuring something out. Yet, as far as automatic compaction is concerned, the distinction doesn’t necessarily matter.

I’d rather decide when it’s time to compact a conversation

Taking back control of the context window

Fortunately, Anthropic doesn’t force you to use automatic compaction. Turning it off is as simple as running the /config command in Claude Code and toggling off Auto-compact and Idle compaction.

If you’d rather not turn off automatic compaction altogether but aren’t particularly fond of Anthropic’s new default threshold, there’s a middle ground, too. You can use the /autocompact command to customize the auto-compaction window for the model you’re using. Running /autocompact 1m, for instance, restores the previous million-token auto-compaction window. You can also disable idle compaction independently through /config.

I haven’t stopped compacting conversations altogether, nor have I made it a point to squeeze every last token out of my context window. I’ve simply 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. I’d much rather make that call based on where we actually are with the task at hand!