Here’s something almost nobody talks about when they complain about Claude Code: the limits you’re hitting aren’t just a capacity problem. A lot of the time, they’re a workflow problem.
Two habits account for a massive amount of wasted tokens and degraded output quality. They’re both easy to fix once you understand why they cause problems — and that’s exactly what this post is for.
Everything below is grounded in Anthropic’s official Claude Code documentation and the session management guidance they published in April 2026. No speculation — just the mechanics of how Claude Code actually works, and how to use them in your favor.
The context window is everything Claude can “see” at once when generating a response: your system prompt, the full conversation history, every tool call and its output, and every file that’s been read. Claude Code’s context window is 1 million tokens as of 2026.
Here’s the critical part: model performance degrades as context grows. Anthropic calls this “context rot” — attention gets spread across more tokens, and older, irrelevant content starts distracting from the current task. A fuller context window doesn’t just cost more. It actively produces worse output.
When you paste a 10-page spec document into the chat, Claude reads every single word of it on the first response. That’s unavoidable — and expected. But here’s the part people miss: Claude re-reads all of it on every subsequent response in that session.
Ask three follow-up questions, and Claude has processed that 10-page document four times. Your context fills up, your cost climbs, and — because of context rot — your output quality drops as the session goes on.
Every turn in a Claude Code session adds to the conversation history. Claude Code doesn’t selectively ignore your previous pastes — everything you’ve sent is still in the context window. The session history is cumulative. That 5,000-token document you pasted at the start is still costing you tokens on your 20th message.
Instead of pasting documents, connect Claude Code to an external knowledge source via MCP (Model Context Protocol). Claude then retrieves only the relevant chunk of a document when it needs it — typically under 200 tokens — rather than loading the entire thing upfront.
The best option for most people: NotebookLM + MCP. Upload your reference documents to NotebookLM once. Connect it to Claude Code. Claude will search and retrieve what it needs, when it needs it.
.claude/settings.json:Claude fetches only the relevant section — not the whole doc. Your context stays clean.
The CLAUDE.md file loads into your context at the start of every single session. Anthropic recommends keeping it under 200 lines. A bloated CLAUDE.md is a silent tax on every session — you’re paying tokens for that file before you’ve typed a single character. Keep it to stable rules, build commands, and project facts. Cut everything else.
Also: use /context to see what’s actually consuming space in your current session. The biggest token drain is often not your chat — it’s tool results and file context you’ve already moved past.
You know this loop: Claude writes code. It doesn’t work. You say “that didn’t work, try again.” Claude tries something slightly different. Still broken. You explain the error. Claude tries yet another angle. The code is now messier than when you started, and you’re 20 messages deep with nothing to show for it.
This isn’t just frustrating — it’s mechanically counterproductive. Here’s why.
When Claude is working within a conversation that contains failed attempts, it sees all of them. The broken code, the wrong approaches, the error messages — they’re all in context. Claude anchors on that history when generating its next attempt, which is why fixes tend to spiral into patchwork rather than clean solutions.
Anthropic’s session management documentation describes this directly: as context accumulates failed approaches, the model’s ability to reason cleanly about the problem degrades. The session becomes contaminated by its own history of failure.
Anthropic’s documented workflow for Claude Code is deliberately short on retries. Here’s the actual recommended flow:
/rewind (or double-tap Esc). Jump back to just after Claude read the relevant files — before the failed attempt. Re-prompt from there with better instructions. You keep the file context without carrying the failure history.No. Your code already exists in your local folder. /clear only wipes Claude’s conversation memory — not your filesystem. Claude can re-read your project files any time you ask. Think of /clear as resetting the whiteboard, not deleting the work.
The failure from the last session becomes a constraint in the new prompt. You’re not starting from zero — you’re starting smarter.
Anthropic’s April 2026 session management guide lays out five options at every decision point. Here’s when to use each one.
| Command | What It Does | Use When… |
|---|---|---|
| Continue | Send the next message in the same session | Everything in context is still useful for the next step |
| /rewind (Esc Esc) | Jump back to a previous message, drop everything after it | An attempt failed but earlier context (file reads) is still worth keeping |
| /compact | Summarize the session, replace history with the summary | Session is getting long but you want to keep going without full file rereads. Use proactively — don’t wait for autocompact to fire |
| /clear | Completely wipe the session context | Starting a new unrelated task, or a session is too polluted to salvage |
| Subagent | Spin off a separate agent with its own clean context — returns only the result | The next task will generate a lot of intermediate output you won’t need afterward (codebase searches, doc writing, verification runs) |
“Will I need this tool output again, or just the conclusion?”
If you only need the conclusion — spin up a subagent. Let it do the search, the verification, or the doc-writing in its own context, and return only the result to your main session. Your context stays clean. Your main session stays fast.
You can tell /compact what to keep and what to drop: /compact focus on the auth refactor, drop the test debugging. The default autocompact fires when your context is nearly full — exactly when the model is performing worst due to context rot. Use proactive, steered compact before you hit that ceiling.
Hit either of these habits hard? Drop a comment — especially if you’ve found a different fix that works for you.