claude-code - 💡(How to fix) Fix Stop hook: option to suppress blocked response and show only regeneration [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#54843Fetched 2026-04-30 06:34:22
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

When a Stop hook returns decision: "block", the user sees both the blocked response (already streamed) and the regenerated response. For use cases where the Stop hook enforces content quality (prose standards, style guides, sensitive content filtering), the blocked output breaks the user experience.

Request: A mechanism to suppress the display of a blocked response so the user only sees the clean regeneration.

Root Cause

When a Stop hook returns decision: "block", the user sees both the blocked response (already streamed) and the regenerated response. For use cases where the Stop hook enforces content quality (prose standards, style guides, sensitive content filtering), the blocked output breaks the user experience.

Request: A mechanism to suppress the display of a blocked response so the user only sees the clean regeneration.

RAW_BUFFERClick to expand / collapse

Summary

When a Stop hook returns decision: "block", the user sees both the blocked response (already streamed) and the regenerated response. For use cases where the Stop hook enforces content quality (prose standards, style guides, sensitive content filtering), the blocked output breaks the user experience.

Request: A mechanism to suppress the display of a blocked response so the user only sees the clean regeneration.

Use Case

I run a long-form TTRPG campaign where a Stop hook enforces narrative prose quality — catching banned phrases, overused patterns, and style violations. When the hook blocks a response, the player sees the flawed prose before the rewrite arrives, breaking narrative immersion.

Current flow:

  1. Claude streams response to terminal (user sees it)
  2. Stop hook fires, detects violation, returns block
  3. Claude regenerates clean response
  4. User has seen both versions

Desired flow:

  1. Claude generates response (buffered, not yet visible)
  2. Stop hook fires, detects violation, returns block
  3. Claude regenerates clean response
  4. User sees only the clean version

Proposed Solutions (any would work)

  1. hideBlockedOutput: true in the Stop hook JSON return — suppresses the blocked response from display
  2. streamAfterHooks: true in settings — buffers response until all Stop hooks clear before streaming to terminal
  3. --buffer-stop-hooks CLI flag — same effect, opt-in per session

Context

Related to #37569 (request for `--no-stream` mode). This is a narrower ask — only buffer when a Stop hook is registered, not all responses.

The Stop hook enforcement model is powerful but the UX gap limits adoption for quality-critical workflows where seeing rejected output is unacceptable.

extent analysis

TL;DR

Implementing a mechanism to suppress the display of blocked responses, such as adding a hideBlockedOutput: true flag to the Stop hook JSON return, can resolve the issue.

Guidance

  • Consider adding a hideBlockedOutput: true flag to the Stop hook JSON return to suppress blocked responses from being displayed to the user.
  • Alternatively, explore setting streamAfterHooks: true in settings to buffer responses until all Stop hooks clear before streaming to the terminal.
  • If using the CLI, investigate the --buffer-stop-hooks flag as an opt-in solution per session to achieve the same effect.
  • Verify the proposed solutions by testing them in a controlled environment to ensure they meet the desired flow and do not introduce unintended side effects.

Example

No code snippet is provided as the issue focuses on configuration and flag-based solutions rather than code changes.

Notes

The effectiveness of these solutions may depend on the specific implementation and workflow. Testing and validation are crucial to ensure the chosen solution works as expected and does not negatively impact other aspects of the system.

Recommendation

Apply a workaround by adding the hideBlockedOutput: true flag to the Stop hook JSON return, as it directly addresses the issue of suppressing blocked responses without requiring broader changes to the streaming behavior.

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

claude-code - 💡(How to fix) Fix Stop hook: option to suppress blocked response and show only regeneration [1 comments, 2 participants]