I Gave Claude Code a Traffic Light

· Source: Data Science on Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Internet of Things (IoT) & Connected Devices · Depth: Intermediate, medium

Summary

A developer created a physical traffic light system to provide ambient status updates for Claude Code, an AI agent. This system, built over an afternoon for \$10-\$15 using an ESP32 dev board, three LEDs, and resistors, visually indicates Claude Code's operational state. The light turns red when a prompt is submitted, yellow when Claude requires user input or permission, and green when a turn is completed or a session starts. The core mechanism involves Claude Code's built-in lifecycle hooks ("UserPromptSubmit", "Notification", "Stop", "SessionStart") executing a shell script ("light.sh"). This script sends HTTP requests to the ESP32, which then controls the LEDs. An alternative "ten-minute version" utilizes an off-the-shelf USB busy light and the `busylight` tool, eliminating the need for hardware assembly. This solution aims to provide glanceable, off-screen feedback for autonomous systems, addressing the challenge of monitoring AI agents without constant screen attention.

Key takeaway

For AI Engineers managing autonomous agents like Claude Code, you should consider implementing ambient physical status indicators. This approach frees you from constant screen monitoring, allowing your peripheral vision to track agent states (working, waiting, done). By utilizing agent lifecycle hooks, you can integrate simple, low-cost hardware like an ESP32 or a USB busy light to provide immediate, glanceable feedback, significantly improving your workflow efficiency and reducing context switching.

Key insights

Ambient physical indicators provide low-bandwidth, glanceable status for autonomous AI agents, reducing screen-based monitoring.

Principles

Method

Configure Claude Code hooks ("UserPromptSubmit", "Notification", "Stop") to run a shell script. This script sends HTTP requests to an ESP32-based web server, which controls physical LEDs based on the AI's state.

In practice

Topics

Code references

Best for: AI Engineer, Software Engineer, AI Student

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Data Science on Medium.