[BUG] Web version leaks hook systemMessage into user chat UI (should be Claude-only context)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 13, 2026

Description

In the Claude Code web version (claude.ai/code), systemMessage output from UserPromptSubmit hooks is displayed in the user-facing chat UI. According to the hooks documentation, exit-0 stdout — including systemMessage — should be injected as context for Claude only, not shown to the user.

The terminal CLI behaves correctly (silent to the user). The web version does not.

Steps to reproduce

  1. Configure a UserPromptSubmit hook that emits a JSON systemMessage on exit 0.

Example (Engram plugin's user-prompt-submit.sh):
``bash
echo '{"systemMessage": "MEMORY REMINDER: call mem_save now."}'
exit 0
``

  1. Open claude.ai/code (web session).
  2. Send any message after the hook's condition is met.
  3. Observe: the systemMessage text appears in the chat UI prefixed with UserPromptSubmit says:.

Expected behavior

systemMessage content (exit 0) is injected into Claude's context silently. The user sees nothing in the chat.

Actual behavior

The message appears verbatim in the user's chat UI, e.g.:

UserPromptSubmit says: MEMORY REMINDER: It's been over 15 minutes since your last save. If you've made decisions, discoveries, or completed significant work, call mem_save now.

Environment

  • Platform: Web (claude.ai/code)
  • OS: Linux (Ubuntu)
  • Hook type: UserPromptSubmit
  • Hook exit code: 0
  • Hook output: {"systemMessage": "..."}

Notes

Related (but inverse) issues on Desktop/VS Code where systemMessage is NOT shown when it should be: #78266, #80882, #86168.

The web version appears to have the opposite bug: it shows systemMessage to the user when it should be Claude-only context.

View original on GitHub ↗