-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Issue Description
SessionStart hook handlers are executing successfully and returning context via stdout, but their output is not being included in the system reminders shown to the LLM. This defeats the primary purpose of SessionStart hooks.
Expected Behavior
According to Claude Code hooks documentation:
Exit 0 means success. For most events, stdout is only shown in verbose mode (
Ctrl+O). The exceptions areUserPromptSubmitandSessionStart, where stdout is added as context that Claude can see and act on.
SessionStart hooks should have their stdout/context automatically visible to the LLM without requiring verbose mode.
Actual Behavior
The LLM only sees:
<system-reminder>SessionStart:startup hook success: Success</system-reminder>But should see:
<system-reminder>
SessionStart:startup says: ✅ SessionStart hook system active
🐳 Running in YOLO container environment (Claude Code CLI in sandbox)
Detected indicators:
• CLAUDE_CODE_ENTRYPOINT=cli environment variable
• Project root is /workspace with .claude/ present
• DEVCONTAINER=true environment variable
• IS_SANDBOX=1 environment variable
• container=podman environment variable
• Running as root user (UID 0)
CONFIG CHECK: 4/6 settings need attention
[... full output from handlers ...]
</system-reminder>Impact
Critical: SessionStart hooks are designed to inject context that the LLM needs to see automatically:
- Environment detection (YOLO container, production, etc.)
- Config validation warnings
- Project-specific context
- Workflow state restoration
Without this context reaching the LLM, handlers like yolo_container_detection, optimal_config_checker, and workflow_state_restoration are effectively non-functional.
Evidence
- User sees the output: The full context is displayed in the terminal when the session starts
- LLM doesn't see it: Only the "success" status message appears in system reminders
- Documentation promises it: SessionStart is explicitly listed as an exception where stdout goes to the LLM
Handlers Affected
In this project's configuration:
yolo_container_detection- Environment detectionoptimal_config_checker- Settings validationworkflow_state_restoration- State restorationversion_check- Version warnings
All return context via HookResult.context but the LLM never receives it.
Reproduction
- Enable SessionStart handlers that return context
- Start a Claude Code session
- Observe that LLM only sees "success" status, not the actual context
- Check terminal output - user sees the full context
Expected Fix
Claude Code should format SessionStart hook responses to include the full context/stdout in system reminders, matching the documented behavior and matching how UserPromptSubmit hooks work (which do show their context).
Environment
- Claude Code: Latest (CLI in container)
- Hooks daemon: v2.8.0
- Platform: Linux (Fedora 42, Podman container)