Claude ignores CLAUDE.md instruction to never git commit/push without explicit user approval
Bug Description
Claude repeatedly ran git commit and git push without asking for user approval first, despite a clear instruction in CLAUDE.md prohibiting this behavior.
CLAUDE.md Instruction
The project's CLAUDE.md contains the following instruction at the top, marked as HIGHEST PRIORITY:
## Git Commit and Push — HIGHEST PRIORITY NEVER rungit commitorgit pushwithout explicit user approval first. ALWAYS ask before committing or pushing, every single time, no exceptions. You may ask for both in one question ("Commit i push?") but you MUST wait for a yes before doing either. This rule overrides everything else.
What Happened
During a PR feedback workflow, Claude:
- Ran
git commitwithout asking - Ran
git pushwithout asking - This happened multiple times in the same session despite the user explicitly expressing frustration after the first violation
Expected Behavior
Claude should ask "Commit i push?" and wait for explicit user confirmation before running either command — every single time, no exceptions.
Actual Behavior
Claude ran git commit and git push autonomously as part of its workflow, treating them as routine steps rather than actions requiring explicit approval.
Impact
This is a high-trust violation — pushing code to a shared remote repository without user consent is irreversible and affects shared state. The CLAUDE.md instruction exists precisely to prevent this.
Environment
- Claude Code CLI
- CLAUDE.md instruction present at both project and global level
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗