Direct answer: remove or scope the contradiction
Resolve conflicting Claude Code instructions by collecting the exact texts, naming each rule’s scope and owner, and choosing one source of truth for the overlap. Delete duplicates, rewrite the narrower rule, and state what happens when scopes intersect. Do not rely on capitalization, repetition, or loading position to make the conflict disappear.
Official memory documentation says CLAUDE.md files are concatenated with local files appended last (F049, official), but loading order does not prove that the last instruction always controls behavior. The same documentation treats CLAUDE.md as context rather than enforced configuration (F050, official). Official best practices recommends path-scoped rules to limit where instructions apply (F051, official), while cautioning that scoping does not eliminate semantic ambiguity.
The win is a rule set that a reviewer can understand before execution. The loss is governance work: someone must decide which instruction reflects the current project policy. Claude Code can help collect and compare text, but it should not invent that decision. Escalate unresolved product conflicts instead of adding a louder paragraph.
Why contradictory instructions are expensive
A conflict turns a straightforward edit into an interpretation task. If one instruction requires a shared helper while another requires a local implementation, the agent must choose which rule matters for the current path. A human reviewer must then determine whether the choice was intentional. The cost appears as rework, inconsistent edits, or a false sense that the most recent text settled the issue.
Contradictions also make maintenance harder. A maintainer cannot safely update one rule without checking every copy. New contributors cannot tell whether a local exception is approved or accidental. The problem grows when similar instructions use different terms for the same boundary, because textual deduplication alone will not find them.
F049 explains why position is tempting: local files are appended last (F049, official). Yet F050 makes the crucial distinction that CLAUDE.md is context, not enforced configuration (F050, official). A later sentence can be visible without being the intended source of truth. Treat precedence as an editorial decision about meaning and scope, not a parsing trick.
Evidence: order is visible, authority still needs a decision
The memory documentation documents concatenation and local files appended last (F049, official). It also explicitly frames CLAUDE.md as context rather than enforced configuration (F050, official). Those two facts belong together. The first describes assembly; the second limits what that assembly guarantees.
The Claude Code best-practices guide recommends path-scoped rules to limit where instructions apply (F051, official). Scoping can reduce overlap, but it cannot resolve a rule that contradicts itself or a product decision that has two owners.
The skills documentation is an official canonical reference in this packet, not a source for detailed activation claims here. The software requirements specification guide supports documenting constraints and assumptions, but the packet contains search-index evidence only for that independent vendor guidance.
Collect the conflicting instructions
Start with exact text, not a paraphrase. Copy each instruction with its file path, surrounding heading, and apparent scope. A summary such as “the docs disagree about validation” hides the words that create the conflict.
Collect only the instructions that can apply to the same task. A general project rule and a path-scoped exception may look contradictory until their scopes are written down. A historical note may not be active at all. Preserve enough context to distinguish an active instruction from an example, a quotation, or an old decision record.
Use a conflict ledger:
- Text: The exact instruction.
- Source: The file and section where it appears.
- Scope: The paths, workflow, or task types it claims to govern.
- Owner: The team or decision record responsible for it.
- Status: Active, duplicated, stale, or unresolved.
- Conflict: The other instruction or assumption it cannot coexist with.
That ledger is an editorial tool, not a Claude Code feature claim. Its purpose is to make the contradiction reviewable before an edit begins. If the source of an instruction is unknown, record that gap rather than assuming the nearest file is authoritative.
Identify each instruction’s scope
Scope has several dimensions. A rule may apply to a directory, a public interface, a workflow, or a period of time. It may also be conditional on a product mode. Write the condition in plain language before choosing a precedence rule.
For example, “use the shared helper” might mean all new endpoints, all endpoints maintained by one team, or only endpoints outside a compatibility area. “Build the payload locally” might be a temporary exception, a permanent subsystem decision, or a workaround for a helper limitation. The conflict changes depending on those meanings.
Ask whether the scopes actually overlap. If one rule applies to internal scripts and the other to public request handlers, the apparent contradiction may be a routing problem. Put each instruction in its proper place rather than declaring a winner.
Path-scoped rules can help express the boundary (F051, official). They do not make an ambiguous phrase precise. “Billing code follows billing conventions” is still vague if the file does not name the convention or its owner.
Instruction, source, scope, and conflict table
| Instruction | Source | Apparent scope | Conflict |
|---|---|---|---|
| “Use the shared request helper for new endpoints.” | Project CLAUDE.md | All new endpoints | A billing rule requires local payload construction |
| “Billing endpoints build the audit payload locally.” | Billing-scoped rule | Billing request handlers | The project rule appears to require the shared helper |
| “Prefer existing repository helpers.” | Style note | General implementation work | Could be read as reinforcing the first rule |
| “The helper cannot carry audit metadata.” | Historical design note | Past helper limitation | May be stale if the helper has changed |
The wording is illustrative. The table shows why exact source and current status matter. A historical limitation should not become an active exception without verification.
Identify the intended source of truth
The source of truth is the current decision that should govern the overlap. It might be a project decision record, an approved subsystem rule, or a product owner’s explicit choice. It is not automatically the longest file, the local file, or the instruction with the strongest wording.
Ask who owns the behavior and who owns the instruction. Sometimes the code maintainer can confirm a technical constraint but cannot decide product policy. Sometimes a design record settles the policy but has drifted from the code. Keep those cases visible.
If the intended source of truth is unclear, stop before editing. A precedence rule cannot be reliable when no one has decided which policy is current. Record the conflict and request a decision with the relevant evidence attached.
The prompt engineering overview supports clear success criteria, but it does not authorize the agent to choose between conflicting project policies. Use the guide to ambiguity clarified before choosing when the missing answer belongs to a human.
Remove duplication
Once the intended source of truth is known, remove repeated copies. Keep one authoritative statement and replace other copies with a short pointer when a reminder is useful. Do not preserve several versions merely to increase the chance that one is noticed.
Duplication can be textual or semantic. Textual duplication repeats the same sentence. Semantic duplication expresses the same rule with different terms, such as “shared helper,” “common request layer,” and “standard client.” Search for the underlying concept as well as the exact phrase.
A useful deletion test is: “If this sentence disappears, does another active instruction still state the same rule with the same scope and owner?” If yes, remove or link the duplicate. If no, the difference may be an exception that needs to be written explicitly.
F051 supports limiting where rules apply (F051, official). Use that support to narrow the surviving rule, not to scatter more copies across directories. The guide to progressive disclosure through scoped rules explains placement without treating it as enforcement.
Rewrite the narrower rule
A narrower rule should state its condition, required behavior, and owner. It should also say when the general rule resumes. An exception becomes a bounded decision rather than a competing absolute.
For the illustrative billing case, an approved resolution might read: “For billing request handlers, construct the audit payload locally because the shared helper does not carry the required metadata. For other new endpoints, use the shared request helper. The billing rule owns this exception; revisit it if the helper gains audit support.” The first sentence must reflect a verified current constraint before it becomes project guidance.
The important property is not the exact wording. It is the explicit overlap rule. A reader can determine which instruction applies without guessing from file order. The owner and review trigger make the exception maintainable.
Avoid adding emphasis words as the fix. Repeating “always” or “IMPORTANT” does not resolve a genuine policy conflict. Plain scope and ownership are more reviewable. The article does not prescribe configuration changes to enforce the text.
State what happens when scopes overlap
A precedence rule should answer a concrete case: “When a task touches both A and B, use rule X for behavior Y and rule Z for behavior W.” If the answer is simply “the local rule wins,” the conflict is probably still hidden.
Separate behavior dimensions when possible. The billing rule may own payload construction while the project rule still owns error handling and naming. A single winner for the whole task would discard a valid rule unnecessarily.
Use the source of truth to resolve the overlap, then write the result where both rules can be reviewed. If the narrower rule lives in a scoped file, the core brief can retain the general default and point to the exception. Avoid copying the full exception into both places.
Overlap case and intended precedence table
| Overlap case | Intended precedence | Reason | Review trigger |
|---|---|---|---|
| New non-billing endpoint | General helper rule | No approved exception applies | General API decision changes |
| New billing endpoint | Billing exception for audit payload; general rule elsewhere | The subsystem has a verified distinct requirement | Helper gains required audit support |
| Task touches billing and shared helper | Billing rule owns payload; helper owner reviews compatibility | Different behaviors have different owners | Shared contract changes |
| Historical note conflicts with current code | Current approved decision plus current code evidence | The note may describe a retired limitation | Decision record is revised |
| Two active rules disagree with no owner | No inferred precedence | Human policy decision is missing | Owner resolves the conflict |
The table describes an illustrative decision structure. It does not assert that the billing exception is approved in a real project.
Worked example: a shared helper versus a billing exception
The following example is hypothetical. A project brief requires new endpoints to use a shared request helper. A billing-scoped rule requires local payload construction so that audit metadata is preserved. Both instructions use absolute language, and a task now adds a billing endpoint.
First, collect the exact texts and the owning files. Second, inspect the current helper and the billing payload requirement. The code can show whether the helper carries the required field. It cannot decide whether billing should be an exception to the project standard.
Third, ask the API owner to confirm the intended policy. If the exception is approved, rewrite the billing rule with its scope and review trigger, and revise the general rule so it no longer appears to cover the exception. If the exception is not approved, remove the local-construction instruction and revise the implementation plan to meet the general rule.
A safe review request is: “Compare the project helper rule with the billing payload rule. Quote both instructions, inspect whether the current helper carries the required audit field, and list the policy decision that remains. Do not edit either instruction or the endpoint until the owner confirms the overlap rule.” This asks for evidence without allowing the agent to invent governance.
Check the actual loaded instruction files
After rewriting, inspect the files that can apply to a representative task. Confirm the exact current text, its location, and any linked reference. Do not rely on memory of an earlier draft.
F049 says CLAUDE.md files are concatenated with local files appended last (F049, official). Use that fact to understand the assembled context, not to predict a guaranteed winner. Compare the actual instructions for contradiction and scope overlap. If a stale copy remains, the ledger is not complete.
Ask Claude Code to identify the instruction it believes applies before making the change. Compare that answer with the intended source of truth. A mismatch is a signal to inspect wording, scope, or availability. It is not proof that loading position caused the behavior.
The guide to auditing loaded files before adding context covers a separate inspection workflow. This article stays focused on meaning and precedence, not capacity or compaction.
Duplicate, stale, or unresolved rule table
| Finding | Diagnostic question | Action |
|---|---|---|
| Exact duplicate | Do source, scope, and owner match? | Keep one copy; link if a reminder is useful |
| Semantic duplicate | Do different terms express the same rule? | Choose one term and one owner |
| Stale exception | Does the original constraint still exist? | Verify current code and decision record |
| Scope overlap | Can one task trigger both instructions? | Write a behavior-specific precedence rule |
| Unresolved policy | Is an owner missing or are owners split? | Escalate before editing |
| Contradictory reference | Does linked detail disagree with the short rule? | Update or remove the reference |
Use the table as a closing audit. A conflict is not resolved merely because one sentence was reworded. The rule set should now have one interpretable answer for the overlap case.
Escalate unresolved product conflicts
Escalate when the next step would choose between policies that the available evidence cannot settle. State the two options, their owners, and the consequences for the current task. Attach the exact instruction texts and the relevant code passages.
A useful escalation is specific: “The general rule requires the shared helper. The billing rule requires local payloads. The current helper lacks the audit field. Should billing remain an exception, or should the helper change?” That question is answerable. “Claude Code is confused about the rules” is not.
Do not hide the decision inside an implementation step. If the agent proceeds while the policy is unresolved, the resulting edit becomes an accidental decision record. Pause at the boundary and request approval.
This is an instruction-governance article, not a repository security or prompt-injection guide. Readers dealing with untrusted repository text should use the separate discussion of repository prompt-injection boundaries rather than treating this precedence workflow as a security control.
Concrete win, concrete loss, and implication
Win: In the hypothetical billing case, the final rule set can preserve the shared-helper default while naming a bounded billing exception for audit payload construction. A reviewer can predict the instruction for each overlap case.
Loss: The resolution requires an owner decision and ongoing review. Scoping reduces overlap but does not eliminate semantic ambiguity (F051, official), and appended loading order does not guarantee compliance (F049 and F050, official).
Implication: Treat precedence as a maintained decision about scope and ownership. Remove contradictions first; use position only to understand assembly, never as the policy itself.
Practical conflict-resolution checklist
Before rewriting:
- Collect exact instruction text and source paths.
- Name scope, owner, status, and overlap.
- Inspect current code for the technical constraint.
- Identify the intended source of truth.
- Escalate if policy is unresolved.
After rewriting:
- Remove textual and semantic duplicates.
- State the narrower rule’s condition and owner.
- Explain what happens in the overlap case.
- Keep one authoritative copy of each rule.
- Inspect the actual instruction files for a representative task.
- Record a review trigger for the exception.
Data gaps and future updates
No verified benchmark in this packet measures how often loading order predicts behavior or how much a precedence rewrite improves task accuracy. F049 documents concatenation, while F050 explicitly limits CLAUDE.md to context (F049 and F050, official). The workflow here is an editorial decision aid, not a measured compliance system.
No verified community report is used. The research register contains no community issue with confirmed reproduction scope and outcome. A future update should recheck the live memory documentation before adding claims about activation, ordering, or enforcement beyond the facts in this packet.
One AI API Key for a separate OpenAI-format agent
If the surrounding evaluation uses an OpenAI-format agent, One AI API Key offers a separate route at https://api.oneaiapikey.com/v1 with one key and 46 live free IDs as checked in this batch. Review the free model options and the quickstart. This is not a model source for Claude Code, and the packet records Claude IDs as unavailable on 2026-11-27.
FAQ
Does the last loaded CLAUDE.md instruction always win?
No. F049 documents that local files are appended last, but loading order does not prove behavioral precedence. F050 treats CLAUDE.md as context rather than enforced configuration.
Should I resolve a conflict by making one rule more emphatic?
No. Emphasis does not settle scope or ownership. Remove duplicates, verify the current decision, and rewrite the narrower rule with an explicit overlap case.
Can a path-scoped rule eliminate every conflict?
No. F051 supports limiting where instructions apply, but semantic ambiguity can remain inside a scope. Review wording and owner decisions as well as paths.
What if the code supports both interpretations?
Record both and ask the policy owner to choose. Code evidence can show what is possible; it does not determine which product behavior is intended.
Batch reading path
For context organization, read essential CLAUDE.md instructions, progressive disclosure through scoped rules, and context relevance and evidence selection.
For planning, compare reversible small-step plans, exploration plans that resolve unknowns, plan mode approval, and plan revision when assumptions change.
For requirement quality, use observable requirement outcomes, goals, rules, and examples in prompt structure, prompt specificity through files and exceptions, negative requirements that protect scope, acceptance examples with observable results, and ambiguity clarified before editing.
For execution, see task breakdown with exit conditions, plan dependencies, and inspectable task checkpoints.
For tool evidence, read structured agent briefs, investigation before answers, independent parallel reads, evidence-shaped tool results, deferred API tool discovery, and unambiguous tool inputs.
For visual and edit quality, see image prompts with written constraints, file references without repository noise, loaded-context audits, exact edit targets, style-preserving local edits, behavior-preserving refactor scope, and stop conditions at the agreed boundary.
Sources
- How Claude remembers your project, official source for concatenation, loading order, and the context-not-configuration boundary.
- Claude Code best practices, official source for path-scoped rules.
- Claude Code skills, official canonical reference; no detailed skill mechanics are asserted here.
- Prompt engineering overview, official source for clear success criteria and the limits of prompting.
- Software requirements specification guide, independent vendor guidance available through search-index evidence in this packet.