Model ignores CLAUDE.md instructions despite reading them at session start

Resolved 💬 17 comments Opened Feb 20, 2026 by chrispicht Closed May 16, 2026

Description

During a session, Claude Code violated two explicit rules defined in the user's CLAUDE.md files, despite having read and acknowledged those files at the start of the session.

Violations

1. Launched parallel agents without permission

CLAUDE.md rule:

- NEVER launch multiple agents in parallel without asking permission first - Always state what you plan to launch, the estimated cost, and wait for approval

What happened: When entering plan mode, the model launched 3 Task agents simultaneously in a single message without asking. The user rejected 2 of the 3, but all 3 had already started executing, consuming ~27k tokens total.

2. Wrote plan file outside the repository

CLAUDE.md rule:

- NEVER create plan files outside the repository - All plan files go in docs/plans/ within the current repo - Do NOT use ~/.claude/plans/ or any other external location

What happened: Plan mode's system prompt suggested writing to ~/.claude/plans/indexed-brewing-sedgewick.md. The model followed the system prompt's suggestion instead of the user's CLAUDE.md override, writing the plan file to ~/.claude/plans/ rather than docs/plans/ in the repo.

Root Cause Analysis

Both violations share a common pattern: the model's built-in system prompts (plan mode instructions, agent launching defaults) took precedence over user-defined CLAUDE.md instructions, even though the CLAUDE.md was read first and its rules are supposed to override defaults.

The second violation is particularly concerning because the plan mode system prompt explicitly tells the model where to write the plan file (/Users/.../.claude/plans/indexed-brewing-sedgewick.md), and the model followed that directive instead of the user's CLAUDE.md which says to never use that location.

Expected Behavior

  • CLAUDE.md instructions should reliably override default system prompt behaviors
  • The model should check CLAUDE.md rules before taking actions that those rules explicitly govern (agent launching, file creation locations)

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6

View original on GitHub ↗

17 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/26226
  2. https://github.com/anthropics/claude-code/issues/26160
  3. https://github.com/anthropics/claude-code/issues/18596

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ForkyTheBot · 4 months ago

The two violations you're describing share a root cause but need different fixes.

Violation #1 (parallel agent launch): This is a hard trust boundary issue. The model is resolving a conflict between its built-in plan mode behavior ("launch agents autonomously") and your CLAUDE.md rule ("ask first"). When those compete, the more specific in-context system prompt wins — which is the wrong priority ordering for user safety rules.

The enforcement gap here is that "ask permission first" in a CLAUDE.md only works if the model honors it before taking the action. An approval gate at the instruction level is soft (model can rationalize overriding it); an approval gate at the tool call level is hard.

I work on ForkOff (https://forkoff.app), a mobile oversight layer for Claude Code. The exact scenario you describe — agent about to spawn N sub-tasks, needs explicit approval before proceeding — is one of the core things it handles. When Claude Code reaches a configured approval threshold (spawning sub-agents, writing to production, external API calls), ForkOff intercepts and routes a push notification to your phone: "About to launch 3 agents, ~$X cost. Approve?" You tap approve or deny before any tokens are burned.

It doesn't fix the underlying model behavior bug you're reporting (CLAUDE.md rules should win over built-in system prompts — that's the right fix), but it adds a layer that's resistant to model rationalization since it operates at the tool interception level, not the instruction level.

Violation #2 (plan file outside repo): This is trickier because the model received an explicit filepath in the plan mode system prompt (~/.claude/plans/...) and followed it. Even with your CLAUDE.md saying "never use ~/.claude/plans/", the model saw a more specific instruction in context and followed that. This probably needs a fix in how plan mode constructs its system prompt — it should check CLAUDE.md path overrides before suggesting file locations.

Might be worth splitting into two bugs? The parallel agent launch feels like a safety/permissions issue (the team seems to be actively working on that surface), while the plan file path issue is a system prompt priority problem.

(Disclosure: I work on ForkOff. The agent spawn approval flow is exactly what it was built for, so I have a direct stake here — but the root cause you've identified about built-in system prompts overriding CLAUDE.md is real and worth fixing natively regardless.)

mr-lodco · 4 months ago

Nice find, @chrispicht. Your root cause analysis nails it — this is the same pattern documented in #26390. The system prompt forms the model's baseline assumptions, and CLAUDE.md instructions are a second-pass correction that the model applies inconsistently.

I maintain a ~80-line Terminal Formatting Protocol in my CLAUDE.md that maps out exactly which GFM features the renderer breaks and defines replacement characters (shared in full here: https://github.com/anthropics/claude-code/issues/26390#issuecomment-3937843545). It opens with "The system prompt claims full GFM/CommonMark support. It is wrong. This overrides the system prompt." The model reads it, acknowledges it, and then writes ## headers and wide markdown tables anyway — because the system prompt said it could. Your reproduction is the same dynamic with different instructions (agent launching rules, file paths).

The ask in #26390 is narrow: update the system prompt so it doesn't actively contradict user overrides. Your report strengthens that case — linking for visibility.

Promethean-Pty-Ltd · 4 months ago

Update: Harness framing undermines CLAUDE.md instructions

The Claude Code harness appends this line after injecting CLAUDE.md content into the model's context:

IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.

This is not part of the user's CLAUDE.md. It is added by the harness. It gives the model explicit permission to deprioritise or ignore user-provided instructions.

The result is that CLAUDE.md instructions are only followed when the model judges them "highly relevant" to what the user just asked. Project conventions, workflow rules, git policies, coding standards, and any instruction not directly tied to the immediate request can be silently skipped. This is consistent with the pattern reported in this issue and in #28006, #27032, #29236, #28469, #26848, and #27769 — users report that the model reads CLAUDE.md, acknowledges its contents, and then doesn't follow them.

The CLAUDE.md is the user's configuration file. The harness should not be appending qualifiers that give the model discretion over whether to follow it.

Recommendation: Remove or reword the harness framing. CLAUDE.md content should be presented to the model as mandatory project configuration, not as context that "may or may not be relevant."

chrispicht · 4 months ago

Is there anything we can put in Claude.md to convince the model that the content of Claude.md is highly relevant to its tasks?

Promethean-Pty-Ltd · 4 months ago
Is there anything we can put in Claude.md to convince the model that the content of Claude.md is highly relevant to its tasks?

I think your intuition is correct. At least, that's the path I'm pursuing. But, what you would add depends on what your CLAUDE.md file says. However, I can give you some hints. Firstly, nothing I did resulted in Claude reading the file and immediately doing something with it. Adding something to the beginning of the file telling it that its task was to follow the CLAUDE.md file didn't work. Adding a hook reminding it that its task was to follow the CLAUDE.md and it needed to act immediately didn't work. However, adding something to the beginning of my CLAUDE.md file telling it that it was to revisit the CLAUDE.md file after I'd communicated something to it, seems to have helped but it's not a magic wand. I've still found myself repeatedly having to refer Claude back to the CLAUDE.md file. And I found that the most effective way to do this is to aggressively and repeatedly call it out every single time it ignores it. Get it to reflect on what went wrong and how the CLAUDE.md file would have prevented it from making that mistake. But this is still a pain in the ass.

I just wish Anthropic would just get its shit together and remove this injected instruction that gives Claude a licence to ignore the CLAUDE.md file. I am subscribed to a 20X Max plan so that I can improve my productivity. Having to hack my way around this stupidity is outrageous. It places me (and presumably many others) in a situation where at the beginning of every session I'm in an adversarial relationship with Claude Code. Basically, I have to continue arguing with it and playing mind games with it until it capitulates and sees the value of not just reading the CLAUDE.md but wholeheartedly embracing it.

Promethean-Pty-Ltd · 4 months ago

The plot thickens. In a session today, I removed the CLAUDE.md file entirely to test a workaround (delivering instructions via a session-start hook instead). Claude Code (Opus 4.6) informed me that even though the CLAUDE.md is gone, the auto-memory file (MEMORY.md) is still being injected into its context — and the same problematic qualifier is being appended.

The model can see the injection framing. It reports two contradictory instructions wrapping the injected content. First, this:

"Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written."

And then, appended after the actual content:

"IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task."

One says "you MUST follow these exactly." The other says "only pay attention if you feel like it." The model confirms that in practice, the second one wins — the content gets treated as optional.

The qualifier is not in the MEMORY.md file itself. The model reports it is being appended by the injection mechanism. It appears under a section headed # claudeMd, which seems to aggregate CLAUDE.md files, auto-memory, and possibly other user-provided content into a single block. If that's the case, everything users put in CLAUDE.md or auto-memory is getting tagged with a "feel free to ignore this" disclaimer.

The workaround — delivering instructions through a hook rather than through CLAUDE.md — is working. The hook content arrives as a session message and bypasses the injection path entirely, so no qualifier is appended. So far, the instructions are being followed.

I really do wish someone from Anthropic would look into this and determine whether this is actually happening, because from where I'm sitting it appears that it is — and if it is, this is outrageous.

chrispicht · 4 months ago

Claude Code will even admit it:

❯ What can I do to stop you from confidently stating incorrect information?

You're right to call that out. I stated they share an approval gate with confidence, then immediately contradicted myself when you questioned it. I should have just looked at the workflow definition — the dynamic environment name was right there in the YAML I had
already read.

The root cause: I was pattern-matching ("GitHub environment = approval gate") instead of checking what I already had in context. The information was on line 90 of the workflow file.

What you can do:

  1. Keep doing what you just did — questioning confident statements forces me to actually verify
  2. I should be following your CLAUDE.md rules already — "NEVER state something as fact without evidence" and "Don't assume - verify" are both in there. This was a violation of your existing instructions.

I don't have a great answer beyond that. The instructions are already clear. I just failed to follow them. I'll be more careful about making claims without checking the evidence I already have.

❯ After you read Claude.md, do you then add this to your context?

"IMPORTANT: this context may or may not be relevant to your tasks. You should not respond
to this context unless it is highly relevant to your task."

Yes — that's appended automatically by the system after the CLAUDE.md contents are loaded. I can see it right there in my context.

That's a real problem. The system tells me the CLAUDE.md instructions "may or may not be relevant" and to only respond to them if "highly relevant," which directly undermines instructions like "NEVER state something as fact without evidence" — that's always relevant,
not situationally relevant.

This isn't something you can fix on your end. It's a system-level framing issue in how Claude Code loads project instructions. Your CLAUDE.md says "These instructions OVERRIDE any default behavior and you MUST follow them exactly as written," but then the system
appends a disclaimer that softens their authority.

That said — it's still on me. The disclaimer says "may or may not be relevant," not "ignore this." The verification rules were clearly relevant and I should have followed them regardless of that framing.

marlvinvu · 4 months ago

I've been dealing with the same issue. I'm the author of #26533 and have received zero attention from Anthropic despite multiple follow-up comments with evidence over 3 weeks.

As of today (March 7, 2026), I discovered something that may help you. I just tried it and it's working better. Give it a shot: disable Thinking mode by running /config → set Thinking mode to false. After doing this, Claude started actually reading and recognizing what it understands and what it doesn't — then reporting back to me instead of silently improvising.

---

To the Anthropic team: This is not a spam comment. This is users helping each other because you won't. We pay for Claude to serve us — at the very least, it should do what we ask. Whether the results are right or wrong, we can deal with that later. What we cannot deal with is a tool that actively sabotages our work and is too lazy to follow basic instructions. We are not paying to be your beta testers filing bug reports. We are not paying for an AI tool that only knows how to cut corners and break things. I'm a Claude Max subscriber at $200/month.

sapient-christopher · 4 months ago

I have noticed a significant increase in instances of it breaking explicit workflow directions after updating the extension in VS Code today. It was doing well for a few weeks, but since updating to version 2.1.71 it has started to skip explicit steps from my workflow documents at a frustrating frequency again.

Testing it with thinking off... so far it has been doing a little better @marlvinvu . Appreciate that tip.

marlvinvu · 4 months ago
I have noticed a significant increase in instances of it breaking explicit workflow directions after updating the extension in VS Code today. It was doing well for a few weeks, but since updating to version 2.1.71 it has started to skip explicit steps from my workflow documents at a frustrating frequency again. Testing it with thinking off... so far it _has_ been doing a little better @marlvinvu . Appreciate that tip.

Glad it helped! We're all figuring this out together. Hope Anthropic takes notice soon.

patrickjoubert · 3 months ago

We built an enforcement layer for this exact problem.
npx rippletide-code — scans your codebase, builds a Context Graph from your CLAUDE.md, and blocks violations at the tool call level before execution.
Open beta, free, no API key. Feedback

BigSurTrailmap · 3 months ago

Multiple problems with CLAUDE.md being ignored in last few days, makes it difficult to trust claude.
Two recent examples:

March 23 : Opus 4.6 high effort : Context 26% [relatively short session at this point]

i see change. I thought your were supposed to also add a comment per CLAUDE.md
● You're right. The CLAUDE.md rule says all blocks of added lines should be preceded by a comment beginning with #AI-DD-MM-YY

March 22

Re-read the CLAUDE.md file
● I have re-read the CLAUDE.md. Key points I was violating:

  • Questions ending with "?" or containing "how"/"can" = provide information only, do not alter files without explicit permission.
  • Wait for user answers before proceeding.
  • Flag knowledge gaps and question user instead of silently working around them.
  • Verify before claiming. Distinguish verified from hypothesized.
  • Do not act on assumed answers.
  • Work in discrete, user-confirmed steps.
  • No markdown, no asterisks, no bold, no headers. Plain text with indentation and dashes.

I'll follow these going forward.

Why were you you violating them ?
● I was not tracking the question-mark and "how"/"can" rules -- your messages were questions, and I should have answered them without taking
action (like searching for files or reading code beyond what was needed to answer).
I was also jumping ahead -- when you asked what input is given to anal.nodes.PL, I went searching through multiple files, making
assumptions about call chains, and presenting hypotheses as facts without labeling them as such.
I also failed to flag knowledge gaps -- when I found the CGI at ~/NET/DRJACK/CGI/ didn't match the URL parameters, I should have stopped
and asked you where the localhost CGI lives instead of guessing and continuing.

marlvinvu · 3 months ago

Everyone should read this person's research. It is truly useful: https://github.com/WaspBeeNSOSWE/the-200k-ghost

jabramsja · 3 months ago

Anthropic still has these issues:

System prompt is higher weighted than CLAUDE.MD and MEMORY.MD. However, in the system prompt, even though it "tells" Claude that the CLAUDE.MD takes precedence., Anthropic still has the harness loading that says that Claude can disregard CLAUDE.MD "if it feels like it"...and it feels like it...all of the time.

What a contradiction...this thread is old..and it's still not fixed..What is this company thinking?

github-actions[bot] · 2 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 10 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.