[FEATURE] Allow /rename and /color to be set programmatically at session start
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
note: related issues #35378, #40393, #44245 exist but are stale or partial — this consolidates the use case
I run 10+ Claude Code sessions in parallel, each launched from its own Windows Terminal profile in WSL2. Every profile runs claude '/start-session' and opens a fresh, unnamed, uncoloured session. To make the sessions distinguishable I have to manually type /rename <project> and /color <colour> in every tab, every time.
The tab-title side of this is already a known WSL2 limitation — escape sequences from Claude Code subprocesses don't reach Windows Terminal, so the in-Claude session name is the only reliable identifier I can rely on. And I can't automate it.
There is currently no way to set the session name or colour from:
- project config (.claude/settings.json)
- a CLI flag
- a SessionStart hook
- a skill
- the initial prompt (claude '<prompt>' only dispatches one slash command — chaining /rename and /color after /start-session doesn't work; the second command gets consumed as text)
Proposed Solution
Any one of these would solve it. Listed in order of preference:
- Project config in .claude/settings.json:
{ "session": { "name": "manager", "color": "grey" } }
Cleanest, because the name and colour travel with the repo.
- CLI flags:
claude --session-name manager --session-color grey '/start-session'
- SessionStart hook output — let a hook emit a JSON directive that Claude Code applies (similar to how some hooks inject context).
Alternative Solutions
Tried and ruled out:
- SessionStart hook running shell commands — can't drive client-side UI commands like /rename.
- Custom skill (/start-session) — skills produce model tool calls; no tool can invoke /rename or /color.
- Chained slash commands in initial prompt — claude '/rename foo /color grey' treats everything after the first command as text. Confirmed by direct test.
- Manual /rename + /color after launch — current workflow, doesn't scale to 10+ tabs.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- I have Windows Terminal profiles for each of my projects: manager, oksitmgt, phoenix, flexilife, salesending, etc.
- Each profile launches claude '/start-session' in the project directory.
- I open 5–10 tabs at once at the start of the day.
- With this feature, each tab would already be named after its project and colour-coded by category (work = grey, personal = green, etc.) the moment it opens.
- Today I have to manually /rename and /color in every tab — ~30 seconds of friction per tab, every launch.
Additional Context
Related existing issues (mostly stale or partial — none cover the combined name + colour + project-config angle):
- #35378 — /rename settable via --name flag or hooks (stale)
- #40393 — --color CLI flag for session color
- #44245 — statusline scripts setting color and name via JSON control messages
- #47332, #44618, #36928 — project-level session colour config (duplicate / stale)
Environment: Claude Code CLI on WSL2 (Ubuntu 24.04) inside Windows Terminal, multi-project workflow.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗