Use ANSI palette indices instead of hardcoded RGB for markdown rendering

Resolved 💬 3 comments Opened Apr 9, 2026 by kilianbarrera Closed Apr 13, 2026

Problem

Claude Code renders markdown elements (headers, links, URLs, hex color codes) using hardcoded 24-bit RGB escape sequences (\e[38;2;R;G;Bm) instead of ANSI palette indices (\e[34m).

This means users with custom terminal palettes have their color customizations completely ignored by Claude Code, while every other CLI tool (git, ls, etc.) respects them.

Reproduction

  1. Set your terminal's ANSI blue (palette slot 4) to any non-blue color (e.g. #07ffb5)
  2. Open Claude Code
  3. Observe that markdown headers #, links, URLs, and hex codes still render in blue
  4. Other CLI tools correctly show green (or whatever the palette maps to)

Affected terminals

Any terminal that supports palette customization: Ghostty, Alacritty, kitty, iTerm2, Windows Terminal, etc.

Proposed solutions (any of these would fix it)

  1. Use ANSI palette indices instead of direct RGB — this is the standard approach and respects user themes
  2. Add a theme or colors config in settings.json to let users override UI colors
  3. Add a CLAUDE_CODE_COLOR_SCHEME env var for quick switching (e.g. mono, green, default)

Context

Using Ghostty with a cyberpunk theme where all blues are remapped to green (#07ffb5). The entire terminal is cohesive except Claude Code's output, which forces blue regardless of palette settings.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗