Gavel
A physical controller for Claude Code.
Why "Gavel"?
A judge's gavel makes decisions final — and here, the human is always the judge. Any keyboard could send the same keys, but a dedicated device makes you stop and think instead of hitting a key on autopilot. A ruling, not a reflex.
Input
Three physical buttons answer Claude Code's permission prompts (1 Allow Once / 2
Always Allow / 3 Reject) without touching the keyboard.
Output
LEDs light up in response to Claude Code hook events, giving real-time feedback on what Claude is doing.
How it works
The microcontroller runs two independent roles over a single USB cable:
- USB HID keyboard — pressing a button sends the matching keypress to the terminal. Claude Code receives it exactly as if the user typed it. No special Claude Code configuration needed.
- Serial listener — Claude Code hooks call Python scripts on the Mac side, which send small JSON messages over the microcontroller's USB serial port to control the LEDs.
| Hook | LED response |
|---|---|
PreToolUse |
All LEDs solid on |
PostToolUse |
All LEDs off |
Notification (info) |
Single slow flash |
Notification (warn) |
Three medium flashes |
Notification (error) |
Five fast flashes (red only) |
PostToolUse (context ≥ 90%) |
Three medium flashes, then off |
| Idle — Pico (KITT mode) | Night rider sweep |
| Idle — RP2040 Zero (KITT mode) | Blue breathing fade |
Setup
Getting started is straightforward:
- Install CircuitPython on your board
- Copy
firmware/boot.pyandfirmware/code.pyto theCIRCUITPYdrive - Copy
adafruit_hid/(all boards) andneopixel.mpy(RP2040 Zero only) toCIRCUITPY/lib/ - Power cycle the board (unplug and replug USB) so
boot.pytakes effect - Install the Mac-side dependency:
pip3 install pyserial - Wire buttons and LEDs per the hardware wiring guide
- Run
./install.sh --deployto register hooks in~/.claude/settings.json