Topic 2 of 5 · 3 min read
Contradictions inside the context
Goal: Find the conflicting items in a context and rewrite it so one source clearly wins.
Context clash happens when two items in the window disagree, and the model quietly picks one without telling you. Nothing in either item is a mistake on its own. The problem is that they cannot both be followed.
Check yourself · 1 of 3
You pasted two versions of a price list and asked for a quote. What is the likely risk?
Why it matters
Real contexts are built from many sources: your prompt, a pasted policy, an attached spreadsheet, a saved memory, an earlier instruction in the same chat. These sources are written at different times by different people. When they disagree, the model has no rule for who wins. It may follow the item that is nearest, the one that is longest, or the one that sounds most certain. You will not be told that a choice was made, so the answer looks fine and is quietly wrong.
How to find a clash
- List the sources. Write down every item the model can see: instructions, files, pasted text, memory, earlier turns.
- Compare the facts that matter. Dates, prices, names, limits, tone, format. Check each across all sources.
- Look for changes of mind. "Use formal tone" in message 2 and "keep it casual" in message 9 is a clash if you never withdrew the first.
- Check memory against attachments. Saved preferences often disagree with the file in front of you.
How to fix it
Pick the winner yourself and say so. Remove the loser if you can. If you must keep both, state the rule: "Where the 2026 price list and the 2024 brochure differ, use the 2026 price list."
Before and after
Before: You paste an old refund policy (30 days) and a new one (14 days) and ask: "Can this customer get a refund after 20 days?" The answer says yes, citing the policy it happened to weigh more.
After: "Use only the policy dated 1 June 2026 (14 days). Ignore the older one. Can this customer get a refund after 20 days?" The answer is no, and it names the policy it used.
What goes wrong
- Silent choice. The model does not say "these two disagree". It just answers, so you cannot see the clash.
- Instruction drift. A new instruction added in the middle of a chat does not cancel the old one. Both stay in force until you say so.
- Mixed answers. Sometimes the model blends both, giving a number that matches neither source.
You can also ask for the clash to be shown: "List any places where these documents disagree before you answer."
Optional: in a coding agent
Rule files often clash.
AGENTS.md: Use tabs for indentation.
.editorconfig: indent_style = space
Keep one, delete or fix the other, so the agent has a single rule.
Examples
Memory versus attachment
Saved memory says "I work in euros". You attach a quote in dollars and ask for a budget. The answer mixes both currencies. Tell the model: "For this task, use the currency in the attached quote."
Two rule files
A project has a style guide that bans comments and a contributor file that requires them. The agent follows one in one file and the other in the next. Merging the rules into one file ends the flip-flopping.
Key points
- A clash is two items in the window that cannot both be followed, even when neither is wrong alone.
- The model usually picks one side silently and does not tell you about the disagreement.
- A newer instruction does not cancel an older one unless you say it does.
- Find clashes by listing every source and comparing dates, numbers, names and tone.
- Fix it by removing the loser or stating a clear rule for which source wins.
Common mistakes
- Pasting an old and a new version of a document and not saying which is current.
- Adding a new instruction without withdrawing the one it replaces.
- Forgetting that saved memory is also in the context and may disagree with today's files.
- Assuming the model will warn you when sources disagree.
Check yourself · 2 of 3
In message 2 you said "formal tone". In message 9 you said "make it friendlier". You never withdrew the first. What is the best fix?
Check yourself · 3 of 3
Saved memory says you prefer short answers. Today you attach a brief asking for a detailed 2-page report. Which prompt line best prevents a clash?
Practice items, not counted towards your mastery.
Start here
- How long contexts fail (Drew Breunig) (opens in a new tab)ArticleFree
Names poisoning, distraction, confusion and clash, with examples from real agents.
- How to fix your context (Drew Breunig) (opens in a new tab)ArticleFree
Practical ways to prune, quarantine and summarise context after a failure.
- The lethal trifecta for AI agents (Simon Willison) (opens in a new tab)ArticleFree
Plain explanation of when untrusted content in context can leak private data.