GitHub - reynico/esp32-claude-lamp

GitHub

2 min read Original article ↗

demo

A physical RGB lamp that pulses when Claude Code needs your attention.

Hardware

  • ESP32-C3 dev board
  • Common anode RGB LED
  • 3× 150 ohms resistors

Wiring:

3.3V  →  LED common (anode)
GPIO0 →  150Ω  →  R
GPIO1 →  150Ω  →  G
GPIO2 →  150Ω  →  B

Firmware

  1. Open firmware/lamp/lamp.ino in Arduino IDE
  2. Select board: ESP32C3 Dev Module
  3. Set USB CDC on Boot: Enabled — serial won't work without this
  4. Flash to the board

Client

cd client
go build -o lamp .

Setup

1. Clone the repo somewhere permanent:

git clone https://github.com/reynico/claude-lamp ~/Documents/claude-lamp

2. Build the client:

cd ~/Documents/claude-lamp/client && go build -o lamp .

3. Find the serial port and save it:

./lamp --scan
mkdir -p ~/.config/claude-lamp
echo "/dev/cu.usbmodemXXXX" > ~/.config/claude-lamp/config

The port name is tied to the physical USB port. If you plug into a different port, update this file.

4. Add hooks to ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/Users/you/Documents/claude-lamp/client/lamp --notify"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/Users/you/Documents/claude-lamp/client/lamp --effect off"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/Users/you/Documents/claude-lamp/client/lamp --effect off"
          }
        ]
      }
    ]
  }
}

Use absolute paths to the compiled binary.

Usage

./lamp --notify              # pulse with color based on notification type (for hooks)
./lamp --effect pulse        # pulse orange
./lamp --effect on           # solid on
./lamp --effect off          # off
./lamp --color FF0000 --effect on   # solid red
./lamp --scan                # list serial ports