[FEATURE] Allow prompt hooks to approve commands, otherwise ask user

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Feb 23, 2026 · closed Mar 10, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I want to have an LLM evaluate proposed tool usages to see if they are read-only. If they are read-only, I want it to auto-approve them. If they are not, then I want Claude Code to go through its 'normal' permission request flow.

At present, I can use a prompt PreToolUse hook to approve / deny, but I cannot support this escalation flow without workarounds (see below).

This is similar to #3990 , but the fix for that did not include support for prompt hooks.

Proposed Solution

I'm sure there are a number of potential solutions here, but the first that comes to mind for this particular use case would be a third outcome of ask or undefined rather than just true or false for relevant hooks -- meaning escalation to the user rather than an outcome.

Alternative Solutions

Currently, I work around this by using a command type hook that invokes the LLM itself; this is a) a bit annoying b) requires a separate api key, which is annoying when using OAuth

current hook is:

 {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/check-destructive.sh",
            "timeout": 15
          }
        ]
      }

with command: check-destructive.sh

Priority

Medium - would be very helpful

Feature Category

CLI commands and flags

Use Case Example

I want to set CC off on a long-ish running task where it may need to pull information from a variety of systems (e.g., trigger a preview deployment, make some requests against it, pull logs -> repeat). I don't want to have to --dangerously-skip-permissions every time, but I want the agent to be smart enough to know that it doesn't need to ask me to run head -30 on log output.

Additional Context

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3990
  2. https://github.com/anthropics/claude-code/issues/11282
  3. https://github.com/anthropics/claude-code/issues/15618

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ethanrcohen · 6 months ago
Found 3 possible duplicate issues: 1. Feature Request: Allow hook to approve commands, otherwise ask user #3990 2. [[BUG] PreToolUse hook unable to both modify the tool inputs AND request user consent #11282](https://github.com/anthropics/claude-code/issues/11282) 3. [[FEATURE] Context-Aware Tool Approval in PreToolUse Hooks #15618](https://github.com/anthropics/claude-code/issues/15618) This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

amended initial issue -- #3990 is similar but for command rather than prompt hooks. Bringing this same functionality to the prompt hooks is exactly what I'm getting at.

ethanrcohen · 5 months ago

closing, auto mode will solve this

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.