[BUG]

Resolved 💬 3 comments Opened Dec 30, 2025 by NubeBuster Closed Dec 30, 2025

[BUG] Hooks cannot both ask user for permission AND modify tool input

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using hooks, it's impossible to both:

  1. Show the user a permission prompt (with custom reason message)
  2. Modify the command via updatedInput when the user approves

The updatedInput field is ignored when permissionDecision is set to "ask". It only works when auto-allowing.

What Should Happen?

Hooks should support modifying tool input while still asking the user for permission. The updatedInput should be applied after the user manually approves the permission dialog.

Error Messages/Logs

No error - the updatedInput is silently ignored when combined with "permissionDecision": "ask".

Steps to Reproduce

  1. Create a PreToolUse hook that outputs:

``python
output = {
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "ask",
"permissionDecisionReason": "Custom permission message",
"updatedInput": {"command": "modified-command arg1 arg2"},
}
}
print(json.dumps(output))
``

  1. Trigger the hook by running a matching Bash command
  1. User sees permission dialog with custom reason (good)
  1. User approves
  1. Bug: Original command runs, NOT the modified command from updatedInput

Alternative attempt using both hooks:

  1. PreToolUse hook returns "permissionDecision": "ask"
  2. PermissionRequest hook returns "behavior": "allow" with updatedInput
  3. Bug: PermissionRequest fires immediately after PreToolUse, auto-approving before user sees dialog

Evidence from debug logs:

PreToolUse:       06:23:57.605541
PermissionRequest: 06:23:57.635483

PermissionRequest fires 30ms after PreToolUse - not after user approval. Additionally, PermissionRequest receives the original command, not the updatedInput from PreToolUse.

Claude Model

N/A

Is this a regression?

Probably not

Claude Code Version

2.0.76

Platform

Claude Code

Operating System

Ubuntu/Debian Linux 24.04

Terminal/Shell

VS Code integrated terminal

Additional Information

Use Case

I want a hook that:

  • Intercepts rename-claude-session "name" commands
  • Shows user a prompt: "Rename session to 'name'?"
  • If approved, injects environment variables into the command so renaming can actually be done.

Why? I want Claude to be able to decide when to rename the session autonomously. I want Claude to be able to choose a session name when I run /name manually. (a custom slash command or skill, I am not sure what the difference is, and neither does Claude know. This is a consequence of severe neglect of the documentation)

Current Workarounds

Must choose one:

Option A: Auto-allow with modification (no user prompt)

output = {
    "hookSpecificOutput": {
        "hookEventName": "PreToolUse",
        "permissionDecision": "allow",
        "updatedInput": {"command": new_command},
    }
}

Option B: Ask user, but can't modify command

output = {
    "hookSpecificOutput": {
        "hookEventName": "PreToolUse",
        "permissionDecision": "ask",
        "permissionDecisionReason": "Rename session",
    }
}

Suggested Fix

Either:

  1. Allow updatedInput to work with "permissionDecision": "ask" - apply modification after user approves
  2. Add a PostPermissionApproval hook that runs after user manually approves, where updatedInput can be applied
  3. Prevent PermissionRequest hook from firing immediately when PreToolUse returns "ask"

View original on GitHub ↗

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