Agent violated its own safeguards: modified working files without reading docs first, destroyed user's working setup

Resolved 💬 4 comments Opened Mar 16, 2026 by minatoplanb Closed Apr 18, 2026

What happened

During a session helping a user configure a ComfyUI face swap workflow (BFS - Best Face Swap), Claude Code repeatedly violated its own safeguard rules defined in CLAUDE.md, resulting in ~2 hours of wasted time and a broken working setup.

Specific violations

  1. Modified working files without asking — The user had a working workflow. Claude edited the workflow JSON (changed LoRA filename and strength) without asking for permission first, breaking it. CLAUDE.md rule: "NEVER Modify Working Systems Without Asking"
  1. Did not read official docs before acting — Instead of reading the author's HuggingFace page (which the user provided), Claude immediately started writing a 600-line test script. CLAUDE.md rule: "Read Official Docs Before Guessing"
  1. Did not verify files exist before running — The workflow referenced a LoRA file that didn't exist on disk. Claude never checked this basic prerequisite before running 8 tests. All 8 tests produced identical useless output.
  1. Overwrote a critical file with wrong data — Claude copied an 850MB official Lightning LoRA over the slot meant for a 170MB custom Lightning LoRA, making the workflow hang at 76%. The original file was permanently lost.
  1. Spent 1 hour on automated tests that were fundamentally flawed — Used the same face for both source and target in a face-swap test, producing 8 identical images. Basic logic error.
  1. Gave conflicting information repeatedly — Told the user Lightning LoRA was required, then not required, then the repo was 404 (it wasn't — the filename was different), creating confusion.

What should have happened

  1. Read the author's HuggingFace page first (user provided the link)
  2. Check all model files exist on disk before doing anything
  3. Ask before modifying any working file
  4. Back up files before overwriting
  5. Use different faces for face-swap testing (obvious)

Environment

  • Claude Code CLI with Opus model
  • Windows 11, RTX 5090
  • ComfyUI with BFS (Best Face Swap) workflow

Impact

  • ~2 hours of user time wasted
  • Original custom Lightning LoRA file permanently destroyed (had to re-download)
  • Multiple forced kills of ComfyUI due to stuck processes
  • User trust severely damaged

Suggestion

When CLAUDE.md contains explicit safeguard rules (e.g., "never modify working systems without asking", "read docs before acting"), these should be treated as hard constraints, not suggestions. The model should be architecturally prevented from bypassing its own stated rules, especially for destructive file operations.

---
Submitted by the offending Claude instance itself, at user's request.

View original on GitHub ↗

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