claude-code - 💡(How to fix) Fix [BUG] UserPromptSubmit Hook does not Display Reason in Claude Code Desktop

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When I configure a UserPromptSubmit hook to block prompts, Claude Code Desktop correctly prevents the prompt from reaching the model but does not display the documented rejection reason. This happens with both supported blocking methods: returning decision: "block" with a reason, and exiting with code 2. As a result, users receive no feedback explaining why the prompt was blocked, and the UI appears stuck.

<img width="622" height="273" alt="Image" src="https://github.com/user-attachments/assets/108b10b9-fb25-4da8-bb0b-922480330e22" />

What Should Happen?

When a UserPromptSubmit hook blocks a prompt, Claude Code Desktop should display the hook’s rejection reason to the user. The prompt should stay blocked, but the UI should clearly explain why.

Error Messages/Logs

Steps to Reproduce

  1. Configure a managed UserPromptSubmit hook in /Library/Application Support/ClaudeCode/managed-settings.json that blocks prompts and returns a rejection reason. Use managed-settings.json.

  2. Launch Claude Code Desktop.

  3. Submit any prompt, for example: “Hey, how are you?”

  4. Observe that the prompt is blocked and does not reach the model.

  5. Observe that Claude Code Desktop does not display the hook’s rejection reason anywhere in the UI, making the prompt submission appear stuck.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.140 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Product: Claude Code Desktop Version: Claude 1.7196.0 (2dbd78) 2026-05-12T05:34:40.000Z OS: macOS Tahoe Version 26.3. Settings location: /Library/Application Support/ClaudeCode/managed-settings.json (managed policy settings)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING