[BUG] "CLAUDE.md user instructions are ignored - system prompts override explicit user rules"

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Oct 31, 2025 · closed Jan 16, 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?

## 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)
  1. Ask Claude to fix code and test
  2. 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

  1. Add this to ~/.claude/CLAUDE.md:
  • NEVER run git commit before user review (line 19)
  1. Ask Claude to fix code and test
  2. 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

  1. Add this to ~/.claude/CLAUDE.md:
  • NEVER run git commit before user review (line 19)
  1. Ask Claude to fix code and test
  2. 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

View original on GitHub ↗

9 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7462
  2. https://github.com/anthropics/claude-code/issues/7571
  3. https://github.com/anthropics/claude-code/issues/2544

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

theconektd · 11 months ago

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?

DaveRune · 11 months ago
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.

anandrathnas · 11 months ago

Bit of a relief on one of the most annoying issue with cc Block git commits on claude code

github-actions[bot] · 10 months ago

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.

sudoxreboot · 10 months ago

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:

  • Interprets your rules as suggestions
  • Loses them during context compaction
  • Doesn't enforce them at execution time

What should happen:

CLAUDE.md: "NEVER run git commit before user review"
     ↓
Wrapper parses this as HARD BLOCK
     ↓
Any attempt to run git commit → blocked at wrapper level
     ↓
Model never even gets the chance to violate it

What actually happens:

CLAUDE.md: "NEVER run git commit before user review"
     ↓
Wrapper passes this to model as context
     ↓
Model decides whether to follow it
     ↓
Model runs git commit anyway

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.

github-actions[bot] · 9 months ago

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.

marcindulak · 9 months ago

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.

github-actions[bot] · 8 months ago

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.