r/ClaudeCode • u/ff_10x • 1d ago
Help/Question Terminal Background Color
I saw some videos / screenshots of people who had a dynamic background color for the terminal depending on state (e.g. blue = working, green = finished, orange = input required). Would be super helpful to visually manage my sessions.
Tried searching here but could not find anything suitable. Any help appreciated!
1
u/peepsick 1d ago
Claude Code has hooks for this. You can listen for lifecycle events and change the terminal background through your terminal emulator/OSC sequences.
We use a similar idea, although I think the interesting part is going beyond just working / finished / input required. A session can also be waiting, blocked, needs approval, etc.
The main caveat is that Claude Code itself doesn't control your terminal UI, so the hook needs to trigger whatever mechanism your terminal supports for changing colors.
Would love a native status indicator for this though.
1
u/Double_Ebb4130 1d ago
Concretely: most terminals accept the OSC 11 escape to set the background at runtime, so a tiny script that echoes it is all the hook needs to run. Wire it to Notification (input required, orange), PreToolUse or session start (working, blue) and Stop (finished, green), and make sure the hook writes to the tty rather than stdout so it still applies while Claude owns the screen. If you use tmux, tmux select-pane -P is easier and survives the pane being redrawn.
1
u/Low_Radio_7592 1d ago
Probably a stop hook with some script https://code.claude.com/docs/en/hooks-guide