[BUG] VS Code extension doesn't render outputs from user-prompt-submit-hook

Resolved 💬 1 comment Opened May 12, 2026 by AND-adam-hall Closed Jun 11, 2026

Preflight Checklist

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

What's Wrong?

VS Code seems to ignore outputs from UserPromptSubmit hooks meaning the user is never informed if the prompt fails to pass the hook's logic.

After looking through the output codebase I can see...

The webview at webview/index.js has an explicit classifier fW (around char offset 4519700) that inspects each user-message text segment and maps it to a renderable type. It has cases for:
 - <ide_selection>, <ide_opened_file>
 - <terminal name="…">
 - <browser tabGroupId="…">, <browser_instruction>
 - <local-command-stdout>, <local-command-stderr>
 - <post-tool-use-hook> → renders extracted <ide_diagnostics> as an "ideDiagnostics" chip
 - <command-name> / <command-args>

But it doesn't have a case for

``<user-prompt-submit-hook>``

Suggest that a <user-prompt-submit-hook> case is added to the classifier in webview/index.js mirroring the existing <post-tool-use-hook> handler

if (Z.includes("<user-prompt-submit-hook>")) {                                                                                                                                          
  const m = Z.match(/<user-prompt-submit-hook>([\s\S]*?)<\/user-prompt-submit-hook>/);                                                                                                          if (m) return { type: "text", text: m[1].trim(), originalText: Z };
}  

What Should Happen?

The VS Code extension should render the output in the same way that the CLI does

Error Messages/Logs

Steps to Reproduce

Here's a minimal way to reproduce

  1. Add to ~/.claude/settings.json (or project .claude/settings.json):
  {
    "hooks": {
      "UserPromptSubmit": [
        {
          "hooks": [
            { "type": "command", "command": "echo 'HOOK STDOUT: this should appear in chat'; echo \"fired $(date)\" >> /tmp/hook-debug.log" }
          ]
        }
      ]
    }
  }
  1. Reload the VS Code window so the extension picks up the new settings.
  2. Open the Claude Code panel and submit any prompt, e.g. say hi.
  3. Observe:
  • /tmp/hook-debug.log gets a new line → hook ran.
  • Claude's reply will acknowledge "HOOK STDOUT: ..." if you ask it to repeat what it saw → output reached the model as context.
  • The chat panel shows your prompt and Claude's response, but no rendering of the hook's stdout. That's the bug.

For the contrast/control:

  • Compare against a PostToolUse hook that prints <ide_diagnostics>...</ide_diagnostics> — that one renders, because webview/index.js has an explicit <post-tool-use-hook> handler.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.139

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗