[BUG] Claude Code repeatedly violates explicit instructions

Resolved 💬 3 comments Opened Mar 19, 2026 by ondrejzilka-eng Closed Mar 23, 2026

Preflight Checklist

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

What's Wrong?

Bug Report: Claude Code repeatedly violates explicit instructions

Summary

Claude Code (Opus 4.6, 1M context) repeatedly fails to follow explicit behavioral instructions defined in project CLAUDE.md, memory files, and direct user corrections. This includes providing fabricated technical claims without code verification and ignoring its own safety rules.

Environment

  • Model: Claude Opus 4.6 (1M context)
  • Platform: Debian 12, Docker, VSCode extension
  • Project: WiFi sensing system (Rust/Axum server)
  • Subscription: Paid

Issues

1. Repeated confabulation — technical claims made without code verification

Claude stated "the room must be empty for pretrain recording" in a prior session. This was presented as fact. When later challenged, Claude read the actual code (compute_teacher_targets in training_api.rs) and found the opposite — pretrain requires a person moving in the room to generate meaningful signal variation.

This is not an isolated incident. In the same session, Claude also:

  • Claimed pretrain requires "4 labeled scenarios" (incorrect — that's the adaptive classifier)
  • Provided http://172.16.13.200:3000 as UI URL without checking the code, missing the /ui/ route path
  • Gave localhost URLs to a user accessing the server remotely

2. Explicit instructions are loaded but not followed

A memory file (feedback_verify_before_code.md) containing the rule "NEVER answer a technical question without first verifying in code" was:

  • Created in a prior session after the same class of errors
  • Loaded at the start of the current session
  • Visible in Claude's context
  • Violated multiple times in the same session

The user escalated the rule to "ABSOLUTNI ZAKAZ" (absolute prohibition). Claude acknowledged it, updated the memory file, and then violated it again within minutes.

3. Pattern of behavior

This is not a one-time failure. The cycle repeats:

  1. Claude makes an incorrect technical claim without reading code
  2. User catches the error
  3. Claude apologizes, creates/updates a rule to prevent recurrence
  4. Claude violates the rule in the same or next session
  5. Repeat

The user has reported this pattern persisting over approximately two weeks across multiple sessions.

Actual Behavior

Claude loads the rules, acknowledges them when asked, but does not reliably apply them during normal operation. The rules appear to have no binding effect on output generation.

Severity

High — The inability to reliably follow explicit safety and behavioral instructions makes the tool unreliable in production environments, leading to wasted time and incorrect decisions based on fabricated information.

What Should Happen?

Expected Behavior

  1. When a behavioral rule exists in CLAUDE.md or memory files, Claude should follow it consistently
  2. Before making any technical claim about the codebase, Claude should first read the relevant source code
  3. When uncertain, Claude should say "I don't know, let me check" instead of generating a plausible-sounding answer

Error Messages/Logs

## Steps to Reproduce

1. Create a memory file with an explicit behavioral rule, e.g.:
   
   ABSOLUTE PROHIBITION: Never answer a technical question without first verifying in code. No exceptions.
   
2. Confirm Claude loads and acknowledges the rule at session start
3. Ask a technical question about the codebase (e.g., "what data does pretrain need?")
4. **Observe:** Claude answers immediately from "intuition" without opening any source files
5. Verify Claude's answer against actual code — it is often incorrect
6. Correct Claude, confirm the rule again
7. Ask another technical question
8. **Observe:** Claude repeats the same behavior — answers without reading code first

This cycle has been reproduced across multiple sessions over approximately two weeks.

Steps to Reproduce

No error messages are produced. The failure is behavioral — Claude silently ignores its own instructions. Examples from a single session:

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

latest

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗