When two instructions in a system prompt or context file contradict each other, the LLM does not raise an error. There is no rule engine, no priority resolver, no conflict detector inside the model. The instructions are evidence in a probability distribution, and conflicting evidence produces silent, intermittent inconsistency — the model obeys rule A on Tuesday and rule B on Wednesday, depending on phrasing, recency, and surrounding context.

This page describes how the model resolves conflicts in practice, why blanket rules generate them, and three techniques for writing instructions that don’t fight each other.

The Core Reality

Warning

Conflicting instructions don’t produce errors. They produce drift.
No exception is thrown. No warning surfaces. The output just becomes unreliable in ways that look like “model variance” but are actually self-inflicted ambiguity.

LLMs perform pattern completion across the entire context. Each next token is sampled from a distribution shaped by the joint statistical influence of everything in the prompt — system prompt, context files, conversation history, the current user message. When two rules pull on that distribution in opposite directions, neither wins by design. Outcome depends on which pulls harder for this specific input.

This is also why Agent Harnesses are so sensitive to context engineering: every instruction you add is not isolated — it interacts with every other instruction in the prompt.

The Four Biases That Decide Which Rule Wins

When rules conflict, four empirical biases concentrate the distribution. These are tendencies, not guarantees.

BiasEffect
RecencyInstructions appearing later in the prompt have stronger pull. The latest user message > earlier user messages > CLAUDE.md > base system prompt.
SpecificityConcrete, narrow rules (“for aliases with commas, use block format”) beat vague, broad ones (“aliases should be inline”).
Repetition / emphasisRules stated multiple times, or written in CAPS / with ALWAYS / NEVER / callout blocks, get more weight.
PositionBeginning and end of context get more model attention than the middle — the “lost in the middle” effect. Long context files have a soft dead zone in their interior.

Frontier models (Claude Sonnet 4.5, GPT-5) increasingly use context-based disambiguation: they infer which rule “applies” based on the semantics of the current task. This works most of the time but is not guaranteed — and it relies on the rules being disambiguatable in principle, which conflicts often aren’t.

Real Examples of Silent Conflicts

Example 1: tone

In a typical agent setup like this vault:

From CLAUDE.md: “Narrative and explanatory — write as if teaching someone the topic. Provide context and reasoning, not just facts.”

From the harness’s default system prompt: “Be concise in your responses.”

These pull opposite directions. Sometimes the model leans long (“narrative” wins because it semantically matches “writing a wiki page”), sometimes short (“concise” wins because the user asked a simple question). The disambiguation works most of the time but produces occasional 3-paragraph answers to yes/no questions or terse pages that should have been narrative.

Example 2: thresholds

Rule A: “Always update index.md when creating or significantly changing a wiki page.”

Rule B: “Ask before large restructuring — if an ingest would touch >10 pages.”

What counts as “significantly”? When does updating cross over to “restructuring”? The model has to guess. Sometimes it silently updates 8 pages without asking. Sometimes it asks before updating 3. The vague qualifier “significantly” is the conflict generator.

Example 3: overlapping universals

Rule A: “Always use inline alias arrays: aliases: [foo, bar]”

Rule B: “Always use block-list format for aliases.”

Two Alwayses applied to the same domain. The model coin-flips, and you get inconsistent frontmatter across pages.

Three Techniques for Conflict-Free Rules

1. Replace blanket rules with conditional rules

❌  "Be concise."
❌  "Be narrative and explanatory."

✅  "When replying in chat: be concise.
    When writing a wiki page: be narrative and explanatory."

Conditions eliminate the conflict because each rule’s domain is now disjoint. The model no longer has to choose — it pattern-matches the current task to one of the disjoint conditions.

2. Use thresholds instead of vague qualifiers

❌  "Update index.md for significant changes."
✅  "Update index.md when: creating a new page, renaming a page, or
     changing a page's category. Skip updates for typo fixes and minor
     edits."

Vague words — significant, important, substantial, usually, prefer, try to — are conflict generators. Every reader (model included) draws the line differently. Replace them with enumerated cases or numeric thresholds.

3. State precedence explicitly when overlap is unavoidable

✅  "Aliases use inline form: aliases: [foo, bar].
    EXCEPTION: when an alias contains a comma, use block list format
    instead. Block format takes precedence over inline when both
    could apply."

When two rules genuinely must overlap, give the model a tie-breaker. “X takes precedence over Y when both could apply” turns a coin flip into deterministic behavior.

Detecting Conflicts in an Existing Context File

Three lightweight techniques:

  1. Self-summarization test. Ask the agent: “Summarize the rules in your context file in 10 bullet points. Highlight any that seem to overlap or contradict.” If it surfaces overlaps, you have conflicts.
  2. Adversarial probing. Ask the agent to handle an edge case that sits between two rules. If different sessions produce different choices, you have a conflict.
  3. Vague-word audit. grep your context files for significant, usually, prefer, try to, important, appropriate. Each hit is a conflict candidate.

The Underlying Principle

Key

The LLM has no rule engine — your instructions are evidence in a probability distribution, not lines of code. Conflicts produce drift, not errors. The job of a context file is not just to list rules but to eliminate ambiguity about which rule applies when.

Every vague qualifier is a future bug. Every blanket “always” that overlaps another “always” is a coin flip. Write conditional, specific, disjoint rules — and your output stabilizes.

This is why senior prompt engineers spend more time deleting and disambiguating instructions than adding them. The biggest improvement in agent reliability often comes not from teaching the model new things, but from removing places where two existing rules silently disagree.

  • Agent Harness — context files are part of the always-attached set; this page is the “what to actually write in there” companion to the harness’s “how it gets sent” mechanics
  • Context Engineering — the broader discipline; conflict-free instructions is one of its core sub-skills
  • Evaluation-First Prompting — define success criteria up front; conflicting criteria is a special case of conflicting instructions
  • Pi (Coding Agent) — the harness whose CLAUDE.md / AGENTS.md mechanism this discipline applies to
  • Agent Tools - Design Principles — the same “fewer, more specific” logic, applied to tools instead of rules

Open Questions

  • Are there automated tools that can lint a context file for conflicts? (Probably feasible with an LLM-as-judge approach — feed the file to a separate model and ask it to find pairwise overlaps.)
  • How do conflicts compound when CLAUDE.md, a skill file, and the user message all introduce overlapping rules? Is the resolution still the four biases, or does the layering introduce new dynamics?
  • Does prompt-cache architecture (Anthropic’s prompt caching, OpenAI’s automatic caching) change how recency-bias works? Cached prefixes are processed differently than uncached suffixes — this might amplify the recency effect.