A soft Matrix rain behind iTerm2, reacting to Claude Code.

A Matrix color theme for iTerm2 with animated digital rain drawn behind your text. The rain changes color as Claude Code works, waits for you, fails and finishes.

View on GitHub

Free · MIT license · macOS · iTerm2 3.5+ · Python 3.10+

Four iTerm2 windows running Claude Code over the Matrix rain. Working: bright green rain while a test runs. Waiting: amber rain behind a permission prompt. Error: crimson rain after a failed test run. Done: cyan-white rain after the tests pass.

Sample mock. One rain, four moods: working, waiting, error and done.

What you get

Install

  1. Turn on iTerm2's Python API: Settings > General > Magic > Enable Python API.
  2. Clone and install, with auto-start:
    git clone https://github.com/dharmaje/iterm2-matrix-rain.git
    cd iterm2-matrix-rain
    ./install.sh --install --autolaunch
  3. Add the Claude Code hooks (next card).
  4. Pick the Matrix profile. Set it as the default, or apply it to the current session:
    /Applications/iTerm.app/Contents/Resources/utilities/it2 profile apply Matrix

The installer checks macOS, iTerm2 and Python first and prints a table. It asks before upgrading a package. If a minimum is missing, it stops and writes nothing.

Claude Code hooks

Print the hook entries, then merge them into ~/.claude/settings.json next to any hooks you already have.

./install.sh --hooks

Each hook sends a one-line state event to the daemon over a local socket. It prints nothing to Claude and always exits cleanly.

States

StateRainWhen
idleDeep dim green, slow, sparseSession start
workingBrighter green, faster, denserPrompt submitted, tool running
waitingAmber, slowClaude needs input or permission
errorMuted crimson for about 4 sA tool or turn failed
doneCool cyan-white for about 4 s, then idleClaude finished
offFades outSession end
One large iTerm2 window in the working state: a Claude Code session reads, updates and tests a file over bright green rain.
Sample mock of the working state.

Camera motion (optional, off by default)

Install the optional packages, enable the camera, then restart the daemon:

./install.sh --camera
.venv/bin/matrix-rain camera enable

To turn it off, disable it and restart the daemon:

.venv/bin/matrix-rain camera disable

To fill the moving shape instead of outlining it, set this in ~/.config/iterm2-matrix-rain/config.toml:

[camera]
shape = "fill"   # default "outline"

The Matrix profile's status bar includes a clickable camera on/off item. Click it to switch the camera; the setting is saved.

A large iTerm2 window in the working state.  Behind the Claude Code text, the rain draws a gold outline of a head and shoulders where a figure moved.
Simulated mock from the built-in synthetic motion source, not a camera.

Shortcut aliases (suggested)

The scripts/ folder has four zsh helpers. Add these lines to ~/.zshrc with your clone's path, then open a new shell.

alias matrix-on='~/iterm2-matrix-rain/scripts/enable-matrix-profile.zsh --run'
alias matrix-off='~/iterm2-matrix-rain/scripts/disable-matrix-profile.zsh --run'
alias matrix-camera-on='~/iterm2-matrix-rain/scripts/enable-camera.zsh --run'
alias matrix-camera-off='~/iterm2-matrix-rain/scripts/disable-camera.zsh --run'

Editing the Matrix profile

The Matrix profile is an iTerm2 Dynamic Profile marked rewritable: edits you make in Settings > Profiles > Matrix, such as adding a battery item to the status bar, are saved into its file. Without that mark, iTerm2 shows a “Changes Will Be Lost” dialog and discards the edit.

If a change breaks it, put the repo's profile back or restore a saved copy:

scripts/reset-matrix-profile.zsh --run
scripts/reset-matrix-profile.zsh --run ~/.cache/iterm2-matrix-rain/profile-backups/<file>.json
scripts/enable-matrix-profile.zsh --run

If a Settings dialog will not close, quit iTerm2 (⌘Q, or Force Quit with ⌥⌘Esc). Shells inside tmux keep running; reattach with tmux attach -t <name>. ./install.sh --uninstall removes everything.

Configure

Put overrides in ~/.config/iterm2-matrix-rain/config.toml. Keys you leave out keep their defaults. The daemon reads the file at start. The README lists every key.

[daemon]
fps = 6.0      # frames per second, focused window
blend = 0.6    # higher shows more rain

[update]
auto = false   # turn off self-update

Uninstall

From the clone:

./install.sh --uninstall

Then remove the hook entries from ~/.claude/settings.json.

Feedback

Bug reports and ideas are welcome. Include your macOS, iTerm2 and Python versions.