Add --init-commands flag to execute slash commands at session startup
Resolved 💬 3 comments Opened Apr 15, 2026 by kris2c9 Closed Apr 18, 2026
Problem
When launching an interactive session, there's no way to pre-execute slash commands like /rename, /color, /model, etc. Users who want a named/coloured session have to launch claude, wait for the TUI, then manually type the commands.
The existing -n / --name flag sets the session's internal name but doesn't trigger the visual prompt-bar tag and colour that /rename produces — so even that partial workaround isn't equivalent.
Proposed solution
Add an --init-commands (or similar) flag that accepts one or more slash commands to run before the first user turn:
claude --init-commands "/rename auth-refactor" "/color blue"
Alternatively/additionally, make -n/--name also trigger the visual tag/colour behaviour that /rename does, for parity.
Why this matters
- Scripted/templated launches (wrapper shell functions, project-specific aliases)
- tmux/iTerm session layouts that launch multiple pre-configured Claude instances
- Reproducible session setup across team members
Related
- #47679 — requests programmatic access to
/renameand/colorfrom tools/skills (runtime angle; this issue covers the CLI launch angle)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗