Claude Code Learning Hub
中文 Mingyu's Library

Hub / Tips / D · Cost & context

Why long sessions get dumber

The longer a session runs, the more Claude forgets instructions and makes rookie mistakes — that's not your imagination; it's the inevitable result of how context works.

Grinding on without restarting is the most expensive mistake you can make in a long session. This page covers the two degradation mechanisms, the four signals that it's time to start over, and how to hand off without losing context.

One-line answer

Bottom line OfficialThe docs say it outright: LLM performance degrades as the context fills; near the limit Claude starts "forgetting" earlier instructions and making more mistakes. Degradation comes from two mechanisms: noise dilution (irrelevant content crowding out attention) and compaction loss (auto-compact replacing verbatim history with a summary). If you've corrected the same problem twice and it's still wrong, write a handoff doc, /clear, and start fresh — a clean session with a better initial prompt almost always beats a long session dragging a pile of failed attempts.

Steps

  1. Understand degradation mechanism one: noise dilution.OfficialThe context window holds the entire session — every message, every file read, every command output; a single debugging run can eat tens of thousands of tokens. The official best practices list this as the first constraint: the fuller the context, the worse the performance. Mixing unrelated tasks into one session (what the docs call a kitchen sink session) and the failed attempts left behind by repeated corrections all dilute the information that actually matters — "important rules drown in the noise."
  2. Understand degradation mechanism two: compaction loses detail.OfficialNear the limit, auto-compact triggers and replaces the conversation history with a structured summary: it keeps the request intent, key decisions, changed files, and important code snippets, and drops verbatim tool output and intermediate reasoning. There are hidden losses after compaction too: rules with paths: and subdirectory CLAUDE.md files only reload once a matching file is read again; invoked skill bodies reload under a cap of 5,000 tokens each and 25,000 total, oldest dropped first. Details the summary didn't capture are genuinely gone from Claude's head afterwards.
  3. Recognize the signals to start fresh.Our takeBuilding on the official advice — if any of these appear, don't grind on:
    • You've corrected the same problem twice and it's still wrong — the docs are explicit: the context is now polluted by failed approaches; /clear and put what you learned into the new prompt;
    • Claude starts violating rules explicitly written in CLAUDE.md;
    • It rereads files it has already read, or re-asks questions already answered;
    • Auto-compact has already fired, and you're about to start something entirely new.
  4. Hand off before restarting — don't restart bare.OfficialPick the handoff to match the task size:
    • Small switch: /rename before /clear, so you can /resume back anytime (see D6 · Checkpoint / rewind / session management);
    • Big task: have Claude write the state to a file (a spec or handoff doc), and let the new session read it and continue. The official interview→spec workflow is exactly this pattern: once the spec is final, "run it in a new session that has clean, implementation-focused context";
    • Continuity, but slimmer: /compact with a directive (e.g. /compact focus on the API changes) to control what the summary keeps; or use the /rewind menu's Summarize from here / up to here to compress one stretch and keep the rest;
    • Quick side questions: ask with /btw — the answer stays out of the conversation history and doesn't grow the context.
  5. Side benefit: it's cheaper.A long session isn't just dumber — it's billed on the full context, every message carrying the entire history. For the complete quota-saving playbook, see Where did this month's quota go?.

Copy-paste prompt

This session has grown long; I'm going to continue in a new one. Write the
current working state into a handoff doc at HANDOFF.md, covering:
1. The task goal and current progress (done / not done, item by item);
2. The list of files changed, and the reason for each change;
3. Approaches that were tried and failed, and why they failed (so the new
   session doesn't repeat them);
4. The concrete next steps, and how to verify they were done right;
5. Project conventions or gotchas the new session needs to know.
When it's written, give me the first message for the new session: have it
read HANDOFF.md before starting work.

Sources & last verified

  • Officialcode.claude.com/docs/en/best-practices.md (performance degrades as context fills, /clear after two corrections, the kitchen-sink anti-pattern, new session after interview→spec), fetched 2026-08-05.
  • Officialcode.claude.com/docs/en/context-window.md (what compaction keeps and drops, skill/rule reload caps, /context and /autocompact), fetched 2026-08-05.
  • Officialcode.claude.com/docs/en/sessions.md (in-session use of /rename, /resume, /clear, /compact, /context), fetched 2026-08-05.
  • Our takeThe "four signals to start fresh" list and the HANDOFF.md handoff template are our arrangement of the official advice.
  • Last verified: 2026-08-05 · volatility:low (the core is context-management and handoff methodology, which barely ages; for version-specific details like compaction, the official docs are authoritative).