Plugin hooks returning systemMessage: content not injected into model context
Summary
Plugin hooks (from installed Claude Code plugins) that return {"systemMessage": "..."} in their JSON output do not get the message injected into the model's context. Native hooks (configured directly in settings.json) DO get systemMessage injected correctly.
This is a Claude Code runtime issue, distinct from the plugin-side issue of which output fields to use (see anthropics/claude-plugins-official#292).
Reproduction Steps
- Install a plugin that uses
systemMessagein hook responses (e.g., hookify fromclaude-plugins-official) - Configure a rule that triggers on a specific event (e.g.,
UserPromptSubmitwith a pattern match) - Trigger the rule
- Observe: Claude Code shows
hook success: Successin debug output, the hook process exits 0, and the JSON output includes{"systemMessage": "warning text here"} - The model never sees the message content — it is silently dropped
Expected Behavior
systemMessage returned from plugin hooks should behave identically to systemMessage returned from native hooks — the content should be displayed to the user (and ideally injected into the model's context if that's the documented behavior for native hooks).
Actual Behavior
- Native hooks (in
settings.json):systemMessagecontent is processed and visible - Plugin hooks (from installed plugins):
systemMessagecontent is silently dropped despite the hook executing successfully
Debug Evidence
With debug logging enabled on the hookify plugin:
[hookify] Hook executed successfully, exit code 0
[hookify] Output: {"systemMessage": "⚠️ [rule-name] Warning message here"}
Claude Code logs: hook success: Success — but the message content is never surfaced to the model or user.
Impact
This affects all plugins that rely on systemMessage for warn/remind behavior. Specifically:
- hookify's
action: warnis broken for all event types - Any plugin using the documented
systemMessagefield in hook responses gets silently ignored
The workaround (using hookSpecificOutput.additionalContext instead) works for PreToolUse/PostToolUse events but is not applicable to UserPromptSubmit or Stop events, which don't support hookSpecificOutput.
Environment
- Claude Code: latest (as of 2026-02-15)
- Plugin: hookify@claude-plugins-official
- OS: macOS
Related Issues
- anthropics/claude-plugins-official#292 — hookify-side: UserPromptSubmit warnings not visible (field name issue)
- anthropics/claude-plugins-official#309 — hookify-side: CWD-dependent rule loading
- #20747 — hookify-side: warns use systemMessage instead of additionalContext (different root cause — that's the plugin not using the right field; this issue is about Claude Code not processing the field at all for plugin hooks)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗