convez.ai
AgenteAutomaçãoIntermediário
theperiperi

Claude Code Hardware Buddy

theperiperi/claude-code-hardware-buddy

Visualize o pensamento da IA com um servo motor físico

Ver no GitHub
InicialPluginScore · de 0 a 100

Agent 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-buddy

1 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

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

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 wireArduino pin
Purple / BrownGND
Red5V (or external supply)
Orange / YellowPin 9

Setup

Arduino

  1. Install the Arduino IDE
  2. Open arduino/servo_watcher/servo_watcher.ino
  3. Connect your Arduino via USB
  4. Select your board under Tools → Board → Arduino Uno
  5. Select your port under Tools → Port
  6. 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:

VariableWhat it doesDefault
angle += 0.02Sweep speed — lower is slower and smoother0.02
sin(angle) * 80Sweep width in degrees80

In the Python script:

VariableWhat it doesDefault
idle_for >= 1.0Seconds of silence before servo stops1.0
last_keypress_time > 0.3Ignore echoed output after typing0.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.
Ver o original no GitHub

Bom para

Relacionados