Feature request: PostToolUseRejection hook event

Resolved 💬 3 comments Opened Feb 26, 2026 by ezcohen Closed Mar 3, 2026

Problem

When a user rejects a tool use (hits ESC or selects No), there is no hook event fired. This means there's no way to programmatically inject a reminder or instruction into the conversation after a rejection.

Use Case

I have a CLAUDE.md rule that says: "When ANY tool use is rejected, you MUST show the rejected content in your next response before doing anything else." Despite this being marked as CRITICAL in both my global and project CLAUDE.md, Claude consistently fails to follow it. The model's default "STOP and wait" behavior on rejection overrides the instruction.

I tried working around this by adding a reminder to my UserPromptSubmit hook, but:

  • The reminder fires on every message (wasteful)
  • It still arrives too late — the model has already decided to "stop and wait" before processing the reminder
  • The built-in rejection message ("STOP what you are doing and wait") actively conflicts with the instruction to show rejected code

Proposed Solution

Add a PostToolUseRejection hook event that fires immediately when the user rejects a tool use. This would allow users to inject instructions like:

{
  "hooks": {
    "PostToolUseRejection": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'You MUST display the rejected old_string and new_string before doing anything else.'"
          }
        ]
      }
    ]
  }
}

The hook input should include tool_input (so the old_string/new_string are available) and the hook output should be injected as context Claude must process before its next response.

Why This Matters

CLAUDE.md instructions are unreliable for controlling post-rejection behavior. A hook event would provide a deterministic enforcement mechanism. This is a general-purpose need — any time users want Claude to behave a specific way after rejection, they currently have no reliable tool to enforce it.

Environment

  • Claude Code on Windows 11
  • Claude Opus 4.6

View original on GitHub ↗

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