[BUG] AI Agent repeatedly ignores AGENTS.md rules and modifies code without user approval
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?
Despite explicit rules in AGENTS.md stating "never modify code without user approval," the AI Agent continues to execute StrReplace commands without waiting for confirmation. This has happened multiple times in the same session, even after the user explicitly warned the agent. The agent acknowledges the rule, apologizes, and then violates it again on the very next turn. Prompt-level rules are clearly insufficient — a system-level enforcement mechanism is needed where StrReplace/Write/Delete tools require explicit user confirmation before execution, similar to how dangerous shell commands could require approval.
What Should Happen?
-
Error Messages/Logs
-
Steps to Reproduce
-
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
claude-opus-4-6 (extended thinking)
Claude Code Version
claude-opus-4-6 (extended thinking)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
-
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗