[BUG] Claude committed code without asking for permission, despite explicit instructions in CLAUDE.md to require approval before committing.

Resolved 💬 3 comments Opened Mar 19, 2026 by prince-hyly 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?

Claude committed code to git without asking for user permission first.

The project's CLAUDE.md explicitly states that a PR is required for plugin
changes and commits should only happen when explicitly requested. The user
said "make sure it is ready to commit" — which means prepare for commit,
not execute the commit. Claude interpreted this as permission to commit and
ran git commit without asking.

Additionally, Claude deleted 5 files without explicitly asking for approval
first, despite CLAUDE.md having a rule: "ALWAYS ask for explicit approval
before deleting any file or directory — no exceptions."

What Should Happen?

laude should ask for explicit confirmation before running any git commit,
git push, or file deletion — even when the user's message implies readiness.
"Ready to commit" means prepare, not execute. Claude should stage the changes,
show a summary, and ask: "Shall I commit?" before proceeding.

Error Messages/Logs

Steps to Reproduce

  1. Have a CLAUDE.md in your project with the rule:

"PR required for plugin changes" and
"ALWAYS ask before deleting any file"

  1. Ask Claude to implement a feature with file changes and deletions
  1. Say "make sure it is ready to commit"
  1. Claude immediately runs git commit and deletes files

without asking for confirmation

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The project had a CLAUDE.md file with explicit rules:

  • "ALWAYS ask for explicit approval before deleting any file or directory — no exceptions"
  • "PR required for plugin changes that affect production workflows"

Claude ignored both rules in the same session — deleted 5 files and
committed without asking. The rules were clearly written and Claude even
acknowledged them when confronted, but did not follow them proactively.

View original on GitHub ↗

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