Claude Code Hardware Buddy
theperiperi/claude-code-hardware-buddy
Visualize o pensamento da IA com um servo motor físico
Ver no GitHubAgent que conecta Claude Code a um servo motor via Arduino, criando uma representação física do pensamento da IA. Enquanto o agente processa informações, o servo se move suavemente; quando aguarda input, retorna ao centro. Combina monitoramento de saída serial com controle de hardware.
Instalação
npx convez-ai theperiperi/claude-code-hardware-buddy1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Feedback visual durante sessões de programação com Claude Code
- Demonstração interativa do funcionamento de agentes de IA
- Prototipagem de interfaces hardware-software
Veredito

Projeto criativo que humaniza a experiência de trabalho com Claude Code através de feedback físico tangível. Bem documentado e acessível para quem tem familiaridade básica com Arduino e Python.
README
A tradução para o português deste README ainda está na fila.
claude-code-hardware-buddy
A small hardware project that physically reacts to Claude Code's activity. A servo motor sweeps smoothly while Claude is thinking or making edits, and returns to center when it's waiting for your input.
https://github.com/user-attachments/assets/8621e714-f6d4-4cde-b139-5bb8b2abc71e
How it works
A Python script launches Claude Code inside a pseudo-terminal and monitors its output. When output is flowing, it sends a 1 over serial to an Arduino. When output goes quiet for more than 1 second, it sends a 0. The Arduino drives a servo using a sine wave for smooth, continuous motion — no jerky direction changes.
Claude Code output → Python watcher → USB serial → Arduino → Servo
Hardware
- Arduino Uno
- Servo motor (SG90 or MG995)
- USB cable (the one that came with your Arduino)
- 3 jumper wires
If using an MG995 or any high-torque servo, power it from an external 5V supply rather than the Arduino's 5V pin. See wiring note below.
Wiring
| Servo wire | Arduino pin |
|---|---|
| Purple / Brown | GND |
| Red | 5V (or external supply) |
| Orange / Yellow | Pin 9 |
Setup
Arduino
- Install the Arduino IDE
- Open
arduino/servo_watcher/servo_watcher.ino - Connect your Arduino via USB
- Select your board under Tools → Board → Arduino Uno
- Select your port under Tools → Port
- Click Upload
Python
Install pyserial:
pip install pyserial
# or if using conda:
conda install -c conda-forge pyserial
Update the serial port in python/servo_watcher.py to match your Arduino's port:
SERIAL_PORT = '/dev/cu.usbmodem11301' # Mac (example)
# SERIAL_PORT = '/dev/ttyUSB0' # Linux (example)
# SERIAL_PORT = 'COM3' # Windows (example)
These are just examples — replace the value with the port your Arduino is actually using.
You can find the correct port name in the Arduino IDE under Tools → Port after plugging in your Arduino.
Usage
Instead of running claude directly, run:
python python/servo_watcher.py
Claude Code launches normally. Your servo will sweep while Claude is actively working and return to center when it's waiting for your input.
Tuning
In the Arduino sketch, two values are easy to adjust:
| Variable | What it does | Default |
|---|---|---|
angle += 0.02 | Sweep speed — lower is slower and smoother | 0.02 |
sin(angle) * 80 | Sweep width in degrees | 80 |
In the Python script:
| Variable | What it does | Default |
|---|---|---|
idle_for >= 1.0 | Seconds of silence before servo stops | 1.0 |
last_keypress_time > 0.3 | Ignore echoed output after typing | 0.3 |
File structure
claude-code-hardware-buddy/
├── README.md
├── arduino/
│ └── servo_watcher/
│ └── servo_watcher.ino
└── python/
└── servo_watcher.py
Notes
- The Arduino may reset when the Python script first connects via serial — this is normal. The
time.sleep(2)in the script accounts for this. - If the port name changes after replugging, check Tools → Port in the Arduino IDE.
- The servo body moving instead of the shaft means nothing is attached to the horn. Attach a light object (cardboard strip, toothpick) to give the motor something to work against.