[FEATURE] SessionStart hook should expose model and support programmatic session theming (color + name)

Resolved 💬 3 comments Opened Apr 10, 2026 by kbarkins Closed Apr 14, 2026

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

Power users running multiple concurrent Claude Code sessions across different models (Sonnet, Opus, Haiku) have no way to visually distinguish them at a glance. The /color and /rename commands exist but require manual invocation every session. When switching contexts frequently — e.g., Opus for architecture, Sonnet for implementation, Haiku for quick lookups — the cognitive overhead of manual theming defeats the purpose.

There is currently no workaround that is fully automatic. Manual /color and /rename per session, or a wrapper shell function that uses --name for the name half but cannot set color.

Proposed Solution

Two complementary changes:

  1. Expose model in SessionStart hook output (already done — confirmed via testing)

The SessionStart hook already receives "model": "claude-sonnet-4-6" in its stdin JSON. This is the right foundation. No change needed here.

  1. Add sessionColor and sessionName to hook output JSON

Allow SessionStart hooks to return a JSON response that sets session display properties:

{
"sessionColor": "purple",
"sessionName": "SONNET — my-project"
}

Supported colors would mirror the existing /color command palette.

  1. Add --color CLI flag (parallel to existing --name)

The --name / -n flag already exists for setting session name at startup. Add a --color flag for parity:
claude --model claude-sonnet-4-6 --name "SONNET" --color purple

What this unlocks
With these two additions, users can write a SessionStart hook that fully automates session theming:

#!/bin/bash
# ~/.claude/hooks/session-theme.sh
INPUT=$(cat)
MODEL=$(echo "$INPUT" | jq -r '.model // "unknown"')
case "$MODEL" in
sonnet) COLOR="purple"; PREFIX="SONNET" ;;
opus) COLOR="yellow"; PREFIX="OPUS" ;;
haiku) COLOR="green"; PREFIX="HAIKU" ;;
*) COLOR="blue"; PREFIX="CLAUDE" ;;
esac

echo "{\"sessionColor\": \"$COLOR\", \"sessionName\": \"$PREFIX\"}"

And register it in ~/.claude/settings.json:

{
"hooks": {
"SessionStart": [
{
"type": "command",
"command": "~/.claude/hooks/session-theme.sh"
}
]
}
}

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

Power users running multiple concurrent Claude Code sessions across different models (Sonnet, Opus, Haiku) have no way to visually distinguish them at a glance. The /color and /rename commands exist but require manual invocation every session. When switching contexts frequently — e.g., Opus for architecture, Sonnet for implementation, Haiku for quick lookups — the cognitive overhead of manual theming defeats the purpose.

Additional Context

  • /color and /rename already work mid-session via slash commands — this request is purely about automating them at session start based on model
  • The model field is already present in SessionStart hook stdin (confirmed), so the detection half is solved — only the response half is missing
  • The --name flag precedent already exists, making --color a natural extension
  • Session color is currently a transient UI-only property with no programmatic interface; making it hookable would also enable team-wide consistent theming via shared hook configs
  • Relevant to users running worktree-based multi-session workflows where visual distinction is critical for avoiding context switches to the wrong session

View original on GitHub ↗

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