Why Claude Code Gets Worse the Longer You Use It (and the Fix)

Anthropic engineer Thariq Shihipar published the official session management playbook. Rewind, compact, clear, subagents — when to use each.

Most Claude Code users treat their sessions like a group chat — they just keep typing until something breaks. Then they wonder why Claude started hallucinating, forgot what they were working on, or went completely off-track on step 47 of a refactor.

Thariq Shihipar — a member of Anthropic’s Claude Code team, former YC founder, and MIT Media Lab grad — just published the definitive guide to session management. It got 3,400+ likes in 24 hours. And the core message is almost counterintuitive: having a 1 million token context window doesn’t mean you should use all of it.

Here’s his playbook, translated for both power users and people who just started using Claude Code last week.


What Is Session Management (and Why Does It Matter)?

Claude Code has a context window of one million tokens. That’s everything the model can “see” at once — your instructions, the conversation history, every file it’s read, every tool call and its output. Think of it like a desk. A million tokens is a very big desk. But even a big desk gets cluttered, and eventually you can’t find the thing you need under the pile.

This clutter has a name: context rot. As your session grows longer, the model’s performance quietly degrades. Attention gets spread across more tokens. Older, irrelevant content starts to distract from what you’re actually working on right now. The model doesn’t crash or throw an error — it just gets… fuzzier. Less precise. More likely to hallucinate or miss details.

Research backs this up. Studies across frontier models show performance starts declining well before you hit the context limit — some benchmarks show accuracy dropping at just 25% of the window. The practical threshold most power users have landed on: once you’re past 50-60% of your context, the quality starts slipping.

Session management is the skill of keeping your context clean, focused, and relevant. And according to Anthropic’s own team, it’s the single biggest factor separating people who love Claude Code from people who think it’s unreliable.


The 5 Moves You Have After Every Turn

Here’s what most people miss: every time Claude finishes a response, you have a decision point. Most people just hit Enter and keep going. But you actually have five options, each with different effects on your context:

MoveWhat It DoesContext Effect
ContinueSend another message in the same sessionEverything stays — all previous messages, tool calls, file reads
Rewind (Esc Esc)Jump back to a previous message and re-prompt from thereKeeps everything before that point, drops everything after
/clearStart a brand new sessionClean slate — you write a brief to carry forward
/compactSummarize the session and keep goingClaude writes a summary, replaces the full history with it
SubagentDelegate work to a separate agent with its own contextSubagent works independently, only the result comes back

The spectrum runs from “keep everything” (Continue) to “keep nothing” (Fresh session). And the right choice depends on what just happened and what you’re about to do next.


The Rewind Rule: The One Habit That Changes Everything

If there’s a single takeaway from Thariq’s guide, it’s this: use rewind instead of correction.

Here’s the scenario. Claude reads five files, tries an approach, and it doesn’t work. Your instinct is to type “that didn’t work, try X instead.” Feels natural. But look at what just happened to your context:

Correcting (what most people do):

file reads → attempt A (failed) → "no, try B" → attempt B (failed) → "no, try C" → attempt C (works)

Your context now contains: the file reads + two failed attempts + two correction messages + the fix. That’s a lot of noise for Claude to wade through on the next task.

Rewinding (what Thariq recommends):

file reads → [Esc Esc back to here] → "use C, not A/B" → attempt C (works)

Your context contains: the file reads + one informed prompt + the fix. Clean. Focused. And Claude doesn’t have to pay attention to two dead-end approaches anymore.

Double-tap Escape (or run /rewind) to jump back. Pick the message right after the file reads. Re-prompt with what you learned. “Don’t use approach A — the foo module doesn’t expose that. Go straight to B.”

There’s a bonus move here too. Before rewinding, you can type “summarize from here” to have Claude write a quick handoff note — like a message from its future self that tried something and learned it didn’t work. Then rewind and paste that summary into your new prompt. All the learnings, none of the context bloat.


Compact vs. Fresh Sessions: The Decision That Matters Most

Once a session gets long, you have two ways to shed weight. They feel similar but work completely differently.

/compact — Let Claude Decide What Matters

/compact asks Claude to summarize the conversation so far, then replaces the full history with that summary. It’s quick, automatic, and you don’t have to write anything yourself.

The trade-off: it’s lossy. You’re trusting Claude to decide what was important. And Claude might be thorough — or might drop a detail you’ll need later.

You can steer it. Instead of just /compact, try: /compact focus on the auth refactor, drop the test debugging. That hint tells Claude what to preserve and what to trash.

Best for: Mid-task weight loss. You’re still working on the same thing, the session is getting bloated with exploration and dead ends, but you want to keep going. The details can be fuzzy.

/clear — You Decide What Matters

/clear wipes everything. But before you clear, you write down what matters: “We’re refactoring the auth middleware. The constraint is X. The files that matter are A and B. We ruled out approach Y because of Z.”

Then you start fresh with that brief. It’s more work, but the resulting context is exactly what you decided was relevant.

Best for: High-stakes transitions. You just spent 100K tokens exploring and found one critical fact. You want that fact — and nothing else — in your next session.

The Decision Table

SituationReach forWhy
Same task, context still relevantContinueEverything in the window is still useful
Claude went down a wrong pathRewind (Esc Esc)Keep the useful file reads, drop the failed attempt
Mid-task, session bloated with stale debugging/compact <hint>Low effort; Claude decides what mattered. Steer with a hint.
Starting a genuinely new task/clearZero rot; you control exactly what carries forward
Chunk of work will produce lots of intermediate outputSubagentFresh context for the work, only the conclusion comes back

What Causes Bad Compacts

If you run long sessions, you’ve probably had a compact that dropped something important. Thariq explains why: bad compacts happen when the model can’t predict the direction your work is going.

Example: you’ve been debugging for 45 minutes. Autocompact fires and summarizes the debugging investigation. Your next message: “Now fix that other warning we saw in bar.ts.” But because the session was focused on debugging, that warning got trimmed from the summary. Gone.

And here’s the uncomfortable part: due to context rot, Claude is at its least intelligent when compaction fires. It’s been trudging through a massive context window, attention spread thin — and now you’re asking it to make critical decisions about what to keep.

The fix: compact proactively, not reactively. Don’t wait for autocompact at 83% capacity. Run /compact yourself at 50-60% with a clear description of what you’re about to do next. Power users in the community have settled on this as the sweet spot — compact early, compact with intent, and you’ll almost never lose something important.


Subagents: The Context Isolation Trick

Subagents are the most underrated session management tool. When Claude spawns a subagent, that agent gets its own fresh context window. It can do as much work as it needs — read 20 files, run 12 searches, hit 3 dead ends — and then synthesize everything into a final report. Only that report comes back to the parent session.

All the exploration noise? Garbage-collected when the subagent exits.

The mental test Thariq’s team uses: “Will I need this tool output again, or just the conclusion?” If you only need the conclusion, that’s a subagent job.

Three real examples:

  • “Spin up a subagent to verify the result of this work based on the following spec file” — verification without polluting your build context
  • “Spin off a subagent to read through this other codebase and summarize how it implemented the auth flow, then implement it yourself in the same way” — research in isolation, implementation in the clean parent
  • “Spin off a subagent to write the docs on this feature based on my git changes” — docs work doesn’t need to see your debugging history

You can explicitly tell Claude to use subagents. And sometimes you should — Claude will use them automatically for some tasks, but it won’t always guess that you’d prefer the context isolation.


Power User Techniques (Beyond the Official Docs)

The community has developed patterns that go beyond what Anthropic published. Here are the ones that actually work:

Session Journals

Before running /clear, create a structured recap: design decisions, file list, TODOs, what worked, what didn’t. Save it to a file in your repo. When you start the next session, Claude can load that file instead of relying on massive chat history. Think of it as a shift handoff between different versions of Claude.

Horizontal Scaling

Instead of one mega-session that does everything, open parallel sessions per feature or module. Keep each relatively narrow. One session for the API layer, another for the frontend, a third for tests. Each stays lean and focused.

CLAUDE.md Session Rules

You can encode session management policies right in your project config: “Never keep more than 3 stack traces.” “Always summarize test failures into one file.” “When compacting, always preserve the full list of modified files.” Claude will follow these rules automatically, keeping your context clean without manual intervention.

Token-Aware Prompting

Prefer file tools over pasting large content. Let Claude re-open a file when needed rather than carrying its full contents in chat forever. Keep prompts short and single-tasked. Move long domain context into separate documents Claude can reference with tools.

The 50% Rule

Don’t wait for the context bar to hit red. Compact proactively at 50% usage — not 90%. Multiple practitioners report better stability and fewer hallucinations with this earlier threshold. One community post described it as “the difference between compacting when Claude is sharp vs. compacting when Claude is already confused.”


What This Means for You

If you use Claude Code daily and sessions feel unpredictable: Start with the rewind habit. Next time Claude goes wrong, don’t correct — rewind to just after the file reads and re-prompt with what you learned. This single change will make more difference than any prompt engineering trick.

If you’re a developer running long coding sessions: Set up a /compact rhythm. Compact at 50-60% with a hint about your next task, not at 90% when autocompact is forced. Add session rules to your CLAUDE.md file. And use subagents for any research or verification work that generates lots of intermediate output.

If you just started with Claude Code: Don’t worry about all of this yet. Use Claude Code normally. But when you notice it getting confused or forgetting things you told it earlier — that’s context rot. Come back to this guide, and start with two moves: /clear when you switch tasks, and Esc Esc when Claude goes wrong.

If you manage a team using Claude Code: Share the decision table. Most developers default to “just keep typing” and never use rewind, compact, or subagents. The five-move framework is the kind of shared vocabulary that makes a team dramatically more effective.


The Bottom Line

Session management isn’t about memorizing commands. It’s about one insight: a clean context beats a long context, every time.

The 1M token window is a safety margin, not an invitation to dump everything in. The best Claude Code users treat it like a working set — they’re constantly pruning, rewinding, compacting, and delegating to keep the signal-to-noise ratio high.

Thariq’s framework gives you five tools. The community adds a handful of power moves. But the habit that matters most is the simplest one: before you type your next message, take one second to ask whether continuing is really the best move — or whether a rewind, compact, or fresh start would serve you better.

That one second of thought is the difference between a 10-minute session that ships clean code and a 2-hour session that ends in frustration.


Sources:

Build Real AI Skills

Step-by-step courses with quizzes and certificates for your resume