Hook stdout not visible in verbose mode since v2.1.27 (rendering regression)

Resolved 💬 3 comments Opened Feb 6, 2026 by hillsmao Closed Feb 10, 2026

Bug Description

Since v2.1.27, all hook stdout output is no longer visible in the session UI, even with verbose output enabled (Ctrl+O). This worked correctly in v2.1.25 and earlier.

This affects all hook types (SessionStart, UserPromptSubmit, PostToolUse, etc.), not just SessionStart.

Steps to Reproduce

  1. Configure any hook in settings.json (e.g., a SessionStart hook that outputs text to stdout)
  2. Start a Claude Code session with v2.1.27 or later (tested up to v2.1.33)
  3. Enable verbose output (Ctrl+O)
  4. Observe: hook stdout is not displayed anywhere in the session UI

Expected: Hook stdout should be visible in verbose mode (as it was in v2.1.25)
Actual: Hook stdout is invisible regardless of verbose/debug settings

Root Cause (source code diff)

Diffing cli.js between the npm packages @anthropic-ai/claude-code@2.1.25 and @anthropic-ai/claude-code@2.1.27 reveals the rendering logic for async_hook_response was changed:

v2.1.25 — shows full hook output content

case "async_hook_response": {
  if (q.hookEvent === "SessionStart" && !z) return null;
  let w = q.response, H;
  // ... renders response.systemMessage and hookSpecificOutput content
  J = z && uq.default.createElement(uq.default.Fragment, null, ":",
    "\n", w.systemMessage ? w.systemMessage : w.hookSpecificOutput && ("...

v2.1.27 — only shows a generic "completed" message, content removed

case "async_hook_response": {
  if (A.hookEvent === "SessionStart" && !K) return null;
  return d4.default.createElement(PX, null,
    "Async hook ", d4.default.createElement(f, {bold: true}, A.hookEvent), " completed")
}

The actual hook output content (stdout, systemMessage, hookSpecificOutput) is no longer rendered — only a bare "Async hook [event] completed" string is shown.

Additionally, hook_success messages are marked with isMeta: true, which means they only display in verbose mode. If verbose rendering was also affected, this creates a double-blind where hook output is completely invisible.

Historical Pattern

This is a recurring regression. The same pattern occurred in the 2.0.x series:

  • v2.0.25: hooks worked ✅
  • v2.0.27: hooks required --debug flag (#10401) ❌
  • v2.0.30: fixed ✅
  • v2.0.31: regressed again ❌

Now in 2.1.x:

  • v2.1.25: hook stdout visible in verbose mode ✅
  • v2.1.27+: hook stdout invisible (up to v2.1.33) ❌

Environment

  • OS: macOS (Apple Silicon)
  • Working version: v2.1.25
  • Broken versions: v2.1.27, v2.1.29, v2.1.31, v2.1.33
  • Verified with: npm packages @anthropic-ai/claude-code@2.1.25 vs @2.1.27

Impact

Hook stdout visibility in verbose mode is critical for debugging custom hooks. Without it, users cannot verify hook execution, inspect output, or debug hook issues during development.

View original on GitHub ↗

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