Allow SessionStart hook output to display in terminal UI during launch
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Description:
When building project-specific agents with Claude Code, there's a common need to run initialization checks (VPN
connectivity, CLI authentication, API access, etc.) and display the results to the user as part of the startup
sequence -- the same way any CLI tool shows initialization status before accepting input.
Currently, SessionStart hook stdout is silently injected into Claude's context as a system reminder. The user
never sees it in the terminal. The only user-facing startup display mechanism is companyAnnouncements, which
only accepts static strings.
Proposed Solution
Add an optional display property to hook configuration that renders stdout in the terminal UI during launch,
similar to how companyAnnouncements are displayed:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/check-connectivity.sh",
"timeout": 30,
"display": true
}
]
}
]
}
}
When display is true, the hook's stdout would be rendered in the terminal UI during session startup (before the
user's first prompt), in addition to being injected into Claude's context. This preserves the existing context
injection behavior while also making the output visible to the user.
Alternative Solutions
Current workarounds and their limitations:
- CLAUDE.md instruction telling Claude to display the hook results in its first response -- requires the user
to send a prompt first, which is unintuitive. Initialization status should appear before the prompt, not after.
- Wrapper script that runs checks before launching claude -- works visually, but if checks fail the user is
outside Claude Code and can't prompt for help troubleshooting.
- stderr duplication in the hook script -- output is swallowed by the Claude Code UI.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Use case:
I'm building a shared Claude Code project for my team to manage cloud infrastructure (node reservations, VM
lookups, billing). The project requires VPN access, CLI tools, and valid auth tokens. I need colleagues to see
whether their environment is properly configured the moment they launch a session -- not after they've already
started typing requests. Every other CLI tool with prerequisites shows initialization status on launch. Claude
Code should support this too.
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗