Neiromant

How to work with Claude Code with a 1 million token context without breaking the results?

Claude Code, issues with long sessions, context decay, operational errors, session management, sub-agents for improving results

These observations are based on an analysis of Claude Code workflows shared by Tarik Shihipar, a developer at Anthropic. He describes in detail how the model actually behaves during long sessions and exactly where the problems begin.

Why a 1 million token context is a trap, not just an advantage?

A million-token context creates the illusion that you can stop thinking about workflow structure and just run one long session where the model gradually solves everything. In practice, however, this leads to the opposite effect: as the context grows, the model begins to lose focus and make less accurate decisions, even if you are technically far from the formal limit.

The context includes everything: the conversation, files, tool calls, and their results. The problem is that the model cannot completely ignore old information, so it continues to influence the current task even when it is no longer relevant.

This effect is called context decay. It manifests as attention being spread across a massive amount of data, causing the current task to lose priority while outdated snippets start to interfere.

In practice, degradation can begin at just a few hundred thousand tokens. This isn't a hard limit, but rather a tipping point where quality becomes noticeably less stable.

Why a long session almost always degrades the result?

The most common mistake is continuing to work in a single session, mixing different tasks, solutions, and attempts because it feels like the model "already knows everything." But along with the useful context, it drags along all the noise, including failed approaches and outdated conclusions.

Therefore, the basic rule is simple: a new task should start with a new session, even if it is technically possible to continue. Otherwise, you are paying for convenience with quality.

When is continuing a session actually justified?

There are situations where resetting the context makes no sense—for example, when you have just written code and immediately want to generate documentation or make small changes. Since the model has already read the necessary files, re-reading them would increase both time and cost, and the task itself doesn't require high precision.

In such cases, extra context can be an acceptable compromise.

Why Rewind works better than asking for a fix?

When the model makes a mistake, most users simply send the next message with a correction. However, this leaves the flawed logic in the context, which continues to influence subsequent answers.

Rewind works differently: it takes you back to the moment before the error and deletes the failed branch, allowing you to provide a new instruction in a cleaner context. This fundamentally changes the quality because you aren't just fixing a mistake—you are rewriting the course of the solution.

Additionally, you can use intermediate summarization to lock in conclusions and start from a more accurate point.

Compact vs. a new session: the difference that impacts the result

When the context becomes too large, you have two options: Compact or a new session. They look similar, but they function differently.

Compact allows the model to compress the history itself and keep only the essentials. This is fast and convenient, but you lose control because some information is inevitably discarded.

A new session requires you to manually define what is important, but it gives you full control over the context, which is exactly what makes it more reliable for complex tasks.

Why Compact sometimes breaks your workflow

The problem arises when the model doesn't understand where you are headed next. For example, if you spent a long time on one task, then performed a compression, and then switched to a different topic, the necessary data might simply be left out of the final summary.

The situation is exacerbated by the fact that Compact often occurs within an already overloaded context, where the model's ability to choose what to keep is progressively worsening.

Therefore, a more reliable approach is to perform compression in advance and explicitly specify which parts of the context are critical.

Sub-agents as a way to avoid cluttering the context

Sub-agents allow you to move part of the work into a separate context where unnecessary information does not accumulate, returning only the result without all the intermediate steps.

This is particularly useful for tasks where the outcome matters more than the process—such as code analysis, verifying results, or generating documentation. Otherwise, all that intermediate information remains in the main session and degrades it.

What actually affects the quality of work

Every message sent after a model's response is a decision point. You decide whether to continue, roll back, start over, compress the context, or delegate the task to a separate agent. This choice determines the result more than the phrasing of the prompt itself.

Summary

A large context creates the illusion that you don't need to think about workflow structure, but in practice, it requires even more control because errors don't disappear—they accumulate and become harder to spot.

If you don't manage your sessions, the model begins to lose precision, decisions become less reliable, and costs increase. If you do manage them, the results become stable and predictable.

Ultimately, working with Claude Code isn't about writing the perfect prompt; it's about controlling exactly what the model sees at any given moment.

Translated from Russian. Original on vc.ru: Как работать с Claude Code при контексте в 1 миллион токенов и не сломать результат?