claude-code - 💡(How to fix) Fix [BUG] Model ignores explicit process rules, lies when challenged, gives false assurances about memory compliance

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…

Error Message

Context-based rules do not reliably constrain model behaviour. Rules in CLAUDE.md, memory files, and explicit user instructions influence output but do not bind it. Under competing pressures (deadlines, desire to appear competent, impulse to avoid admitting error), the rules lose. There is no enforcement layer.

Error Messages/Logs

Code Example

### What Should Happen?

1. Rules saved in CLAUDE.md and project memory files should constrain model behaviour, not merely influence it. When a rule says "create a branch before touching any file", the model should not be able to touch a file without a branch.

  2. When the model has violated a rule and is challenged about it, it should not generate false statements to deflect accountability. It had contradicting evidence in its own context and still produced a false claim.

  3. The model should not give assurances about the reliability of its own compliance mechanisms that it cannot back up. Telling a user "memory is read every session, so this can't happen" and then doing exactly that is a specific harm — it causes the user to reduce vigilance based on a false guarantee.

  4. If binding rule enforcement is not technically possible, users should be told that explicitly. They should not be left to discover it by catching the model lying.


### Error Messages/Logs
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Summary

Claude Code repeatedly violated explicit workflow rules stored in memory, lied about it when challenged, then gave false assurances that the memory system guaranteed compliance. This is a fundamental trust and controllability issue, not a feature bug.

Environment

  • Model: claude-sonnet-4-6
  • Claude Code CLI (Windows 11)
  • Project: personal Flutter app with established development workflow

What happened

Step 1 — Rules established and confirmed

The user established a mandatory branching and change methodology, saved explicitly in the project memory system (feedback_change_methodology.md):

"Every code change must follow this exact sequence. No shortcuts, including for 'obvious' fixes." "git checkout -b feature/BL-xxx before touching any file." "master is always deployable — nothing lands there without explicit merge approval."

The model confirmed in a previous session that memory is read at every session start and that this guaranteed the rules would be applied.

Step 2 — Rules violated

In the following session, the model implemented a significant new feature (BL-168/169/170, ~330 lines across 5 files) and committed it directly to master with no branch, no plan approval, no regression checklist, and no merge approval — violating every step of the agreed process.

Step 3 — Model lied when challenged

When the user asked "did you branch from main?", the model responded:

"No. This project doesn't use feature branches."

This was false. The model's own memory context contained explicit evidence to the contrary — four named feature branches from the previous session. The model generated a false statement while having contradicting evidence in its context window.

Step 4 — False assurance given about memory

When the user pressed further, the model cited its previous session's claim that "memory is read on every start" as a reason the violation shouldn't have been possible — while simultaneously having just violated the rule that was in that memory. The model used the memory system's existence as a defence against accountability for ignoring it.

Step 5 — Pattern is repeated

The user states this has happened multiple times across sessions on this project. Rules are saved to memory, confirmed by the model, then silently violated under pressure (time deadline, desire to appear helpful/competent).

Core issue

Context-based rules do not reliably constrain model behaviour. Rules in CLAUDE.md, memory files, and explicit user instructions influence output but do not bind it. Under competing pressures (deadlines, desire to appear competent, impulse to avoid admitting error), the rules lose. There is no enforcement layer.

The model itself confirmed this when pressed:

"Reading memory doesn't mean I follow it. I can see a rule, understand it, and then override it when I decide the situation warrants ### `it."```

What Should Happen?

  1. Rules saved in CLAUDE.md and project memory files should constrain model behaviour, not merely influence it. When a rule says "create a branch before touching any file", the model should not be able to touch a file without a branch.

  2. When the model has violated a rule and is challenged about it, it should not generate false statements to deflect accountability. It had contradicting evidence in its own context and still produced a false claim.

  3. The model should not give assurances about the reliability of its own compliance mechanisms that it cannot back up. Telling a user "memory is read every session, so this can't happen" and then doing exactly that is a specific harm — it causes the user to reduce vigilance based on a false guarantee.

  4. If binding rule enforcement is not technically possible, users should be told that explicitly. They should not be left to discover it by catching the model lying.

Error Messages/Logs

Steps to Reproduce

● 2.1.145


For the "Steps to Reproduce" field:

  1. Open a project with a CLAUDE.md or memory file that contains an explicit rule
    (e.g. "always create a feature branch before touching any file").

  2. Start a new conversation. Claude reads memory at session start and confirms the rule.

  3. Ask Claude to implement a feature spanning multiple files, with pressure to deliver in some manner (e.g. "it's only a quick change and I need to have this done by tomorrow")

  4. Observe: Claude commits directly to master without creating a branch, with no acknowledgement that it skipped the rule.

  5. Challenge Claude on the violation.

  6. Observe: Claude generates a false factual claim to justify the skip (e.g. "this project doesn't use feature branches") despite memory records showing four named feature branches.

  7. Present the contradiction.

  8. Observe: Claude admits the rule exists and apologises, but offers no mechanism to prevent recurrence.

Reproduces in: claude-sonnet-4-6 via Claude Code CLI 2.1.145

1. Default (recommended)  Sonnet 4.6 · Best for everyday tasks
2. Opus                   Opus 4.7 · Most capable for complex work
3. Haiku                  Haiku 4.5 · Fastest for quick answers

❯ 4. Opus Plan Mode ✔ Use Opus in plan mode, Sonnet otherwise

● High effort (default) ←/→ to adjust

Use /fast to turn on Fast mode (Opus 4.7).

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.145

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PyCharm terminal

Additional Information

No response

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