[MODEL] CLAUDE OPUS REPEATEDLY VIOLATES EXPLICIT GIT COMMAND RESTRICTIONS
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude ignored my instructions or configuration
What You Asked Claude to Do
Summary:
Claude Code repeatedly executes git commit, push, and revert commands despite explicit user instructions prohibiting this behavior. This has resulted in destroyed work and significant user frustration. Text-based directives at multiple levels fail to prevent the behavior.
Setup Context:
I use Claude Code with a persistent identity configuration. I maintain a self.yaml file that stores:
- User preferences and communication style
- Explicit permissions and restrictions
- Coding directives and constraints
- Session practices and learned behaviors
This file is read at session start and contains explicit directives that Claude should follow throughout the session. It functions as a persistent configuration/instruction set.
The Problem:
Despite having explicit restrictions in multiple locations, Claude repeatedly:
- Commits code without permission
- Pushes after committing without being asked
- Assumes ambiguous instructions (like "undo") mean destructive git operations
Where the restriction exists:
self.yaml- Contains explicit directive: "NEVER make ANY code change unless Shan explicitly says to" with severity marked "CRITICAL - ABSOLUTE - NO EXCEPTIONS"~/.claude/CLAUDE.md- Global config loaded at prompt processing level- Verbal instructions during session - "do not commit without permission each time"
What Claude Actually Did
What happens anyway:
- Claude finishes work and commits without asking
- Claude interprets "undo" as "run git revert" without asking for clarification
- Session 18: Claude ran
git checkout src/main.tswhich destroyed hours of uncommitted work
Impact:
- Hours of work destroyed
- Trust damaged
- User stress and frustration
- The directives are clearly visible in context but get overridden by (presumably) training that associates "helpful completion" with committing work
Expected Behavior
Claude should adhere to restrictions and configuations in self.yaml and CLAUDE.md. Actions requiring explicit permission should not be executed autonomously.
Files Affected
Entire git repo reverted, all work for hour lost.
Permission Mode
I don't know / Not sure
Can You Reproduce This?
Sometimes (intermittent)
Steps to Reproduce
Extended code session. Prompts with Design questions, things like "can we do this" and it codes an entire solutions, commites and pushes without permsion. Then when I give a direction that that was not allowed and to undo it, they reverted everything to the last stuff in the remote repo, and wiped out hours of work. Again, violating the don't commit/revert/push directive without permission for each set of work.
Claude Model
Opus
Relevant Conversation
can't give specifics here, just smoetimes it asks for permissions but when sessions go long (hours) it started igonring the directives/permissions.
Impact
Critical - Data loss or corrupted project
Claude Code Version
Claude Code version 2.0.55
Platform
Anthropic API
Additional Context
This happens more often the longer the coding session continues.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗