Skip to content
Agentic Levels
  • New to AI?
  • Assessment
  • Levels
  • Lessons
  • Tracks
  • Resources
  • Reference
  • What's New
  • What's Next
  • More
    Tool SetupCompareAboutThanksFAQPricingPreferences
  • New to AI?
  • Assessment
  • Levels
  • Lessons
  • Tracks
  • Resources
  • Reference
  • Tool Setup
  • Compare
  • What's New
  • About
  • Thanks
  • FAQ
  • What's Next
  • Pricing

© 2026 Fuentes Studio·Privacy·Terms

yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

L4Lesson 2

Prune Like a Pro

After this, you'll be able to identify context poisoning in a failing session and fix it by removing content rather than adding more.

Before you start

Complete Audit Your Token Budget first; this lesson builds on the four cost-center breakdown so you know exactly which content to cut when a session goes sideways.

The idea

You are a writer in turn 80 of a long research session. Early turns had notes from a draft you scrapped. Middle turns had a tangent about formatting. Now every answer mixes up which draft you are working on and which you abandoned. You keep adding clarifications. It keeps getting worse. This is context poisoning.

Context poisoning is what happens when you add too much, add the wrong things, or add outdated information. The counterintuitive part: more context is not always better. Past a certain noise threshold, adding more makes the output worse.

Here is the before and after: A user was getting inconsistent answers about their codebase. They had pasted: the full README (1,200 lines), three config files (600 lines total), a previous chat session about an unrelated bug (800 lines), and the actual question (50 lines). Total: about 21,000 tokens of noise around 50 tokens of signal. Claude kept mixing up which config applied to which environment. The fix was not a better prompt. The fix was deleting the unrelated chat history and replacing the full README with a 6-line architecture summary. Output quality went from unusable to precise.

The three most common context poisons at Level 4: stale history (turns from earlier in the session that no longer apply), whole-file pastes (when a function or a section is all you need), and contradictory rules (old CLAUDE.md entries that conflict with newer ones).

Try it (20 min)

Watch out for

  • Adding more context to fix a context problem. Nine times out of ten, less is the fix.
  • Keeping conversation history across topic changes. When the task shifts, start fresh.
  • Pasting a file and then editing the file without updating what you pasted. Claude is still reading the old version.
  • Over-stuffing CLAUDE.md with rules that conflict with each other. Two contradictory rules are worse than zero rules.

Paste this into Claude:

I am going to paste a session where the model's output quality degraded over time. Here it is: [paste the conversation or describe what you pasted and what went wrong]. Diagnose it: what specifically poisoned the context? Was it stale history, whole-file overload, contradictory instructions, or outdated information? Then tell me exactly what to remove and what to rewrite.

What good looks like:

  • You identified the specific content that was poisoning the context, not just 'too much stuff'
  • You got a specific removal list, not a vague 'simplify it' suggestion
  • After pruning, you reran the same request and got a noticeably better response
  • You can name the category of poison (stale history, whole-file, contradictory rules, outdated info)
  • You did not add new context to fix the problem. You removed existing context.

What a good response looks like:

Diagnosis: your session has three distinct poisons working together.

Poison 1 (stale history): Turns 1-18 were about configuring your staging environment. You said that work is done. But turns 19-35 kept referencing the staging config when you asked about production. I was anchoring on the earlier context. Cut turns 1-18 entirely.

Poison 2 (whole-file paste): You pasted the full webpack.config.js at turn 7 (420 lines). Your actual question was about the output path setting, which is 8 lines starting at line 312. I kept citing the loader configuration from lines 50-200 when it had nothing to do with your question. Replace the full file with just lines 308-320.

Poison 3 (contradictory rules): Your CLAUDE.md says 'Use CommonJS require()' in one rule and 'Use ES module imports' in another. These were added at different times. I was alternating between them depending on which appeared later in the file. Pick one and delete the other.

What to remove: everything before turn 19, the full webpack.config.js, and one of the two conflicting import rules. What to keep: turns 19-35, the 8 relevant webpack lines, and your current question. After removing, restart the session with only those three items.

When this breaks

  • Breaks when the poison is not in the visible turns but in CLAUDE.md or pinned files because session-level pruning leaves the persistent layer untouched and the same poison reappears next session.
  • Breaks when the model's own earlier hallucination is the poisoning content because subsequent turns treat its prior wrong claim as established fact and pruning has to extend to those derived turns.
  • Breaks when topic boundaries are fuzzy (research sessions that legitimately touch many threads) because mechanical 'cut everything before turn N' loses connections that the next phase actually needs.

Claude can do it for you

Say to Claude: 'My outputs have been getting worse as this session goes on. Diagnose what in our conversation history might be poisoning your context. What should I delete before I continue?' It will tell you exactly what to cut.

You can now

Diagnose a degrading session by labeling each poison as stale history, whole-file overload, or contradictory rules, then produce a removal list that does not add a single new word.

Key takeaways

When output degrades, your first move is subtraction, not addition. Diagnose the poison, name its category, then remove before you add.

  • Context poisoning is the failure mode behind most 'why is the model getting worse' moments.
  • The three common poisons are stale history, whole-file pastes, and contradictory rules.
  • Less context is the fix nine times out of ten. Adding more usually deepens the problem.
  • Editing a file after pasting it leaves Claude reading the old version. Re-paste or summarize.
  • Two contradictory CLAUDE.md rules are strictly worse than zero rules on that topic.

Go deeper

  • Anthropic: Long context prompting tips
  • 12-Factor Agents: own your context window
Up nextWrite a CLAUDE.md That Earns Its Tokens→