[FEATURE] Let the `auto` theme switch between a custom light theme and a custom dark theme
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
Since 2.1.111 the auto theme follows the terminal's light/dark background, which is exactly right for people whose terminal follows the OS appearance (macOS "Auto" appearance + iTerm2 with separate light/dark colors).
But auto can only choose between the built-in light and dark presets. It never selects the daltonized presets, and custom themes in ~/.claude/themes/*.json have a single base, so they can never take part in the switch either.
That makes the two features mutually exclusive: any custom color (for example a different userMessageBackground, or simply wanting the daltonized variants) means giving up automatic switching. The workarounds don't really work:
- a running session does not pick up a
themechange written tosettings.jsonfrom outside (observed on 2.1.263 and 2.1.266), so an external appearance watcher only affects sessions started afterwards; - switching by hand with
/themeevery morning and evening, in several sessions that run 10+ hours across sunset, is tedious and easy to forget.
Proposed Solution
Let auto switch between an explicit light/dark pair. Any of these shapes would solve it:
- Settings keys next to
"theme": "auto", e.g."themeLight": "custom:my-light"and"themeDark": "custom:my-dark", defaulting tolight/darkas today. Built-in names such aslight-daltonized/dark-daltonizedshould be accepted too. - A custom theme file with a
lightand adarksection (each with its ownbaseandoverrides) thatautoswitches between. - Smallest version: allow
"base": "auto"in a custom theme, applying the sameoverrideson top of whichever built-in themeautoresolves to.
Switching should stay live, as auto is today, and /theme should list such themes.
Alternative Solutions
/themeby hand twice a day.- A launchd/cron job that rewrites
themeinsettings.jsonwhen the OS appearance changes: only new sessions get it, running ones keep the old theme. - The
light-ansi/dark-ansibases, which take colors from the terminal palette that iTerm2 already switches: the 16 ANSI slots are shared with every other program, so repurposing one for a UI background breaks other tools.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
- macOS is set to Auto appearance; iTerm2 uses separate light and dark colors and follows it.
- I want a light-blue background behind my own messages in the light theme (the built-in gray is low contrast for me) and the default dark theme at night.
- With this feature I would set
themeLight: custom:light-blueandthemeDark: darkonce, and Claude Code would follow the terminal all day, including in sessions that stay open across the switch.
Additional Context
- Claude Code 2.1.266, macOS 26, iTerm2 3.6.11.
- Related: #55569 (custom user-message background, now possible through custom themes but not together with
auto), #39369 (respect the terminal ANSI palette), #11813 / #16769 (auto theme, shipped in 2.1.111).