claude-code - 💡(How to fix) Fix SessionStart hook systemMessage not displayed when remote control is enabled via /config [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47828Fetched 2026-04-15 06:41:09
View on GitHub
Comments
3
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3

Fix Action

Workaround

Add instructions to CLAUDE.md to have Claude print the hook results from additionalContext as part of its first response.

Code Example

{
     "systemMessage": "My Hook  🟢  OK   Everything is fine",
     "hookSpecificOutput": {
       "hookEventName": "SessionStart",
       "additionalContext": "My Hook: OK — Everything is fine."
     }
   }
RAW_BUFFERClick to expand / collapse

Title

SessionStart hook systemMessage not displayed when remote control is enabled via /config

Body

Bug description

systemMessage output from SessionStart hooks is not rendered in the terminal UI when remote control for all sessions is enabled (via /config toggle, which sets remoteControlAtStartup: true in ~/.claude.json).

The hooks execute successfully — additionalContext reaches the model's system prompt, and debug logs confirm execution — but the systemMessage text is never shown to the user.

Steps to reproduce

  1. Create a SessionStart hook that emits JSON with systemMessage:

    {
      "systemMessage": "My Hook  🟢  OK   Everything is fine",
      "hookSpecificOutput": {
        "hookEventName": "SessionStart",
        "additionalContext": "My Hook: OK — Everything is fine."
      }
    }
  2. With remote control OFF: Start claudesystemMessage appears in the startup output ✅

  3. With remote control ON (via /config → enable remote control for all sessions): Start claudesystemMessage does NOT appear ❌

Expected behavior

systemMessage from SessionStart hooks should be displayed in the terminal UI regardless of whether remote control is enabled.

Actual behavior

The remote control initialization appears to re-render/reset the UI after SessionStart hooks have already emitted their output, causing the systemMessage to be swallowed. The hook output still reaches the model via additionalContext, confirming the hooks ran successfully.

Workaround

Add instructions to CLAUDE.md to have Claude print the hook results from additionalContext as part of its first response.

Environment

  • Claude Code version: v2.1.107
  • OS: Windows 11 Pro (Git Bash / MSYS2)
  • Node: v22.x
  • Remote control: enabled via /config toggle (remoteControlAtStartup: true in ~/.claude.json)
  • Number of hooks tested: 6 custom SessionStart hooks, all affected
  • Also tested: stderr output (>&2), /dev/tty output — neither displayed, confirming the TUI captures all output channels from hook subprocesses

Additional context

  • The --remote-control CLI flag was NOT used (it skips hooks entirely). The issue is specifically with the /config toggle (remoteControlAtStartup).
  • Multiple hooks running in parallel are all affected.
  • The statusMessage field in settings.json hook config (spinner text during execution) may or may not display — the issue is specifically about the hook's stdout JSON systemMessage.

extent analysis

TL;DR

The systemMessage from SessionStart hooks is not displayed when remote control is enabled due to the UI being re-rendered after hook execution, and a workaround involves printing hook results from additionalContext as part of Claude's first response.

Guidance

  • Verify that the SessionStart hooks are executing successfully by checking debug logs and the presence of additionalContext in the model's system prompt.
  • Consider implementing the suggested workaround of printing hook results from additionalContext as part of Claude's first response, as described in the CLAUDE.md instructions.
  • Investigate the UI re-rendering behavior when remote control is enabled to determine if there's a way to preserve the systemMessage output from hooks.
  • Test the behavior with different types of hooks and output channels to confirm the issue is specific to SessionStart hooks and systemMessage output.

Example

No code snippet is provided as the issue description does not imply a specific code change, but rather a configuration or behavioral issue.

Notes

The issue seems to be specific to the interaction between remote control and SessionStart hooks, and the provided workaround may be a viable temporary solution. However, a more permanent fix may require changes to the Claude codebase or configuration.

Recommendation

Apply the workaround by printing hook results from additionalContext as part of Claude's first response, as this is a suggested solution that can mitigate the issue until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

systemMessage from SessionStart hooks should be displayed in the terminal UI regardless of whether remote control is enabled.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix SessionStart hook systemMessage not displayed when remote control is enabled via /config [3 comments, 2 participants]