[FEATURE] /color command: support arbitrary hex colors (terminals already support truecolor)

Status Open
Maintainer reply None cached
Activity 3 comments · opened Sep 27, 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

Reposting https://github.com/anthropics/claude-code/issues/74447 after this was closed as "stale" which it is not.

Summary

The /color command currently accepts only 8 named colors: red, blue, green, yellow, purple, orange, pink, cyan, default. Modern terminals (VS Code integrated terminal, iTerm2, Ghostty, Kitty, WezTerm, Alacritty) all support 24-bit true color via COLORTERM=truecolor. The named-color limitation is a CLI UI decision, not a terminal constraint.

Use case

In multi-agent projects where multiple Claude Code sessions collaborate on the same repo, each session gets a persistent identity — a name and a color stored in a project config file. The hex color is the canonical identifier used in documentation, rendered surfaces, and session provenance tracking.

The current 8-color palette forces lossy quantization: two sessions whose canonical colors are #B45309 (amber) and #78716C (warm stone gray) both map to orange, producing a collision that defeats the purpose of per-session color identity.

Proposed change

Accept hex colors in /color:

/color #78716C

Detection: if the argument starts with # and is a valid 6-digit hex color, use 24-bit ANSI escape sequences (\033[38;2;R;G;Bm) to render it. Named colors continue to work unchanged.

Graceful degradation: if COLORTERM is not truecolor or 24bit, fall back to nearest named color (existing behavior) and optionally warn: Terminal does not support truecolor; using nearest approximation: orange.

Implementation sketch

if (arg.startsWith('#') && /^#[0-9a-f]{6}$/i.test(arg)) {
  const r = parseInt(arg.slice(1,3), 16)
  const g = parseInt(arg.slice(3,5), 16)
  const b = parseInt(arg.slice(5,7), 16)
  if (process.env.COLORTERM === 'truecolor' || process.env.COLORTERM === '24bit') {
    setSessionColor(`\x1b[38;2;${r};${g};${b}m`)
  } else {
    setSessionColor(nearestNamedColor(r, g, b)) // existing fallback
  }
}

Expected behavior after fix

/color #78716C     → session renders in warm stone gray  
/color orange      → unchanged, still works
/color #xyz        → error: "Invalid hex color"

Environment

  • macOS, VS Code integrated terminal + iTerm2
  • COLORTERM=truecolor confirmed in both

Proposed Solution

I filed this once before.

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

3 Comments

jlumbroso · 17 days ago

Don't close this one as stale like you did https://github.com/anthropics/claude-code/issues/74447

akaddo97 · 9 days ago

+1. Same need at a larger scale: I run a dozen or more named Claude Code sessions in one repo, each with a fixed role. With eight colours, several roles have to share one, so the colour no longer tells me which session I'm looking at.

One addition: the color field in .claude/agents/*.md frontmatter takes the same eight names. If it accepted the same hex values as /color, an agent's colour could be defined once and match everywhere that agent appears.

jlumbroso · 8 days ago

+1 — same need, bigger numbers: Most of my projects run 10–30 named sessions with fixed roles. Eight color names stopped being an identity system for me a long time ago.

What I use today: Each repo has a small registry file that owns every session's identity — name, role, session UUID, and a color_hex defined once and read by everything downstream (several of the eight names aren't valid tmux colors anyway, so hex is the only value that survives everywhere). Live example in a fully-open project: https://github.com/jlumbroso/moreover/blob/main/docs/inbox/agent-sessions.json — the screenshot on my profile shows it driving a Claude + GPT pair side by side.

The tooling around that registry is on PyPI if it's useful: pip install adrs4ai-pneumatic — mind the full name; bare pneumatic is someone else's unrelated package (the CLI itself is still pneumatic). Docs: https://adrs.systems/pneumatic. The two verbs that matter at your scale: pneumatic pulse (one-line health check across every registered session) and pneumatic last <name> (a session's recent messages, with per-message model attribution — catches silent model substitutions). MIT; works with Claude Code and Codex CLI side by side; and pneumatic skill install drops an operating skill into .claude/skills/ so your sessions can drive it themselves. Fair warning: Reference docs are solid, user guides are still being written.

That said, your actual proposal is the piece only Anthropic can do — color: in agents/*.md accepting the same hex as /color — strong +1: it would collapse the definition to one place for the in-editor side too.