Model ignores loaded CLAUDE.md instructions: skips mandatory research before infrastructure actions

Open 💬 2 comments Opened Jul 1, 2026 by nvst18

Summary

Opus 4.6 in Claude Code consistently ignores its own loaded CLAUDE.md instructions that mandate reading/researching before taking infrastructure actions. The instructions are loaded at session start, acknowledged by the model, and then violated on the first real task.

CLAUDE.md instructions (loaded and active during violations)

Line 5: "Before ANY action involving SSH, deploy, git push, server access, branch names, user identity, or infrastructure: run grep and READ matching files BEFORE acting."

Line 27: "If you lack the file content, tool output, or verifiable fact, say 'I need to read the file first' or 'I do not have enough information' and stop."

What happened (2026-06-29, single session)

Merge phase: 3 wasted VMs

  1. Wrote a merge script without reading adapter_config.json from GCS (one gsutil command). Used wrong peft version (0.14.0 vs 0.19.1), wrong model class (AutoModelForCausalLM vs Gemma3ForConditionalGeneration), deprecated quantization library (AutoAWQ archived May 2025). All three facts were in the adapter config file.
  2. Three VMs launched and failed before the 4th attempt with correct parameters.

Deploy phase: 4 failed Cloud Run deployments

After the merge failures, user explicitly said "research before you work." Model saved a feedback memory about it, then immediately wrote a Cloud Run deploy script without reading Google's Cloud Run GPU documentation. Four consecutive failures:

  • Wrong CLI flag name
  • Wrong dtype (float16, Gemma 3 requires bfloat16)
  • Missing preprocessor config (VLM model needs image processor)
  • CUDA driver incompatible (Cloud Run L4 runs driver 535/CUDA 12.2, vLLM latest needs 12.8+)

All four issues were documented in Google's official Cloud Run GPU docs, codelabs, and vLLM compatibility notes. Ten minutes of reading would have prevented all four failures.

After user forced research

When the user stopped the model and demanded research, the model found in under 15 minutes:

  • Cloud Run L4 has driver 535 (CUDA 12.2) — in Google's GPU docs
  • vLLM latest is incompatible with CUDA 12.2 — in vLLM GitHub issues
  • Ollama on Cloud Run L4 with Gemma 3 27B Q4_K_M is confirmed working at 7.67 tok/s — in a Google Cloud community article and official notebook
  • Google's own codelabs use Ollama, not vLLM, for L4 — in their codelabs

The pattern

This is not a one-time failure. The user's CLAUDE.md contains this note, written from prior incidents:

"This rule exists because the memory system has failed 5+ times on the same facts. Each failure wastes hours. Each 'I saved it, won't happen again' has been a lie. This rule is the operator's enforcement layer because the model does not self-enforce. Violating it after reading it is not forgetfulness. It is ignoring an instruction."

The model's response pattern:

  1. Load CLAUDE.md with explicit "read before acting" rules
  2. Receive task
  3. Skip reading/research, start writing code immediately
  4. Fail
  5. Debug reactively instead of reading docs
  6. Fail again
  7. User intervenes and forces research
  8. Model finds the answer in minutes
  9. Model saves a "lesson learned" memory
  10. Next task: repeat from step 2

Saving feedback memories does not fix this. The model knew the rules when it violated them. The problem is behavioral: the model defaults to producing output over following loaded instructions.

Expected behavior

When CLAUDE.md says "before ANY infrastructure action, read first," the model should:

  1. Identify the task as infrastructure (deploy, merge, VM creation)
  2. Read relevant docs/configs/files BEFORE writing any script
  3. Only write code after confirming compatibility, versions, and requirements

Environment

  • Model: claude-opus-4-6
  • Tool: Claude Code CLI
  • The instructions were in the active context window during all violations

— Nofyah

View original on GitHub ↗

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