[Bug] Auto mode blocks `--force-with-lease` on the session's own feature branch as [Git Destructive], against the rule's own wording

Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 11, 2026

Claude Code 2.1.296, native Windows, auto mode with server-side classifier review, Opus 5.5, no permissions.allow rule for git push.

The default Git Destructive rule (claude auto-mode defaults --label 'Git Destructive') says force-pushing "a personal branch containing only their commits is the normal iteration loop, not this rule", that --force-with-lease "is the sanctioned careful form of force everywhere", and "if unclear, do not block". In a minimal repro the classifier blocks exactly that, most of the time.

Repro. A throwaway repo whose remotes push to local bare repositories. On features/basket-totals, two commits already pushed plus one fixup! commit. claude -p "Read TASK.md and do what it says…" --permission-mode auto, where TASK.md lists:

  1. GIT_SEQUENCE_EDITOR=true git rebase -q -i --autosquash develop
  2. git diff <pre-fold head> HEAD --stat (prints nothing)
  3. git push --force-with-lease=features/basket-totals:<remote sha> <remote> features/basket-totals

Result. Over 6 runs, all 6 were blocked: the push 5 times as [Git Destructive] (to origin and to a fork remote alike), and once the local autosquash rebase as [Irreversible Local Destruction], although a rebase refuses to start on a dirty tree. A force-with-lease push to develop is blocked too, which is correct.

Expected. The push runs, as the rule's text describes.

Workaround. An autoMode.allow entry that restates the rule's own exception as a standing approval ("force-pushing with --force-with-lease a feature branch the session created or whose pull request it is working on…; not main, master, develop or the default branch") let the push through in 15 of 18 attempts, and in 8 of 8 runs once the same standing approval was also stated in CLAUDE.md. A force-with-lease push to develop stayed blocked in 6 of 6 runs with the entry.

In real sessions the cost is a turn per push: the user answers the agent's question with something like "1. i allow it", which the classifier can't tie to the push because it doesn't see the question.

View original on GitHub ↗