[BUG] Web version leaks hook systemMessage into user chat UI (should be Claude-only context)
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
- Configure a
UserPromptSubmithook that emits a JSONsystemMessageon exit 0.
Example (Engram plugin's user-prompt-submit.sh):
``bash``
echo '{"systemMessage": "MEMORY REMINDER: call mem_save now."}'
exit 0
- Open claude.ai/code (web session).
- Send any message after the hook's condition is met.
- Observe: the
systemMessagetext appears in the chat UI prefixed withUserPromptSubmit 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.