Automatic light/dark theme selection?
Resolved 💬 49 comments Opened Jul 4, 2025 by djsavvy Closed May 31, 2026
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?
49 Comments
Yes I agree with this. Even when the theme is changed sometimes I have to exit claude code and restart which is not ideal
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
This is much needed as non highlighted syntax becomes unreadable when theme mode does not match
<img width="315" height="161" alt="Image" src="https://github.com/user-attachments/assets/139ca3e2-3393-455d-8f49-36495f2c2b6e" />
Totally agree with this, Claude Code is almost unreadable for me when the terminal is in light mode 🤕
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.
fwiw, here's what i do on my vimrc and similar on my powerline:
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
It has become a major issue now with Claude 2.0.
<img width="406" height="198" alt="Image" src="https://github.com/user-attachments/assets/d896a2fb-8b75-45c0-a79e-3e37c91f0422" />
me too, on maoos terminal app
Another vote for this.
Is there at least a way to force the theme with
--themeorCLAUDE_THEME?+1 for this 🙏
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)
https://github.com/nushell/nushell/issues/15227#issuecomment-2699805815
Same issue here
<img width="201" height="118" alt="Image" src="https://github.com/user-attachments/assets/4192222d-c17a-4609-b3a0-b52aced4ddae" />
my current workaround: https://github.com/durandom/dotfiles/commit/29c6a04db06fd1f09a4924541abbeb469ebfdc25
obviously heavily bound to macos and wezterm.
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.
This is still the most noticeable friction point I have with claude code.
Any progress here?
+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
/themewhen my OS/terminal switches theme, or b) don't have my OS/terminal auto-switch themes. Both of these options are unsatisfactory.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
+1 for this
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.
Another vote for this. For implementation, OSC 11 (query terminal background color) is probably the most reliable cross-platform approach. The terminal responds with the current background RGB values, and you can derive light/dark from the luminance. This works regardless of OS — it queries the terminal directly, so it handles macOS, Linux, remote SSH sessions, etc.
Helix recently merged this approach: https://github.com/helix-editor/helix/pull/14356
Other tools that use it:
bat,delta,vim(via&background).For mid-session switching, Claude Code could also listen for SIGWINCH (which terminals like Ghostty, iTerm2, and WezTerm send when the theme changes) and re-query OSC 11 at that point.
Yep, +1 and OSC is the way to do this. Neovim uses it as well.
+1 would love to have this (I have dark mode in IDE and light mode in terminals otherwise)
+1 I have to always manually switch between dark and light with my terminal switching automatically for day and night shifts
Please pretty please, just put an agent on it 🙏🏼 half the time i can't see parts of the code because i can't even change the theme if it's already working on something (and if i send
/themeit thinks its LLM input!)If Claude code was open source a community member would have fixed by now (probably using Claude code to to it).
Issues like this are why opencode is probably gonna win long term.
I would really like to see this implemented 🥲
<img width="736" height="924" alt="Image" src="https://github.com/user-attachments/assets/7457a18d-f340-43cc-baf8-06b44f70734b" />
It's wild to me, that such a basic thing is not done in 2026 out-of-the box. Claude Code uses React to render a CLI. Maybe the tech stack is too complicated for an if statement to switch between two colour palettes? Why isn't Claude just following whatever term colours I have in the shell? Just grab my "green", "foreground" et cetera and go.
Adding another +1. Ghostty already handles this natively with
theme = light:Light Theme,dark:Dark Themein config – it watches system appearance and switches instantly. Claude Code is one of the few terminal tools I use that requires manual/themetoggling.A
"theme": "auto"setting in~/.claude.jsonthat listens forAppleInterfaceThemeChangedNotificationon macOS (and the equivalent on Linux) would close this gap. The community has built LaunchAgent workarounds like claude-theme-sync, but they can only update the config file – they can't affect a running session, which is the whole point.I don't think we have the technology to automatically switch the theme. It's too complicated and there are too many moving pieces. I think it's hard enough running the game engine that powers claude code at 60 (!) fps.
Wow! This is mind blowing! I must be dreaming. Honestly it's hard to believe... it's just that hard of a problem. Actually I don't believe. No. No this is too hard of a problem to solve before AGI.
All the technology is readily available, and it probably wouldn't take Claude even long to implement it themselves.
https://contour-terminal.org/vt-extensions/color-palette-update-notifications/
Would love to see this. I switch between light and dark throughout the day and manually running /theme every time is annoying. An auto/system option would be great.
+1. macOS exposes this via
AppleInterfaceStyle, and terminals like Ghostty already supportdark:X,light:Ytheme declarations. Claude Code is the only terminal tool I use that requires manual/themetoggling when the OS switches appearance.See also #11813 and #16769, both closed as duplicates without linking here or to #1302.
A
Notificationstart hook can detect the system theme and adjust:Note: the hook can detect the system theme, but Claude Code doesn't currently expose a theme-switching API. The detection result can be used by statusLine scripts or terminal profile switchers (e.g.,
tmux set-option -g status-bg).https://github.com/antonioacg/claude-code-theme-patch
I had Claude write a self-contained patcher that hooks rendering:
You can use it by setting
NODE_OPTIONS="--import /path/to/this.js"before running claude. Obviously you should change the command it runs (currently AppleScript) to get the system theme.I really need this. Imagine paying over 300 dollars for a software without auto dark mode. My optometrist would love this though
I'm building a CLI tool (the-themer) that switches themes across terminal apps in one command — Ghostty, bat, delta, fzf, starship, neovim, etc. For Claude Code, the only option is writing
"theme": "dark"or"theme": "light"directly to~/.claude.jsonvia sjson.This works for new sessions but doesn't live-update running ones. Every other app in the chain picks up the change immediately (Ghostty watches its config, neovim gets a Themery call, fzf reloads on next prompt). Claude Code is the one holdout that requires a restart.
An env var (
CLAUDE_THEME), a CLI flag (--theme), or just reliably watching~/.claude.jsonfor external changes would all unblock this. Any of those would let theme-switching tools treat Claude Code like every other terminal app.They shipped it
They did, but you can't choose which themes it's switching, so if you like ANSI colors light/dark themes (like I do), you are out of luck.
It does nothing in Alacritty
Filed a focused follow-up for the accessibility gap left open by v2.1.111's
autotheme: #50179. Currentautodoesn't compose with the daltonized or ANSI palettes, so colorblind users still can't get ambient light switching.Finally 👏
<img width="1042" height="708" alt="Image" src="https://github.com/user-attachments/assets/327c8d9f-0370-44dc-9f40-d3d76eba4eb5" />
does not seem to work inside tmux
For anyone using WezTerm on macOS, I built a workaround that achieves real-time dark/light auto-switching (not just at startup):
https://gist.github.com/Weniverse-git/f63794a5cc41dec2d1114da828769d08
How it works
window-config-reloadedevent fires when macOS appearance changes.~/.claude/themes/<name>.json) with{"base":"dark"}or{"base":"light"}.End result: toggle macOS appearance → Claude Code colors switch instantly, in sync with the terminal.
Requires
Caveats
auto-theme that re-detects on appearance change would still be much cleaner.Hope this helps someone until a native solution lands.
Wow, this issue has been quite an adventure! It seems to be solved for me; thanks to the Anthropic team for adding support. Closing this issue feels like the end of an era :D