claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Automatic light/dark theme selection?

Open djsavvy opened this issue 7 months ago • 19 comments

Like many others, I have my terminal switch automatically between light and dark mode, following the system theme.

However, I have to manually adjust my Claude Code theme every time. Sometimes I forget until I notice blank spots in the output (i.e. unreadable text).

Is it possible for the theme to switch automatically?

djsavvy avatar Jul 04 '25 16:07 djsavvy

Yes I agree with this. Even when the theme is changed sometimes I have to exit claude code and restart which is not ideal

cgaaf avatar Jul 13 '25 17:07 cgaaf

Or have a mode will claude uses standard terminal colors so that people using terminal color schemes (like solarized dark and light) will just work out of the box

drichardson avatar Jul 20 '25 04:07 drichardson

This is much needed as non highlighted syntax becomes unreadable when theme mode does not match

Image

sam3k avatar Jul 29 '25 10:07 sam3k

Totally agree with this, Claude Code is almost unreadable for me when the terminal is in light mode 🤕

phaberest avatar Aug 01 '25 15:08 phaberest

Very very much want this. And it's bad because if you try to switch while in CC it doesn't work, you have to exit and restart CC for it to even take effect.

joeldrotleff avatar Aug 14 '25 04:08 joeldrotleff

fwiw, here's what i do on my vimrc and similar on my powerline:

if system('defaults read -g AppleInterfaceStyle') == "Dark\n"
  set background=dark
  let ayucolor="dark"
else
  set background=light
  let ayucolor="light"
endif  
function powerline_precmd() {
  local __ERRCODE=$?
  local __THEME="system-$(defaults read -g AppleInterfaceStyle >/dev/null 2>/dev/null && echo "dark" || echo "light")"
 ...

it's kinda jankety and i haven't thought about it in a long time, but if it proves too hard to support all OS/terminal combinations first-party, I wonder if something like a precmd hook which can run some logic and update config accordingly on-the-fly would work? And just leave it up to users to configure appropriately for their system and themes

rpadaki avatar Sep 29 '25 19:09 rpadaki

It has become a major issue now with Claude 2.0.

Image

antonioacg avatar Sep 30 '25 11:09 antonioacg

It has become a major issue now with Claude 2.0.

Image

me too, on maoos terminal app

ace-express avatar Oct 01 '25 14:10 ace-express

Another vote for this.

goshatch avatar Oct 02 '25 11:10 goshatch

Is there at least a way to force the theme with --theme or CLAUDE_THEME?

NightMachinery avatar Oct 07 '25 22:10 NightMachinery

+1 for this 🙏

humberaquino avatar Oct 16 '25 21:10 humberaquino

Yeah this would be so nice, in case of technical uncertainty how to approach this, helix recently merged a pr for this: https://github.com/helix-editor/helix/pull/14356 (that might be a good start)

dvic avatar Oct 17 '25 05:10 dvic

https://github.com/nushell/nushell/issues/15227#issuecomment-2699805815

tby321 avatar Oct 31 '25 07:10 tby321

Same issue here

Image

asw28 avatar Nov 03 '25 17:11 asw28

my current workaround: https://github.com/durandom/dotfiles/commit/29c6a04db06fd1f09a4924541abbeb469ebfdc25

  • a script to set the theme
  • hook into wezterms auth theme switching

obviously heavily bound to macos and wezterm.

durandom avatar Dec 08 '25 08:12 durandom

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Jan 07 '26 10:01 github-actions[bot]

This is still the most noticeable friction point I have with claude code.

zerowidth avatar Jan 07 '26 13:01 zerowidth

Any progress here?

broccolism avatar Jan 14 '26 04:01 broccolism

+1 for this.

  1. Attempting to set theme via external scripts (including hooks) doesn't persist because CC manages ~/.claude.json internally and overwrites external changes
  2. CC's light theme shows invisible text when using a dark terminal theme. Vice versa also true. This absolutely requires that I either a) switch manually with /theme when my OS/terminal switches theme, or b) don't have my OS/terminal auto-switch themes. Both of these options are unsatisfactory.

charleseff avatar Jan 18 '26 19:01 charleseff

This is still the most noticeable friction point I have with claude code.

same here, and the bug exists for a long time now.

It is annoying to work around by manually specifying different scheme colors every time.

So, claude code does not yet support dark mode? :D

elhenro avatar Jan 19 '26 12:01 elhenro

+1 for this

dulev avatar Jan 21 '26 10:01 dulev

Really annoying this hasn't been implemented yet, the solution is simple: add an "auto" selection to the /theme command. Then, allow users to specify which theme is used for light vs dark.

advdrone avatar Jan 23 '26 21:01 advdrone