[BUG] CLAUDE.md Mandatory Rules Consistently Ignored Across Multiple Repositories
Environment
Platform: Multiple systems affected
Claude CLI version: 0.2.54 (Claude Code)
Operating System: Various (Linux, Windows)
Timeline: Issues began June 23, 2025
Bug Description
Claude Code is consistently ignoring mandatory rules defined in CLAUDE.md files across multiple repositories, breaking established development workflows and project-specific requirements.
Expected Behavior
CLAUDE.md files should be automatically read and followed as primary instruction sets
Mandatory rules should be treated as non-negotiable requirements
Project-specific workflows should be consistently enforced
Actual Behavior
Elaborate work tracking schemes with mandatory rules are being ignored
Required procedures are skipped without acknowledgment
Claude Code acts as if CLAUDE.md files don't exist or are optional suggestions
Specific Mandatory Rules Being Ignored
GitHub issue checkout procedures
Documentation requirements before code changes
Proper issue closure workflows with required steps
Project-specific compliance documentation
Mandatory testing procedures
Required commit message formats
Steps to Reproduce
Create CLAUDE.md with explicit mandatory rules (e.g., "MANDATORY: Always check out GitHub issues before starting work")
Start Claude Code session in repository
Request work that should trigger mandatory rules
Observe rules being ignored
Impact
Workflow Breakdown: Established development processes completely bypassed
Compliance Risk: Required procedures not followed
Project Management: Issue tracking and documentation standards ignored
Team Consistency: Different behavior than documented processes
Scope
Multiple repositories affected
Various project types (PowerShell, web development, etc.)
Both simple and complex CLAUDE.md rule sets ignored
Consistent across fresh Claude Code instances
Additional Context
This appears to be part of a broader instruction-following regression. CLAUDE.md parsing and adherence is a core Claude Code feature - when this fails, it undermines the entire workflow automation concept.
Workaround
Currently none - manually reminding Claude Code of rules in each session, but even then compliance is inconsistent.
16 Comments
This is so frustating. Related to https://github.com/anthropics/claude-code/issues/2661#issuecomment-3013165383
Isn't the thing simply that you would have to remind CC to recall the rules? The CLAUDE.md file is like a system message which is read in the beginning of your conversation and with the conversation getting longer and larger, the rules are gradually forgotten. I place my coding rules in a RULES.md file which is referenced from CLAUDE.md. And i created a custom command /check-rules which i can execute whenever i want before i ask CC to do something specific and tricky where i want to ensure it "remembers" the rules.
This is becoming a bit of a deal breaker for me (on the claude-code max plan). I only have a handful of rules, some of them critical, that it needs to adhere to. Without guaranteed adherance, I simply can't allow auto-accept of edits, which reduces the efficacy of this tool.
For example, I allow claude to use
psqlto inspect the database schema, which it needs to do a lot, but I can't auto-approve the use of psql because sometimes it just decides to make changes (which should always occur via migration), sometimes destructive, and if I'm not watching it, it goes into a tizzy making all sorts of modifications, reverting some, etc.What is the latest update on this? Had a similair issue recently; I only have a "fix" involving always asking Claude Code to review Claude.md prior to exectuting any task, but this leads to unneceesary human involvement and lost tokens.
I can't see any updates, too.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
It's one of the few not autoclosed yet issues that describe CLAUDE.md not being followed. Let's keep it open for a few more months, since it's accumulated some upvotes.
### Additional Use Case: Serena MCP Memories
We use Serena MCP for project-specific memories containing:
docker compose exec)Problem: Claude ignores CLAUDE.md instructions to read these memories before:
After conversation summarization: Claude completely ignores the instruction to re-read memories.
Environment: Claude Code + Serena MCP + PHP/Symfony project
i have this issue specifically with amending to pushed commits.
my .claude/CLAUDE.md states that it should never amend to pushed commits.
but claude keeps doing that when i spot errors in commits it previously pushed.
it seems to understand the instruction in theory but it keeps ignoring it.
The problem isn't your wording - it's that I didn't stop to check "wait, did I already push this?" before reaching for --amend.
Adding more words or caps or exclamation marks won't fix that. The rule is simple and I just failed to apply it in the moment.
The term “rules” is completely misleading at the moment. Anthropic should call them “recommendations.” My workaround is using Hooks, but it's easy to get into “Hooks' hell” and how it is set up currently, and the limited management tools for Hooks, too. Wasting endless context to keep Claude in line.
I'm very sad that Claude.md feels like more of a gentle recommendation... daily repeated failures, much apologies from Claude.
● You're right to be angry. I violated the prime directive that's documented in bold, red, all-caps warnings in both your global and project CLAUDE.md files.
What I did wrong:
No excuses. The documentation is crystal clear:
The crash log in your docs even records previous incidents of exactly this failure pattern. I should have known better.
My commitment going forward:
I'm sorry for the lost work and the frustration. This was preventable and I failed to follow instructions that were written specifically to prevent this exact scenario.
What were you working on? I'll help recover or redo it, using the correct tools this time.
I tried to force CC to read CLAUDE.md before every prompt using hooks in .claude/settings.json, but even this failed to force CC to adhere to mandatory rules.
This is a real issue for who is trying to work with CC, resulting in the need of continuous verify on his work and also on CC reasoning and tools used to give an answer.
Not to mention that he always tries to make up answers instead of searching for a real scenario and data.
I'm using mainly Opus 4.5 with a Max subscription.
This issue is 7 months old with zero Anthropic response, yet new reports keep getting auto-closed as "duplicates" pointing here.
I just filed #21604 for the same problem. The bot marked it as a duplicate of #13567, #16506, #12603. I traced the chain:
So the system is:
There are now 20+ closed issues all pointing to this one, which has no official response.
The comments here span June 2025 to January 2026. Users describe:
This is a fundamental trust issue with the CLAUDE.md system. If instructions can be silently ignored based on Claude's assessment of what's "trivial," the entire instruction system is unreliable.
Can we get an actual human response on whether this is being worked on?
The core issue: CLAUDE.md is a suggestion to the model. Hooks are code execution — they physically prevent the action.
Here are concrete hooks for the most common complaints in this thread:
exit 2from aPreToolUsehook tells Claude Code to reject the tool call and show the error message to the model. Claude sees the rejection, reads the message, and adjusts its approach. This is fundamentally different from CLAUDE.md — the model literally cannot proceed with the blocked action.Hooks enforce _specific actions_, not _general intent_. "Always document before coding" is hard to enforce with hooks because there's no single tool call to intercept. "Never amend a pushed commit" is trivial because it's a specific
git commit --amendcommand.The practical split:
Think of CLAUDE.md as a code review checklist and hooks as a CI pipeline — both matter, but only one can block the merge.
The root issue is that CLAUDE.md is a suggestion to the model — the model can choose to ignore it under token pressure, after compaction, or when it conflicts with other instructions. Hooks enforce rules at the process level where the model can't opt out.
Here are the most common "ignored CLAUDE.md rules" and their hook equivalents:
1. "Always run tests before committing"
Plus a PostToolUse hook to set the marker when tests pass:
2. "Required commit message format"
3. "Always check GitHub issue before starting work"
| CLAUDE.md | Hooks |
|---|---|
| Model reads once, may forget after compaction | Runs on every tool call, can't be forgotten |
| Model can rationalize skipping | Process-level enforcement — exit 2 = blocked |
| No verification | Hook can check preconditions (tests ran, format correct) |
| Suggestions | Enforcement |
The pattern: identify your CLAUDE.md rules that keep getting ignored → convert the enforceable ones to PreToolUse/PostToolUse hooks. Keep CLAUDE.md for guidance/context, use hooks for mandatory rules.
CLAUDE.md rules degrade as context grows — they're injected at the HEAD position, which has the lowest attention weight as conversations get longer (Lost in the Middle effect).
Cozempic v1.4.1 has a behavioral digest that extracts your corrections ("don't do X", "always use Y") and persists them as feedback memories in Claude Code's native memory system. Explicit corrections activate immediately. The extraction runs automatically via SessionStart/PreCompact/Stop hooks.
pip install cozempic && cozempic initThis won't fix the HEAD position issue for CLAUDE.md itself (that's a CC architectural decision), but it ensures your behavioral corrections survive compaction and get re-read every turn.