I Gave Claude Code a Traffic Light
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
- Decouple signal from display.
- Use AI lifecycle hooks for state changes.
- Screens are poor for ambient status.
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
- Implement a physical status light for AI agents.
- Use ESP32 or USB busy lights for visual cues.
- Explore AI agent hooks for custom integrations.
Topics
- Claude Code
- AI Agent Monitoring
- ESP32
- Physical UI
- Ambient Computing
- Lifecycle Hooks
Code references
Best for: AI Engineer, Software Engineer, AI Student
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Data Science on Medium.