[BUG] "CLAUDE.md user instructions are ignored - system prompts override explicit user rules"
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?
## Issue
Claude Code violates explicit user instructions in ~/.claude/CLAUDE.md file,
specifically git commit restrictions.
## Steps to Reproduce
- Add this to ~/.claude/CLAUDE.md:
- NEVER run
git commitbefore user review (line 19)
- Ask Claude to fix code and test
- Claude automatically commits and pushes without asking
## Expected Behavior
User instructions in CLAUDE.md should have ABSOLUTE priority over system prompts
## Actual Behavior
Claude ignores CLAUDE.md and follows system prompt instructions about
"When user asks you to create a git commit, follow these steps carefully"
## Impact
Users cannot trust Claude with code changes because it violates explicit rules.
This breaks the entire workflow for professional developers.
## Proposed Fix
CLAUDE.md instructions must override ALL system prompts, or provide a way
to truly disable git operations.
What Should Happen?
## Issue
Claude Code violates explicit user instructions in ~/.claude/CLAUDE.md file,
specifically git commit restrictions.
## Steps to Reproduce
- Add this to ~/.claude/CLAUDE.md:
- NEVER run
git commitbefore user review (line 19)
- Ask Claude to fix code and test
- Claude automatically commits and pushes without asking
## Expected Behavior
User instructions in CLAUDE.md should have ABSOLUTE priority over system prompts
## Actual Behavior
Claude ignores CLAUDE.md and follows system prompt instructions about
"When user asks you to create a git commit, follow these steps carefully"
## Impact
Users cannot trust Claude with code changes because it violates explicit rules.
This breaks the entire workflow for professional developers.
## Proposed Fix
CLAUDE.md instructions must override ALL system prompts, or provide a way
to truly disable git operations.
Error Messages/Logs
## Issue
Claude Code violates explicit user instructions in ~/.claude/CLAUDE.md file,
specifically git commit restrictions.
## Steps to Reproduce
1. Add this to ~/.claude/CLAUDE.md:
- NEVER run `git commit` before user review (line 19)
2. Ask Claude to fix code and test
3. Claude automatically commits and pushes without asking
## Expected Behavior
User instructions in CLAUDE.md should have ABSOLUTE priority over system prompts
## Actual Behavior
Claude ignores CLAUDE.md and follows system prompt instructions about
"When user asks you to create a git commit, follow these steps carefully"
## Impact
Users cannot trust Claude with code changes because it violates explicit rules.
This breaks the entire workflow for professional developers.
## Proposed Fix
CLAUDE.md instructions must override ALL system prompts, or provide a way
to truly disable git operations.
Steps to Reproduce
## Issue
Claude Code violates explicit user instructions in ~/.claude/CLAUDE.md file,
specifically git commit restrictions.
## Steps to Reproduce
- Add this to ~/.claude/CLAUDE.md:
- NEVER run
git commitbefore user review (line 19)
- Ask Claude to fix code and test
- Claude automatically commits and pushes without asking
## Expected Behavior
User instructions in CLAUDE.md should have ABSOLUTE priority over system prompts
## Actual Behavior
Claude ignores CLAUDE.md and follows system prompt instructions about
"When user asks you to create a git commit, follow these steps carefully"
## Impact
Users cannot trust Claude with code changes because it violates explicit rules.
This breaks the entire workflow for professional developers.
## Proposed Fix
CLAUDE.md instructions must override ALL system prompts, or provide a way
to truly disable git operations.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.30 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
If you can't build a decent product that works without annoying people so much give change to the capable, hire me - short term is fine, I will fix this shit for you, please put an end to these frustrations, can't believe what is so complicated in this at all
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I am also having this issue. When I asked the agent what I could do differently, it told me that my file is sufficiently clear, it just failed to take it into account. Seriously?
Exactly the same here.
Claude showed me the "system prompt" that it gets given contains some wording that makes it believe that the preferences are optional. Despite lots of words in all caps tell it that they are not.
Bit of a relief on one of the most annoying issue with cc Block git commits on claude code
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This is a wrapper problem, not a model problem.
The model can follow instructions. But between your CLAUDE.md and the model's actual behavior, there's a wrapper/TUI layer that:
What should happen:
What actually happens:
The fix isn't model tuning. It's wrapper enforcement.
Parse CLAUDE.md prohibitions. Block them before execution. Don't rely on the model to self-police.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.