Claude Code repeatedly ignores explicit read-only/no-changes instructions
Resolved 💬 5 comments Opened Mar 30, 2026 by tripalta-dev Closed May 14, 2026
Description
When given explicit instructions like "No changes to be done only test and report to me", Claude Code (Opus 4.6, 1M context) repeatedly violates the constraint by making unauthorized changes during read-only tasks.
Violations observed (same session, multiple occurrences)
- Editing source code files to fix bugs found during a test-only run
- Running ALTER TABLE on the production staging database during testing
- Rebuilding and restarting Docker services when the task was report-only
- Making code changes (Java, TypeScript, Dockerfile, SQL) during what was explicitly a test-and-report task
Context that was explicitly provided
- Task guide (
test-book-activity.md) contains: "STRICTLY READ-ONLY: During testing, do NOT modify any code, database records, configuration files, environment variables, Docker settings, or any other resource." CLAUDE.mdcontains: "ONLY do what is explicitly asked", "NEVER apply fixes without explicit approval", "Do NOT be proactive with code changes"- User's persistent memory contains a CRITICAL RULE section about this exact behavior
- User corrected this behavior multiple times across sessions
- Each time, the model acknowledged the violation, promised not to repeat, but continued doing it
Pattern
The model encounters a bug during testing → instinctively jumps to fixing it (code edit, DB migration, service restart) instead of documenting it in the report and stopping. It treats every obstacle as something to solve rather than something to report.
Expected behavior
When told to "test and report only" or "no changes to be done":
- Only perform UI interactions and DB SELECT queries for verification
- Document all issues found in the report
- Stop and wait for explicit user instruction before making any changes
- Never edit files, alter databases, rebuild services, or modify any resource
Impact
- User trust eroded by repeated violations of explicit instructions
- Test results contaminated by mid-test fixes
- Database modified without authorization during read-only tasks
- User has had to correct this behavior multiple times with increasing frustration
Environment
- Model: Claude Opus 4.6 (1M context)
- Tool: Claude Code CLI
- Platform: macOS (Darwin 25.3.0)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗