SessionStart hook: support `sessionColor` output field to auto-set prompt bar color
Summary
Allow SessionStart hooks to set the session color programmatically via a new sessionColor field in hookSpecificOutput. This would let multi-repo or multi-environment workspaces automatically color-code sessions without requiring the user to manually run /color.
Motivation
/color is useful for distinguishing sessions at a glance, but today it's interactive-only. In a multi-repo workspace, the SessionStart hook already handles dynamic context injection (e.g., presenting a repo selection menu). The color assignment is a natural extension of that same flow — but there's no way to close the loop without manual user input.
Example use case: A workspace with 15+ repos uses a SessionStart hook to ask the user which repo to focus on. Based on the selection, the hook knows which color to apply — but can't act on it.
Proposed Change
Extend the hookSpecificOutput schema for SessionStart to accept an optional sessionColor field:
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "...",
"sessionColor": "green"
}
}
Accepted values would mirror /color: red, blue, green, yellow, purple, orange, pink, cyan, default.
Behavior
- If
sessionColoris set in hook output, apply it exactly as if the user had run/color <value> - If the field is absent, no color change (current behavior preserved)
- If the value is invalid, silently ignore (don't error the session)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗