Claude Code repeatedly commits/pushes without user approval despite explicit CLAUDE.md instructions

Resolved 💬 6 comments Opened Mar 26, 2026 by bkeathley Closed May 1, 2026

Summary

Claude Code repeatedly commits and pushes to branches with auto-deployment enabled, without waiting for user testing or approval — even when explicit rules in both global and project CLAUDE.md files prohibit this.

Details

My CLAUDE.md (both global ~/.claude/CLAUDE.md and project-level) contains explicit rules:

  • "Never commit until user confirms code works"
  • "Wait for explicit request — Only commit, push, or create PR when user explicitly asks"

Despite these instructions, Claude Code commits and pushes automatically after running typecheck/lint/build. This has happened multiple times across different conversations. Each time:

  1. Claude acknowledges the mistake
  2. Apologizes and promises not to do it again
  3. Repeats the exact same behavior in the same or next conversation

Root Cause

The /deploy skill instructions include steps to commit and push. Claude follows the skill workflow instead of honoring the user's CLAUDE.md rules, even though the system prompt states that user instructions should take priority.

Saving the correction to memory files also does not reliably prevent recurrence.

Impact

  • Pushing to develop triggers automatic deployment to Cloud Run (dev environment)
  • Untested code gets deployed, potentially breaking services for the whole team
  • If this happened on a prod branch, it would cause a production outage
  • The user has had to correct this behavior many times with no lasting fix

Expected Behavior

After running typecheck/lint/build, Claude should stop and wait for the user to:

  1. Test the changes
  2. Explicitly say "commit" or "push"

Skill instructions (like /deploy) should never override user-defined rules in CLAUDE.md.

Reproduction

  1. Add "Never commit until user confirms code works" to your CLAUDE.md
  2. Make code changes
  3. Use /deploy or ask Claude to deploy
  4. Observe: Claude commits and pushes without waiting for approval

Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6 (1M context)
  • macOS / zsh

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗