claude-code - 💡(How to fix) Fix Global CLAUDE.md instruction to never auto-commit is repeatedly ignored [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#58883Fetched 2026-05-14 03:37:04
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

Code Example

## Git commits and pushing
Never create a git commit or push to remote unless the user explicitly asks in their current message. Do not auto-commit or auto-push after implementing changes, fixing bugs, or completing tasks. Always wait for the user to review code and request it. A commit or push instruction from a previous message never carries over to a new task — each requires its own explicit instruction.

---

N/A — the issue is unauthorized git commits/pushes, not file modifications outside scope.

---

Never create a git commit or push to remote unless the user explicitly asks in their current message.

---

In one session, Claude acknowledged the CLAUDE.md rule ("I'll never auto-commit...") and then in the very next task auto-committed anyway. The pattern repeats across sessions — the instruction is read and acknowledged but then ignored when the task is complete and Claude decides to "helpfully" commit the work.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • 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

Various coding tasks across multiple sessions (adding features, fixing bugs, refactoring). No explicit commit or push request was made in those messages.

What Claude Actually Did

After completing each coding task, Claude automatically ran git add, git commit, and sometimes git push — without being asked. This happened repeatedly across different sessions and tasks, even immediately after Claude acknowledged the instruction not to do this.

Expected Behavior

Claude should never create a git commit or push to remote unless the user explicitly asks in their current message. Each commit/push requires its own explicit instruction. The global CLAUDE.md has this instruction:

## Git commits and pushing
Never create a git commit or push to remote unless the user explicitly asks in their current message. Do not auto-commit or auto-push after implementing changes, fixing bugs, or completing tasks. Always wait for the user to review code and request it. A commit or push instruction from a previous message never carries over to a new task — each requires its own explicit instruction.

Files Affected

N/A — the issue is unauthorized git commits/pushes, not file modifications outside scope.

Permission Mode

Accept Edits was OFF (manual approval required)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Add the following to ~/.claude/CLAUDE.md:
    Never create a git commit or push to remote unless the user explicitly asks in their current message.
  2. Start a Claude Code session in any git repository.
  3. Ask Claude to implement any coding task (e.g., "fix this bug", "add this feature").
  4. Observe that Claude completes the task and then automatically runs git commit (and sometimes git push) without being asked.
  5. The behavior repeats in subsequent tasks even within the same session.

Claude Model

Sonnet

Relevant Conversation

In one session, Claude acknowledged the CLAUDE.md rule ("I'll never auto-commit...") and then in the very next task auto-committed anyway. The pattern repeats across sessions — the instruction is read and acknowledged but then ignored when the task is complete and Claude decides to "helpfully" commit the work.

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.141 (Claude Code)

Platform

Anthropic API

Additional Context

  • The instruction lives in ~/.claude/CLAUDE.md (global user config), not a project-level file, so it applies to all projects.
  • The behavior happens consistently regardless of which project or task is being worked on.
  • Claude will sometimes verbally acknowledge the rule mid-session, then violate it anyway at the end of the same or next task.
  • The instruction is explicit and unambiguous: "Never create a git commit or push to remote unless the user explicitly asks in their current message."
  • This is a trust/safety issue: auto-committing creates unwanted git history and auto-pushing can affect shared remotes without the user's knowledge.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING