[FEATURE] Add persistent session color setting
Status Open
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Mar 21, 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
Add a color setting in settings.json to persist the session prompt color across sessions.
Current Behavior
/color bluesets the color for the current session only- Color resets on new session
- No
colorsetting exists insettings.json
Proposed Solution
Add a color setting:
``json``
{
"color": "blue"
}
Supported values could match the current /color command options: blue, red, green, yellow, magenta, cyan, white, etc.
Use Case
Users who prefer a specific color (e.g., for visual distinction, accessibility, or personal preference) currently need to run /color <color> manually at the start of every session. A
persistent setting would eliminate this repetitive step.
Alternative Solutions
None currently available — the /color command is runtime-only and cannot be automated via hooks (hooks run shell commands, not internal slash commands).
Priority
Low - Nice to have
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
4 Comments
Related, perhaps a "session hook" could be used to set this up. That way, if I'm in a certain directory (e.g. a worktree), I could automatically set the color (and maybe /rename?) based on the worktree I'm using. Something similar to hooks could allow matchers or, for the original suggestion, just do it upon any session start.
Seeing lots of dupes of wanting a default color or to allow the assistant to alter the prompt color (me too!). #37749 has a more complete and helpful description of supporting a
defaultColor_only_ customization.However, a number of recently filed issues highlight a desire to persist a custom session _name_ as well as _color_ (e.g. across
/clearcommands) or to allow users to specify a default session name and color in settings*.json files. See #38649 and #39765 for examples.A
Notificationstart hook can set terminal colors based on project:Workaround: Automatic per-project terminal colors using hooks (macOS/Terminal.app)
I wanted different terminal colors depending on which project folder I launched Claude Code from, so I could visually distinguish sessions at a glance. Here's a hook-based solution that works today.
It's macOS/Terminal.app specific (uses AppleScript), but the pattern —
SessionStart/SessionEndhooks + a central config — is portable. You'd just swap theosascriptlines for your terminal's equivalent.Setup
1. Create a color config file (
~/.claude/terminal-colors.conf):Add as many entries as you need. First match wins, so put specific subpaths before parent paths.
2. Create the start script (
~/.claude/terminal-color-start.sh):3. Create the end script (
~/.claude/terminal-color-end.sh):4. Make them executable:
5. Add hooks to your user-level settings (
~/.claude/settings.json):Add the following
hookskey to your existing settings file. If you don't have one yet, create it with this content:How it works
$PWDagainst the config file and applies the matching colorTERM_SESSION_ID) and restored on exitterminal-colors.conf— no per-project settings neededTips
my-projects) below subpath entries so they act as fallbacks$PWDdoesn't match any entry, nothing changes — your terminal stays as-isLimitations
Would still love a native
colorsetting insettings.jsonas proposed in this issue, but this works well in the meantime.