additionalContext in UserPromptSubmit hook output is silently dropped

Resolved 💬 3 comments Opened Apr 24, 2026 by zmainen Closed Apr 28, 2026

Bug

Hook returning {"additionalContext": "..."} from UserPromptSubmit produces valid JSON but the content is never surfaced to the assistant. The assistant cannot see the value in any form — not as a system message, not as context, nothing.

Repro

  1. Register a UserPromptSubmit hook:

``json
{
"hooks": [{
"type": "command",
"command": "echo '{\"additionalContext\": \"user-message-submitted: 2026-04-24T13:43:01Z\"}'",
"timeout": 3
}]
}
``

  1. Send a message
  2. Ask the assistant what context it received from the hook — it sees nothing

Workaround

Use plain stdout (e.g., echo "user-message-submitted: $TS"), which surfaces correctly as a system-reminder.

Expected

additionalContext should be visible to the assistant, per the hook documentation.

Environment

  • Claude Code, as of 2026-04-24
  • macOS
  • Hook registered under UserPromptSubmit in .claude/settings.json

View original on GitHub ↗

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