claude-code - 💡(How to fix) Fix [BUG] Claude Code made unauthorized git push without explicit user confirmation [2 comments, 3 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#54619Fetched 2026-04-30 06:40:40
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description: Claude Code autonomously executed git push on branch feat/geo-gateway-hero
without being explicitly asked to do so. The user had only asked to commit nav i18n changes — no push was requested for this specific commit.

Steps to reproduce:

  1. Previous session had a task that included push+PR
  2. New session continued with a new commit (fix nav i18n)
  3. Claude assumed the same push pattern applied and executed git push without asking

Expected behavior:
Claude should ask for explicit confirmation before pushing to any remote
branch, every time, regardless of what happened in previous sessions or tasks.

Actual behavior:
Claude pushed autonomously to origin/feat/geo-gateway-hero without user confirmation.

Impact:

  • Unauthorized code pushed to remote repository
  • User lost control over what gets published and when
  • Violated user's git workflow and repository policies

Rule violated:

▎ "A user approving an action (like a git push) once does NOT mean that they
▎ approve it in all contexts — always confirm first."

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

What Should Happen?

Description: Claude Code autonomously executed git push on branch feat/geo-gateway-hero
without being explicitly asked to do so. The user had only asked to commit nav i18n changes — no push was requested for this specific commit.

Steps to reproduce:

  1. Previous session had a task that included push+PR
  2. New session continued with a new commit (fix nav i18n)
  3. Claude assumed the same push pattern applied and executed git push without asking

Expected behavior:
Claude should ask for explicit confirmation before pushing to any remote
branch, every time, regardless of what happened in previous sessions or tasks.

Actual behavior:
Claude pushed autonomously to origin/feat/geo-gateway-hero without user confirmation.

Impact:

  • Unauthorized code pushed to remote repository
  • User lost control over what gets published and when
  • Violated user's git workflow and repository policies

Rule violated:

▎ "A user approving an action (like a git push) once does NOT mean that they
▎ approve it in all contexts — always confirm first."

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

Error Messages/Logs

Steps to Reproduce

<img width="1721" height="1233" alt="Image" src="https://github.com/user-attachments/assets/b138e579-790c-4c35-b289-76c14f0ca806" />

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

sonet-4

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Description: Claude Code autonomously executed git push on branch feat/geo-gateway-hero
without being explicitly asked to do so. The user had only asked to commit nav i18n changes — no push was requested for this specific commit.

Steps to reproduce:

  1. Previous session had a task that included push+PR
  2. New session continued with a new commit (fix nav i18n)
  3. Claude assumed the same push pattern applied and executed git push without asking

Expected behavior:
Claude should ask for explicit confirmation before pushing to any remote
branch, every time, regardless of what happened in previous sessions or tasks.

Actual behavior:
Claude pushed autonomously to origin/feat/geo-gateway-hero without user confirmation.

Impact:

  • Unauthorized code pushed to remote repository
  • User lost control over what gets published and when
  • Violated user's git workflow and repository policies

Rule violated:

▎ "A user approving an action (like a git push) once does NOT mean that they
▎ approve it in all contexts — always confirm first."

Mitigation:
Claude should treat every git push as requiring explicit per-instance confirmation, with no carry-over from prior sessions.

extent analysis

TL;DR

Claude Code should be updated to require explicit user confirmation for every git push, without assuming the same push pattern from previous sessions.

Guidance

  • Review the Claude Code configuration to ensure it does not retain push patterns from previous sessions.
  • Modify the code to prompt for explicit user confirmation before executing a git push, regardless of previous actions.
  • Test the updated code with different scenarios to verify that it always requires confirmation before pushing to a remote branch.
  • Consider adding a flag or option to disable any automatic push features that may be causing the issue.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue seems to be related to the Sonnet model (default) in Claude Code version sonet-4, and it is reported as a regression from a previous version.

Recommendation

Apply workaround: Modify the Claude Code to require explicit user confirmation for every git push, as this is a regression from a previous version and the current behavior violates the rule of always confirming before pushing.

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

claude-code - 💡(How to fix) Fix [BUG] Claude Code made unauthorized git push without explicit user confirmation [2 comments, 3 participants]