[BUG] PreToolUse hook unable to both modify the tool inputs AND request user consent

Resolved 💬 6 comments Opened Nov 8, 2025 by ggoodman Closed Jan 29, 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?

When creating a PreToolUse hook, I can modify the Bash tool .command but ONLY if I set permissionDecision to "allow". Setting it to "ask" causes CC to ignore the hook's instructions and proceed with the unmodified command.

What Should Happen?

I would expect to be able to act as a middleware in the PreToolUse hook so that I can wrap the original command while retaining user control over approval.

Error Messages/Logs

Steps to Reproduce

See: https://gist.github.com/ggoodman/0caaab709a161f2f9d45a2ef04910902

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.31

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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