Skip to content

[FEATURE] Allow users to provide a reason/instruction when denying a tool call #29782

@mizunashi-mana

Description

@mizunashi-mana

Preflight Checklist

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

Problem Statement

When a user denies a tool call at the permission prompt, the model receives no context about why it was denied. This causes the model to repeatedly attempt workarounds or similar tool calls, essentially "going rogue" trying to bypass the denial without understanding the intent. The user then has to separately explain the reason or desired alternative, adding extra steps and breaking the autonomous workflow.

Proposed Solution

Allow users to attach a short message/instruction when denying a tool call, similar to how permission rules can include instructions (e.g. ["Bash(pnpm:*)", "Use npm instead"]). For example, when the permission prompt appears and the user selects "No", they could type a reason like "Use npm command instead" or "Don't modify this file, change X instead". This message would be passed to the model as context for the denial, so it can adjust its approach immediately.

Before: Claude Code is going rogue...

{"permissions": {"deny": ["Bash(pnpm:*)"] } }

After: Claude Code works well!

{"permissions": {"deny": [["Bash(pnpm:*)", { "reason": "Use npm instead" }] ] } }

Alternative Solutions

Currently, after denying, the user must type a follow-up message explaining the reason, or preemptively set up hooks/rules. This adds friction and delays autonomous operation.

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

  1. Claude attempts Bash(pnpm install ...)
  2. User denies with reason: "Use npm, not pnpm"
  3. Claude immediately understands and runs npm install ... instead
  4. No extra back-and-forth needed

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions