07 August 2026

Claude Code: What /color Actually Does (and How to Auto-Set It at Startup)

I run two Claude Code sessions side by side — one on my personal subscription, one on a work account — and I wanted a quick visual cue to tell them apart. The obvious candidate was /color, which I assumed was the theme picker. It isn't, and the actual mechanism is a bit more interesting.

What /color does

/color sets the colour of the prompt bar — the horizontal separator lines and cursor at the bottom of the TUI — for the current session. The valid values are red, green, blue, yellow, cyan, magenta, orange, purple, pink, teal, coral, lime, navy, olive, violet, white, and default. It's session-scoped: there's no settings key, no --color launch flag, and the value isn't written to settings.json or .claude.json. It lives in an internal per-session-id store and disappears when the session does.

The resolution order is: value set by /color → colour from the active agent definition → default. For a normal (agentless) session the only lever is /color.

One quirk: /color is interactive-only. Running claude -p "/color green" returns "/color isn't available in this environment." So if you want it set automatically, you have to inject it as the initial prompt at launch.

The setup

My two accounts are launched via shell functions in ~/.bashrc. The personal account starts a persistent personal tmux session; the work account (which uses CLAUDE_CONFIG_DIR=~/.claude-work, set by a wrapper script at ~/.local/bin/claude-work) starts a work session.

One gotcha I ran into: I had alias claude='claude --chrome' in ~/.bash_aliases, which was silently breaking the function definition in interactive shells — bash expands the alias before parsing claude() {, making it invalid syntax. bash -n doesn't catch this because alias expansion only happens in interactive mode. The fix is unalias claude before the function definition and baking --chrome directly into the function.

unalias claude 2>/dev/null
claude() {
  if [ ! -t 1 ]; then
    command claude --chrome "$@"
  elif [ -n "$TMUX" ]; then
    if [ $# -eq 0 ] && [ "$(tmux display-message -p '#S' 2>/dev/null)" = "personal" ]; then
      command claude --chrome '/color green'
    else
      command claude --chrome "$@"
    fi
  else
    tmux has-session -t personal 2>/dev/null || tmux new-session -d -s personal "command claude --chrome '/color green'"
    tmux set-option -t personal status-style "bg=colour2,fg=black"
    tmux attach-session -t personal
  fi
}
claude-work() {
  if [ ! -t 1 ]; then
    command claude-work "$@"
  elif [ -n "$TMUX" ]; then
    if [ $# -eq 0 ] && [ "$(tmux display-message -p '#S' 2>/dev/null)" = "work" ]; then
      command claude-work '/color red'
    else
      command claude-work "$@"
    fi
  else
    tmux has-session -t work 2>/dev/null || tmux new-session -d -s work "command claude-work '/color red'"
    tmux set-option -t work status-style "bg=colour1,fg=white"
    tmux attach-session -t work
  fi
}

The logic: non-interactive → pass straight through. Inside the named tmux session with no arguments → inject the colour as the initial prompt. Outside tmux → create the session detached if it doesn't exist, set the tmux status bar colour, then attach. Arguments are passed through unchanged so the prompt slot is never clobbered.

The injection works because /color is declared immediate in the CLI's command registry, so it dispatches before anything is sent to the model. Verified with a detached pane capture:

tmux new-session -d -s ctest "command claude --chrome '/color green'"
sleep 10
tmux capture-pane -t ctest -p
tmux kill-session -t ctest

Output included Session color set to: green before the first prompt appeared.

What it looks like

The before — no colour, no tmux:

Before: uncoloured Claude Code session

Personal subscription — green Claude borders, green tmux status bar:

Personal session: green

Work account — red Claude borders, red tmux status bar:

Work session: red

The /color feature colours the horizontal separator lines around the prompt area (visible in the Claude TUI itself). The tmux status bar at the very bottom is a separate thing — it appears because the sessions now live inside named tmux sessions, and its colour is set independently with tmux set-option ... status-style. They happen to match, which is the point.

Caveats

There's no native way to set a per-account default colour in Claude Code v2.1.187 — no settings key, no CLI flag. The startup-injection approach covers the common cases, but if you pass a prompt directly (claude "do X"), the injection is deliberately skipped. Run /color green manually if needed.

The tmux set-option call runs every time you launch from outside tmux, so reattaching to an existing session will re-apply the colour — which is useful if you've changed it mid-session.

References

  • Claude Code v2.1.187 — the CLI and TUI
  • tmux 3.4 — new-session, has-session, set-option status-style, attach-session

Ta ta for now and I hope you found this helpful.