A hardware project that transforms a toy traffic light into a physical status indicator for Claude Code or Codex CLI using an ESP32-C3 SuperMini, with green/yellow/red LEDs to show working/waiting/idle states.

Stars

19

7-day growth

No data

Forks

1

Open issues

1

License

No data

Last updated

2026-07-21

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

This repository provides a complete, open-source hardware-software integration that gives AI coding assistants a tangible, immediate visual feedback, enhancing awareness and reducing context-switching during development.

Who it is for

  • AI coding assistant users (Claude Code, Codex CLI)
  • Hardware hobbyists and makers
  • Developers seeking physical status indicators for CLI tools
  • Electronics beginners interested in ESP32 projects

Use cases

  • Display real-time status of an AI coding assistant during development sessions
  • Provide ambient awareness of assistant activity without looking at the terminal
  • Teach basic electronics and ESP32 programming through a fun, practical project
  • Serve as a physical indicator for other CLI or event-driven systems via serial commands

Strengths

  • Complete step-by-step guide with photos, wiring diagrams, and soldering tips
  • Pre-built Arduino firmware and Python scripts for easy setup
  • Supports both Claude Code and Codex CLI with automatic hook installation
  • Uses only standard Python libraries and common, inexpensive hardware

Considerations

  • Requires soldering and some manual modification of a toy traffic light
  • Only works with Claude Code or Codex CLI (no generic hook interface)
  • Serial port must not be shared with other programs (e.g., Arduino IDE)
  • Codex CLI lacks a session-end hook; daemon relies on process tracking

README quick start

AI 编程助手红绿灯状态提示器

使用 ESP32-C3 SuperMini 改造一个淘宝红绿灯玩具,让 Claude Code 或 Codex CLI 的状态通过红、黄、绿三颗灯显示。同一时间只需要启用其中一种助手的 hook。

助手状态灯光效果
正在工作绿灯慢闪
等待用户确认、授权或选择红灯快闪
当前空闲黄灯常亮
会话结束全部熄灭

硬件

不要同时安装纽扣电池并接入 ESP32 USB 供电。改造后由 ESP32 的 3V3 供电。

接线定义

红绿灯电路板上的灯位定义如下:

灯位颜色ESP32-C3 SuperMini 引脚串联电阻
公共阳极三灯公共正极3V3不需要
L1 负极绿灯GPIO4220Ω
L2 负极黄灯GPIO3220Ω
L3 负极红灯GPIO2220Ω

接线关系:

ESP32 3V3 -> 红绿灯公共阳极

绿灯 L1 负极 -> 220Ω -> ESP32 GPIO4
黄灯 L2 负极 -> 220Ω -> ESP32 GPIO3
红灯 L3 负极 -> 220Ω -> ESP32 GPIO2

固件使用共阳极控制方式:GPIO 输出 LOW 时点亮,输出 HIGH 时熄灭。

烧录固件

Arduino 程序位于:

arduino/traffic_light_test/traffic_light_test.ino

Arduino IDE 设置:

  • Board: ESP32C3 Dev Module
  • USB CDC On Boot: Enabled
  • Port: 选择 ESP32 对应串口
  • 波特率:115200

烧录后,打开串口监视器,行结束符选择 NewlineBoth NL & CR,可以发送以下命令测试:

串口命令灯光效果
working绿灯慢闪
waiting红灯快闪
idle黄灯常亮
off全部熄灭
test红、黄、绿依次点亮
status输出当前状态

制作过程

1. 红绿灯主体

淘宝买来的红绿灯主体。

2. 面包板测试

先烧录程序,在面包板上测试 ESP32 能否通过串口命令监听助手状态,并正确控制红、黄、绿三颗灯。

查看高清 MP4

3. 准备焊接工具

准备电烙铁、焊锡丝、助焊松香、细导线、220 欧电阻、尖嘴钳,以及电风扇排烟。焊接烟雾有害,建议在通风环境下操作。

焊锡丝建议使用含锡量 >= 63% 的产品,比较容易上锡。

4. 处理较小的焊点

电路板上发光二极管负极焊点比较小,不方便直接焊接。可以用刀小心刮开一点绿油,露出下方铜箔,形成更大的焊接区域。

刮绿油前:

刮绿油后:

5. 焊接红绿灯电路板

分别焊接公共阳极、L1 负极、L2 负极、L3 负极:

  • L1 是绿灯。
  • L2 是黄灯。
  • L3 是红灯。
  • L1L2L3 负极出来的导线都需要串联 220Ω 电阻。

推荐每种灯使用对应颜色的导线,后续排查会更直观。图中 L1 绿灯用了红色线、L3 红灯用了绿色线,这是个人焊接失误

另外也可以考虑使用贴片电阻,但操作难度更高,这里使用的是普通直插电阻。

6. 剪掉开发板排针

排针太长,为了能够将开发板贴合在红绿灯外壳背后,需要剪掉 ESP32-C3 SuperMini 的排针。

7. 穿线并

Description

traffic light for claude code

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482