October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Find and Fix Claude Code Instruction Conflicts Across Files

Claude Code may load instructions from ancestor and nested files, imports, user rules, and project settings. Find the active sources first, then resolve contradictions where they originate.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Claude Code seems to ignore a project rule, first check what the session actually loaded: run /context and inspect the Memory files list. Then trace applicable instruction files and imports, check whether AGENTS.md is enabled, and reconcile contradictory guidance at its source. File order does not reliably settle a conflict.

How to see which instruction files Claude Code loaded

  1. In the affected Claude Code session, run /context.
  2. Find the Memory files list and note the paths shown.
  3. Check that the session started from the working directory you expected. The current directory affects which instruction files apply.

If a file is absent from the list, first investigate discovery conditions and project-instruction settings rather than rewriting the file’s contents. A file Claude Code did not load cannot guide that session as project memory. Anthropic’s Claude Code Memory documentation describes the loading behavior.

As an Amazon Associate I earn from qualifying purchases.

Which files to check—and when they apply

Source Scope or loading behavior What to inspect
Ancestor CLAUDE.md and CLAUDE.local.md Loaded at startup, from filesystem root toward the working directory. Check each parent directory through the working directory. In the same directory, CLAUDE.local.md is appended after CLAUDE.md.
Nested instruction files Loaded when Claude works in the matching subtree. Check the directories containing the files Claude is editing and their applicable nested instructions.
.claude/rules/ project rules Project-level guidance; some rules may be path-scoped. Review relevant rule files, including any excluded by monorepo claudeMdExcludes configuration.
~/.claude/rules/ user rules Personal guidance across projects; user rules load before project rules. Look for rules that conflict with the project’s shared requirements. Earlier loading does not make them an override.
@path imports Expanded with the referring CLAUDE.md at startup; imports may recurse up to four hops. Follow every reference. Relative paths resolve from the file containing the import; external imports may require approval.
AGENTS.md Loaded under conditions described below; behavior depends on project settings and Claude Code version. Check whether another applicable CLAUDE file or the Project instructions setting prevents it from loading.

Record each applicable instruction’s source path, the behavior it governs, whether it is current, and any incompatible direction elsewhere. Keep team-shared requirements in project guidance and individual preferences in user rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why Claude Code may ignore AGENTS.md

In the default setup, Claude Code reads AGENTS.md when there is no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md in the working directory or an ancestor. If one of those CLAUDE files exists, AGENTS.md is not read by default.

  1. Run claude --version. Direct AGENTS.md support requires Claude Code v2.1.277 or later; the documentation describes session cases where it may be unavailable before v2.1.281.
  2. Open /config and inspect the Project instructions setting. If you expect both formats, choose claude-md-and-agents-md, not claude-md or managed-only.
  3. Alternatively, import AGENTS.md from CLAUDE.md. Anthropic recommends this route when direct loading may be unavailable in a session.

How to audit and resolve conflicting instructions

Compare the directions, not their file order

Ancestor files are ordered from filesystem root toward the working directory, and a same-directory CLAUDE.local.md follows CLAUDE.md. But order is not a dependable conflict-resolution rule. Anthropic warns that when instructions conflict, Claude may follow either arbitrarily. A later instruction is not a guaranteed override.

Follow every import

An import uses syntax such as @path/to/file. Relative paths resolve from the importing file, not simply from the shell’s working directory. Imports can recursively bring in files up to four hops; references outside the project may prompt for approval. Import parsing excludes code spans and fenced code blocks. Adding imports organizes guidance but does not reduce context use.

Reconcile the source files

  • Remove guidance that is stale, obsolete, or no longer applicable.
  • Combine compatible requirements and rewrite remaining rules as specific, actionable instructions.
  • Separate shared project requirements from personal preferences so the change goes in the intended file.
  • For guidance needed only on matching files, use path-scoped rules rather than loading it everywhere.

For controls that must be technically enforced, use managed settings; CLAUDE.md files express behavioral guidance rather than enforced policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the prompt audit if your version supports it

Claude Code v2.1.283 or later documents the /doctor prompt-audit command. Run it to identify stale or contradictory material, including instructions that reference nonexistent files or commands. Its default scope includes CLAUDE.md, CLAUDE.local.md, AGENTS.md and rules, as well as skills, commands, subagents, and output styles under .claude/ and ~/.claude/. Pass a file or directory to narrow the audit.

The audit reports findings and proposes edits; it does not change files until you ask it to apply them. Review suggested changes against the actual project requirements before accepting them.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the instruction set maintainable

  • Anthropic recommends keeping each CLAUDE.md under 200 lines; longer files consume more context and may reduce adherence.
  • Files over 4 MiB are skipped.
  • Imports can split long guidance into organized files, but they do not reduce context use.
  • When unexpected guidance appears, inspect monorepo exclusions, imported files, and nested rules—not just the top-level file.

These command names, settings, and version thresholds are product-documentation details that may change. Confirm current behavior in Anthropic’s Claude Code Memory documentation when troubleshooting a newer release.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.