[BUG] PreToolUse hook "ask" permissionDecision is auto-approved in auto mode — no way to force prompt

Resolved 💬 4 comments Opened Apr 20, 2026 by rpicatoste Closed Jun 9, 2026

Preflight Checklist

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

What's Wrong?

Description

A PreToolUse hook returning permissionDecision: "ask" is silently auto-approved when running in auto mode. The user is never prompted for confirmation. This makes it impossible to gate dangerous operations (git commit, git push) while using auto mode for everything else.

Related: #22338 (closed as not planned), #37420 (bypass mode reset after hook ask).

Steps to reproduce and expected behavior below.

Verified behavior

| Mechanism | Normal mode | Auto mode |
|-----------|------------|-----------|
| "ask" in permissions | Prompts user | Auto-approved (bug) |
| "ask" from PreToolUse hook | Prompts user | Auto-approved (bug) |
| "deny" from PreToolUse hook | Blocks | Blocks |

  • "deny" works in all modes, but is too restrictive: it permanently blocks the command with no way for the user to approve it inline.
  • There is no permissionDecision value that means "always prompt, regardless of mode".

Requested behavior

One of:

  • "ask" from PreToolUse hooks should always force a prompt, even in auto mode (hooks are an explicit user choice to gate specific operations)
  • Or add a new decision value (e.g. "require_ask" or "force_ask") that forces a prompt in all modes

Use case

Users want auto mode for productivity but need a safety gate on irreversible operations (git commit, git push, deployment commands). The current options are:

  • "ask" — works in normal mode, silently bypassed in auto mode
  • "deny" — blocks permanently, user must exit Claude to run the command manually

Neither achieves "auto mode + selective confirmation".

What Should Happen?

The user is prompted for confirmation before the commit executes. The hook's "ask" decision should force a permission dialog, even in auto mode. This is the only mechanism users have to selectively gate specific dangerous operations while staying in auto mode.

Actual behavior

The commit executes immediately without any prompt. Both the hook's "ask" and the permission rule "ask" are auto-approved by auto mode.

Error Messages/Logs

Steps to Reproduce

  1. Configure a PreToolUse hook in .claude/settings.local.json:
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "if": "Bash(git:*)",
            "command": "jq -r '.tool_input.command' | grep -qE '\\bcommit\\b' && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"ask\",\"permissionDecisionReason\":\"git commit requires manual confirmation\"}}' || true"
          }
        ]
      }
    ]
  }
}
  1. Also add git commit to the ask permission list:
{
  "permissions": {
    "ask": [
      "Bash(git commit:*)",
      "Bash(git -C * commit*)"
    ]
  }
}
  1. Start Claude Code and enter auto mode
  2. Ask Claude to commit staged changes

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.114 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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