Per-surface theme switching for AI CLI tools in Ghostty.
Launch claude and your terminal goes light. Launch codex and it goes dark. Exit, and everything resets. Other windows and tabs are untouched.
Ghostty supports OSC escape sequences that change terminal colors per-surface (window, tab, or split). This tool:
- Reads your config to find which AI tool maps to which theme
- Parses Ghostty's own theme files to extract the color palette
- Generates zsh wrapper functions that apply the theme on launch and reset on exit
The theme switch is instant, per-pane only, and cleanup is guaranteed even if you Ctrl+C — thanks to zsh's always block (the shell equivalent of try/finally).
- Zero friction — just type
claudeorcodexas usual, themes apply automatically - Any Ghostty theme — uses Ghostty's 400+ built-in themes directly, no duplication
- Per-surface only — other windows, tabs, and splits keep their colors
- Guaranteed reset —
alwaysblock restores your default theme even on interrupt - YAML config — simple tool-to-theme mapping, add any CLI tool you want
- No dependencies — pure zsh + awk, nothing to install beyond the script
brew tap matthewod11-stack/homebrew-tools
brew install ghostty-ai-themesThen add to your ~/.zshrc:
source "$(brew --prefix)/share/ghostty-ai-themes.zsh"git clone https://github.com/matthewod11-stack/ghostty-ai-themes.git ~/.config/ghostty-ai-themesAdd to your ~/.zshrc:
source ~/.config/ghostty-ai-themes/ghostty-ai-themes.zshCreate your config file:
mkdir -p ~/.config/ghostty-ai-themes
cp config.example.yml ~/.config/ghostty-ai-themes/config.ymlEdit ~/.config/ghostty-ai-themes/config.yml:
tools:
claude:
theme: "Selenized Light"
codex:
theme: "Black Metal (Burzum)"
gemini:
theme: "Dracula"
aider:
theme: "Gruvbox Dark"Theme names must match Ghostty theme files exactly (case-sensitive, spaces allowed).
# macOS
ls /Applications/Ghostty.app/Contents/Resources/ghostty/themes/
# Linux
ls /usr/share/ghostty/themes/Ghostty ships with 400+ themes. Any of them work here.
- Ghostty terminal emulator
- zsh
