[FEATURE] Let plugins set the session color without printing a /color echo
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
I use a plugin (a function-hooks mod) that gives every new session a random /color, so I can tell terminal windows apart at a glance. The only way a plugin can set the color is $.command.run({ command: 'color', args }), and that prints a ❯ /color green echo at the top of every new session.
A ui.render hook can hide the CommandOutput row ("Session color set to: green"), but the echo above it never goes through ui.render. A catch-all ui.render logger only ever sees the CommandOutput. Session color also isn't one of the rows in $.config.list(), and there's no CLI flag for it. So a plugin can't set the color without leaving that line in the transcript.
Proposed Solution
Any one of these would solve it:
- Expose session color as a writable
$.configrow (or on$.session), so a plugin can set it directly. - Draw the echo of plugin-originated commands through
ui.render(as aUserMessagewithorigin.kind: 'plugin'), so the plugin can hide its own echo. - Add a
silentoption to$.command.runfor commands with no output the user needs to see.
Alternative Solutions
Hiding the CommandOutput row works, but the echo stays. Typing /color by hand in each session avoids the echo problem but defeats the point of automating it.
Priority
Low - Nice to have
Feature Category
Developer tools/SDK
Use Case Example
- I open three Claude Code sessions in different terminal windows.
- The plugin gives each one a random color at session start.
- Today each session opens with
❯ /color pinkas its first transcript line. - With this feature, the color would be set and the transcript would start clean.
Additional Context
Claude Code v2.1.288, macOS. Related but different: #94797 (more /color options), #96295 (/clear resets /color).