Home / Free AI Tools / 2 Claude Code Habits That Are Wasting Your Tokens (And How to Fix Them)

2 Claude Code Habits That Are Wasting Your Tokens (And How to Fix Them)

Claude Code · April 2026
Fact-Checked ✓
🛑
Two Claude Code Habits That Are Silently Wrecking Your Sessions

Most Claude Code users hit limits and get worse results than they should — not because the tool is bad, but because two specific habits are burning through context fast. Here’s what to do instead, backed by Anthropic’s own documentation.

BAD HABIT #1
Pasting full documents into the chat
BAD HABIT #2
Correcting the same bug more than twice

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.

🧠 Context Window — The One Concept You Need to Understand First

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.

🛑
Bad Habit #1
Pasting Whole Documents Into the Chat

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.

Why This Happens

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.

✅ The Fix: Use MCP for On-Demand Document Retrieval

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.

Quick Setup (3 Steps)
Step 1 — Upload your docs to notebooklm.google.com (they stay there permanently)
Step 2 — Install the MCP server:
# Install via uv (Python package manager)
uv tool install notebooklm-mcp-cli
# Authenticate with Google (one-time)
nlm login
Step 3 — Add to .claude/settings.json:
{
“mcpServers”: {
“notebooklm”: {
“command”: “uvx”,
“args”: [“–from”, “notebooklm-mcp-cli”, “notebooklm-mcp”]
}
}
}
Example Prompt Once It’s Connected:
“Fix the error in auth.ts. Check the ‘2026_Auth_Spec’ notebook in NotebookLM for the relevant API endpoints and requirements before making any changes.”

Claude fetches only the relevant section — not the whole doc. Your context stays clean.

📎 Also Useful: Keep CLAUDE.md Lean

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.

🛑
Bad Habit #2
Correcting the Same Bug Over and Over

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.

The Anchoring Problem — Why More Fixes = Worse Code

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.

✅ The Fix: The 2-Attempt Rule + Strategic Reset

Anthropic’s documented workflow for Claude Code is deliberately short on retries. Here’s the actual recommended flow:

1
First attempt
Write your best prompt. Give Claude the task with clear context and output requirements.
2
If it fails — one correction
Share the exact error output and ask for a fix. One attempt with real error data attached.
!
Still broken? Stop here.
Don’t send another correction. The session is now working against you. More messages = more context rot + more anchoring on failed logic.
3
Consider: /rewind first
Before nuking the whole session, try /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.
4
If /rewind isn’t enough — use /clear
Wipe the session. Write a better prompt that includes what you learned from the failure. Treat the failed session as research, not wasted effort.

❓ “Won’t /clear delete my code?”

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.

Better Restart Prompt — Encode What You Learned
“Build the login form in src/components/Login.tsx. Important: the onSubmit handler MUST include e.preventDefault() — skipping it causes a page reload that breaks the auth state. Don’t omit it.”

The failure from the last session becomes a constraint in the new prompt. You’re not starting from zero — you’re starting smarter.

The Full Context Management Toolkit

Anthropic’s April 2026 session management guide lays out five options at every decision point. Here’s when to use each one.

CommandWhat It DoesUse When…
ContinueSend the next message in the same sessionEverything in context is still useful for the next step
/rewind (Esc Esc)Jump back to a previous message, drop everything after itAn attempt failed but earlier context (file reads) is still worth keeping
/compactSummarize the session, replace history with the summarySession is getting long but you want to keep going without full file rereads. Use proactively — don’t wait for autocompact to fire
/clearCompletely wipe the session contextStarting a new unrelated task, or a session is too polluted to salvage
SubagentSpin off a separate agent with its own clean context — returns only the resultThe next task will generate a lot of intermediate output you won’t need afterward (codebase searches, doc writing, verification runs)

💡 Anthropic’s Internal Test for Subagents

“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.

⚡ Pro Tip: Steer /compact, Don’t Just Fire It

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.

🔖 SAVE THIS — Quick Reference
🛑 STOP DOING: Pasting full documents
Use MCP-connected knowledge sources. Claude retrieves only what it needs, when it needs it. Keep CLAUDE.md under 200 lines.
🛑 STOP DOING: Correcting the same bug more than twice
2 attempts max. Then /rewind to just before the failure, or /clear and write a smarter prompt that encodes what you learned.
✅ THE RULE: New task = new session
Context rot is real. Even with 1M tokens available, fresh context outperforms stale context. Use /compact proactively on long sessions — don’t wait for it to autofire.

Hit either of these habits hard? Drop a comment — especially if you’ve found a different fix that works for you.

Tagged:

Leave a Reply

Your email address will not be published. Required fields are marked *

🔥 Don't miss the latest from AI Agent News! Subscribe Now 👉