Anthropic Explained How and When to Properly Start a New Session in Claude Code
Anthropic demonstrated that in Claude Code, context size alone doesn't save you—sessions need proper management. Along with the /usage command, the company…
AI-processed from Habr AI; edited by Hamidun News
Large context windows in Claude Code provide more freedom, but simultaneously make session management mistakes more expensive. The longer a single conversation stretches, the higher the risk that unnecessary files, outdated solutions, and intermediate hypotheses will end up in context and start hindering the model just as much as useful data helps it work. This is precisely why Anthropic added the /usage command to Claude Code and separately called attention to how developers manage their sessions.
After expanding the window to 1 million tokens, it became noticeable that users work very differently: some maintain one long terminal dialog for weeks, others start a new session after almost every request. The variation turned out to be not cosmetic. The chosen strategy affects the quality of suggestions, model behavior during compaction, and the final cost of operation.
The main idea is simple: there is no universal rule to maintain one infinite session or, conversely, constantly start from scratch. A long session is useful when you're sequentially solving one related task, for example examining project architecture, fixing several files, and gradually refining requirements. In this mode, accumulated context speeds up work: the model doesn't need to re-read the codebase, remember constraints, and reconstruct already-made decisions.
A new session is needed in a different situation: when the task fundamentally changes, too much rough draft garbage has accumulated in the conversation, or the model has latched onto an incorrect assumption. The signs are usually visible quickly. Claude Code starts relying more often on old branches of reasoning, suggests solutions for already-closed problems, returns to canceled ideas, or pulls irrelevant details from early messages into its response.
At this point, the large context stops being an advantage and becomes a source of noise. Restarting the session helps reset excess baggage and reframe the task. Hence the interest in context management tools within Claude Code.
The /usage command is needed not just out of curiosity, but as a way to understand how much resource is already taken up and whether it's time to rebuild the conversation. The compact function is useful when the dialog still stays within the bounds of one task, but needs to be compressed to keep only what's essential. Rewind is suitable for rolling back to an earlier point if discussion went off track.
Subagents should be engaged when part of the work can be extracted into a separate thread and not overload the main context with side investigations. In all cases, the goal is one: keep in the window only what really helps the next step. The problem is that compaction is not a magic button.
If a session is already filled with disputed solutions, duplicate instructions, and code fragments that no longer apply, then after compression this noise can persist in more concentrated form. Therefore, the best result usually comes not from attempting to save an overloaded dialog at any cost, but from a timely decision: either carefully trim it around one goal, or honestly start a new conversation from a clean slate. Essentially, Anthropic describes for Claude Code the same discipline that experienced developers have long used in code and tasks: separate responsibilities, don't accumulate excess, and regularly check that the system is still solving the current problem, not struggling with the legacy of previous solutions.
A million tokens doesn't cancel this discipline; it makes it even more important. The more available memory, the higher the cost of poor structure, because it contains not only useful context but also much more confusion. The practical conclusion is this: a session in Claude Code is worth continuing as long as it helps move forward within one clear task, and is worth restarting as soon as context starts to conflict with the goal.
Following this is now easier through /usage, and compact, rewind, and subagents become not auxiliary trifles, but basic quality tools. For a developer this means more accurate answers, fewer false starts, and predictable work even over very long distances.
Want to stop reading about AI and start using it?
AI News is a curated feed of AI/tech news. Hamidun Academy teaches you to use AI systematically in your work.