A Keypad for a Dozen Claude Code Sessions

On most days I have ten or so Claude Code sessions open: one on this site, one on the home lab, one on the 3D printer, one on Cadabra. Each now and then stops to ask whether it may run a command, and the one asking is usually behind another window. When OpenAI and Work Louder announced Codex Micro, a $230 keypad for coding agents with keys that light up by agent state, I wanted one. Then I wanted my own: built around the sessions I actually run, and to my own design.

What it has to do, in order:

  1. Show at a glance which session is waiting for me, one light per session.
  2. Let me approve or deny without switching windows: the screen shows the exact command, and a real key answers it.
  3. Hold a key to talk, the way I hold a key for Cadabra.

Phase one, a breadboard that does the first two, is done.

Stepping through the sessions and approving one. The sessions are made up: the keypad isn't connected to real ones yet.

Software first

Before buying anything, I wanted to know whether the idea worked at all. Claude Code has hooks, commands it runs at points in a session: a prompt submitted, a tool about to run, a turn finished, permission needed. A permission hook can answer the request itself with allow or deny, and in the desktop app it runs alongside the usual dialog, so whichever answers first wins.

So the software came first: a small hook script that forwards every event, a daemon on the Mac that keeps each session's state and holds a permission request until something answers it, and a text "keypad" in a terminal to stand in for the real one. It passed 21 tests with fake hook events the night I planned it.

How it fits together: Claude Code sessions send hook events to a small hook script, which forwards them over localhost HTTP to the agentdeck daemon on the Mac. The daemon keeps each session's state and holds permission requests for up to 110 seconds, and talks to the keypad, a Raspberry Pi Pico with a touch screen, LEDs, keys and a knob, over USB serial. Keys come back with the request id. Below, the rule: approve counts only with the id on screen after 0.6 seconds; no keypad, no daemon, a terminal session, or a timeout means no answer and Claude Code's own dialog decides; there's no approve-all key.

A keypad that can approve commands has to fail safe, so most of the design is about when it doesn't answer:

  • Only a key press says yes. The keypad sends back the id of the request on its screen, and the daemon rejects it if that's no longer the open request. A new request has to be on screen for 0.6 seconds before a key counts, so a press meant for the previous one can't approve its replacement.
  • Anything else is no answer. No keypad, the daemon not running, a session in the terminal, or 110 seconds without a press: the hook exits without a word, and Claude Code asks me the usual way. A broken keypad should never mean a silent yes.
  • No "approve all" key, and nothing here touches a session's permission mode.

Then the firmware and the USB side of the daemon, still without hardware: the keypad and the Mac swap JSON lines over USB serial. The daemon only writes to a port after it has said hello, so it can't upset some other USB device. A fake keypad on a pseudo-terminal checked all of it.

A drawer of boards

The plan called for an Arduino Nano ESP32. On build day I opened the drawer instead, and Claude went through what came out of it, one board at a time:

  • An ESP8266 would work for a test, but has too few free pins for twelve keys and a screen, and can't act as a USB keyboard.
  • A board that wouldn't show up at all turned out to be an STM32F401 "Black Pill", invisible to a Mac until it's put into its bootloader.
  • A Pi Zero is a whole Linux computer: twenty seconds to boot and an SD card that dislikes losing power.
  • A FireBeetle ESP32 came with a lithium cell taped to it, and a warning to unplug that before touching a breadboard.
  • A Raspberry Pi Pico won. It has native USB, so it can be a keyboard as well as a serial port; 26 free pins with none that matter at boot, enough to give every key its own pin and skip the twelve diodes a key matrix needs; and its PIO hardware drives the LED strip's tight timing on its own.

The Pico also didn't show up at first. Three rounds of "try again" later, the answer was the oldest one: the micro-USB cable could charge but not carry data.

One part at a time

The rule for bring-up was to wire one thing, test it, then the next, so a fault could only be in the last step. Claude couldn't see the board, only what it reported over USB, so I was the eyes and it read the logs.

  • The screen stayed dark. My wiring was fine: the backlight setting was written the ESP32 way, which means nothing on a Pico. Once it lit, the first layout was a list with rows five millimetres tall, too small for a finger, so it became a grid of eight big tiles, one per session slot.
  • The LEDs, soldered into a chain with short wires, showed only the first one, blinking purple. Purple means "no Mac", but the Mac was connected. The firmware took the time before reading the serial port, so on a fast chip the last message could arrive "after now", and the subtraction wrapped around to a huge number. Reading first fixed it. The Pico now also flashes every LED red, green and blue at power-on, which tells you at once which ones work and whether their colour order is right.
  • The keys came through on the wrong pins: two of them one pin over. The firmware reports every key edge with its pin, so the log showed exactly which, and the cause was the wiring diagram Claude had drawn: its lines bunched together where they met the Pico, and there's a ground pin in the middle of that row. The diagram now names the pin at the end of each wire and says to count the Pico's pins, not the breadboard's columns.
  • The knob worked the first time.
  • The colours were inverted, which the tiles made obvious: "waiting" should be orange and came out blue. That panel needs one flag set.

By the afternoon every part had passed, and the keys were answering made-up permission requests with the right request id.

The phase-one breadboard: a 3.5-inch screen showing a grid of session tiles (two waiting for approval, one working, one done, one idle, one with an error) and the command to approve, a Raspberry Pi Pico on a breadboard with a nest of jumper wires, a knob, and a chain of four LEDs lit orange, green, red and a pale blue.

The breadboard at the end of phase one. From the wire end, the LEDs show the selected session's state (orange: waiting), Approve, Deny, and a dim Talk.

Measuring things

The screen's maker was easy to find, and so was a drawing with its dimensions. Claude used it, and I told it to use my numbers instead: anything that has to fit should be designed around the part on my desk. Then my ruler and I disagreed with ourselves for a while, from 106 mm to 98 for the board, and from 101 mm to 91 for the screw holes. What settled it was a 1:1 drawing printed on paper with a 100 mm line to check the scale: I laid the screen on it, and the holes were 92 mm apart. That happens to be the drawing's number. Either way, the paper was the measurement I could trust, and every part since has had one: the case's top plate, the keycap, the screen frame.

Toward a case

The full keypad is designed but not built. It's a 118 × 129 mm case tilted six degrees, with the screen at the top and, below it, the knob, six session keys, Deny, Approve, Interrupt, and a double-width Talk key. The keys are brown MX switches with clear housings. Each switch has an LED underneath, held in a printed tray, so its light shines up through the switch and a clear keycap. Nothing on the market fit the double-width key, so it's printed: white with a black microphone inlaid flush in two colours, shaped from my measurements of an existing keycap, over about ten rounds of 1:1 drawings in half an hour. A screen fit frame, a coupon with five sizes of switch socket, and a first Talk keycap are on the printer as I write this.

A render of the planned keypad: a white top plate over a dark grey case, a 3.5-inch screen with session tiles at the top, a knob at the top left of the keys, and clear keycaps lit in session colours, with Deny, Approve, Talk and Interrupt keys at the bottom.

The planned case, rendered from the CAD model. The labels are placeholders.

This one will be wired by hand. A proper circuit board, with hot-swap sockets and LEDs soldered under each switch, is the next version.

What's left

  • The hooks. Everything right of them works; installing them changes the settings of every Claude Code session I run, so that waits until the keypad is in its case.
  • Talk and Interrupt. The keys exist and send their events, but don't do anything yet. Talk will hold Cadabra's dictation key.
  • The case: the fit tests, then the full print, then soldering.

Most of the code, the wiring diagrams and the CAD came from one Claude Code session, while two others drove the printers: one for the 3D printer, one for the paper. Three of my sessions building something to keep track of my sessions. The keypad will have plenty to show.