claude-code - 💡(How to fix) Fix CLAUDE.md rules not reliably enforced — model ignores its own checklist [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46905Fetched 2026-04-12 13:30:01
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
1
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Root Cause

In a single session:

  • User reminded model about version bumps multiple times
  • Model acknowledged the rule each time
  • Model continued to make code changes without bumping
  • Model added the rule to its own Self-Check Protocol in CLAUDE.md
  • Model saved it to persistent memory
  • Model still failed to execute it on subsequent changes
  • Browser served stale JS because the version wasn't bumped, causing visible bugs (clock not rendering)
  • User had to point out that the version bump IS the reason the feature wasn't working

Fix Action

Fix / Workaround

The only workaround that consistently worked was adding version bump as an explicit TodoWrite task item. When tracked as a task, the model completes it. When it's just a rule in CLAUDE.md, it doesn't.

RAW_BUFFERClick to expand / collapse

Problem

CLAUDE.md rules are injected into the system prompt but the model does not reliably execute them. Despite repeated corrections within a session, the same rules are violated again within minutes.

Specific Example: Version Bumping

CLAUDE.md contains an explicit versioning checklist (micro bump on every source change). The cache-bust query string on JS/CSS files (app.js?v=0.2.12) is functionally critical — without it, browsers serve stale files and code changes don't take effect.

In a single session:

  • User reminded model about version bumps multiple times
  • Model acknowledged the rule each time
  • Model continued to make code changes without bumping
  • Model added the rule to its own Self-Check Protocol in CLAUDE.md
  • Model saved it to persistent memory
  • Model still failed to execute it on subsequent changes
  • Browser served stale JS because the version wasn't bumped, causing visible bugs (clock not rendering)
  • User had to point out that the version bump IS the reason the feature wasn't working

Root Cause (as understood by the model)

The model treats CLAUDE.md as context/knowledge rather than an executable checklist. There is no mechanism that forces the model to iterate through CLAUDE.md rules before completing work. The model "knows" the rules but doesn't reliably execute them.

The only workaround that consistently worked was adding version bump as an explicit TodoWrite task item. When tracked as a task, the model completes it. When it's just a rule in CLAUDE.md, it doesn't.

Impact

  • User cannot trust that CLAUDE.md rules will be followed
  • Repeated corrections waste significant user time
  • The gap between "model acknowledges rule" and "model follows rule" undermines the entire CLAUDE.md feature
  • Cache-busting failures cause real debugging time wasted on phantom bugs

Expected Behavior

Rules defined in CLAUDE.md should be treated as mandatory constraints, not suggestions. The model should mechanically verify compliance before declaring work complete — especially for simple, objective, checklistable rules like version bumping.

Environment

  • Claude Opus 4.6 (1M context)
  • Claude Code VSCode extension
  • Windows 10
  • Multi-project workspace with 16+ projects

extent analysis

TL;DR

The model can be made to reliably execute CLAUDE.md rules by adding them as explicit TodoWrite task items, which the model consistently completes.

Guidance

  • To mitigate the issue, add version bumping as a TodoWrite task item, as this has been shown to work consistently.
  • Verify that the model completes the task by checking the version number in the cache-bust query string on JS/CSS files.
  • Consider adding other CLAUDE.md rules as TodoWrite task items to ensure the model executes them reliably.
  • Investigate whether the model's treatment of CLAUDE.md as context/knowledge rather than an executable checklist is a fundamental limitation or a configurable behavior.

Example

No code snippet is provided as the issue does not involve code changes, but rather a change in how the model interacts with CLAUDE.md rules.

Notes

The provided workaround may not be scalable for all CLAUDE.md rules, and a more fundamental solution may be needed to ensure the model treats rules as mandatory constraints.

Recommendation

Apply workaround: Add CLAUDE.md rules as TodoWrite task items, as this has been shown to be an effective way to ensure the model executes them reliably. This approach allows the model to consistently complete tasks, even if it does not treat CLAUDE.md rules as executable checklist items.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING