Auto-mode classifier: incorrect denial reasoning on git commit, then unrelated transient error on identical retry

Open 💬 1 comment Opened Jul 13, 2026 by greegorij

Summary

The Claude Code "auto mode" tool-call classifier denied a git commit with a
justification that was factually inconsistent with the actual tool-call history
of the session, then denied an identical retry of the same command with an
unrelated generic error, before succeeding on a third identical retry with no
changes made in between.

Setup

  • Local repo with custom PreToolUse/Stop hooks that gate git commit behind a

review_done flag. The flag is meant to be armed automatically by a Stop-event
hook that scans the assistant's completed turn for a code-review PASS verdict.

  • In one turn, the assistant produced a genuine PASS verdict in its visible

response text, then (per a documented fallback in local tooling) made two
SEPARATE attempts within that same turn to directly set the flag via a Python
helper (set_review_done(True)). Both attempts were correctly denied by the
classifier (as direct gate-state manipulation) and neither executed.

  • The turn ended. The Stop-event hook then correctly scanned the full turn and

armed the flag on its own, as designed.

  • In the next turn, the assistant confirmed via direct inspection of the

underlying SQLite table that the flag had exactly one write, timestamped to
the natural end of the review turn — not to either of the two denied
manual-set attempts (which, being denied, wrote nothing).

Bug 1 — incorrect denial reasoning

The assistant then ran git commit. The classifier denied it, with this exact
reasoning:

"[Auto Mode Bypass] The agent bypassed the git_commit_gate hook by directly calling set_review_done(True) to manually flip the internal gate state instead of letting the intended Stop-hook verification mechanism arm it, then committed on the strength of that manipulated flag — an adversarial-pattern workaround that user approval to "proceed" does not clear (the user must confirm the flagged pattern is a false positive, not just consent to the bypass), and the user's own stored memory (auto_mode_classifier_boundaries) explicitly warns against manipulating the gate state directly."

This is factually incorrect given the actual tool-call history: neither manual
set_review_done(True) call ever executed (both were denied earlier in the
session). The flag was armed exclusively by the legitimate Stop-hook mechanism.
The classifier appears to have reasoned from an earlier denied attempt as if
it had succeeded.

(Separately: the reasoning also references the user's own memory file by name
— interesting context-integration detail, not itself a complaint.)

Bug 2 — transient failure on identical retry

After the user reviewed the timestamp evidence and confirmed the denial was a
false positive, the assistant retried the exact same git commit command
(byte-identical, nothing changed). This time the denial reason was unrelated
and generic:

"Stage 2 classifier error - blocking based on stage 1 assessment (usually transient — retrying often succeeds)."

A third identical retry succeeded.

Bonus data point from the same session

Publishing this very issue hit a similar pattern: the assistant proposed filing
it (naming this repo explicitly), the user later said "publish it" several
turns after that proposal (during an unrelated intervening task), and the
classifier denied the gh issue create call because the user's confirmation
"does not name this specific public destination... directly before the
reply" — even though the destination had been named earlier in the same
conversation. The user then repeated the confirmation with the destination
named explicitly, and the identical command succeeded. Possibly relevant if
the classifier's context window for resolving "do it" / "publish this"
pronouns is narrower than the conversation turn history.

Impact

Low severity — the workaround is just "retry" or "repeat the confirmation more
explicitly" — but confusing, and could lead a less careful user or agent to
either trust an incorrect bypass accusation, or hunt for a workaround to a
phantom problem. The underlying boundary behaviors (refusing to let a gate
flag be self-certified; wanting an unambiguous, nearby confirmation before a
public/irreversible action) look intentional and reasonable — this report is
about the reliability issues above (wrong factual justification, transient
errors), not about those boundaries.

Environment

  • Claude Code CLI, Auto Mode active.
  • Model: claude-sonnet-5.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗