explaingit

loopbrew/codex-lamp

Analysis updated 2026-05-18

23PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

Connects Codex lifecycle hooks to a Bluetooth Moonside desk lamp, so the lamp's color shows whether Codex is idle, working, or waiting for approval.

Mindmap

mindmap
  root((Codex Lamp))
    Trigger
      Codex Lifecycle Hooks
      Shell Hook Script
    Daemon
      Python Background Process
      Bluetooth Connection
      State File Watching
    Lamp States
      Idle Amber
      Working Blue White
      Input Purple
    Setup
      macOS Only
      bleak Package
      Hooks Config Merge

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Get a glanceable physical signal of what your Codex coding assistant is doing without looking at the screen.

USE CASE 2

Have a lamp turn purple whenever Codex needs your approval before proceeding.

USE CASE 3

Show an animated blue and white pattern on a lamp while Codex is actively working on a task.

USE CASE 4

Customize the lamp's colors and animations for each Codex lifecycle event.

What is it built with?

PythonShellBluetoothbleak

How does it compare?

loopbrew/codex-lampaaravkashyap12/advise-project-approachabu-rayhan-alif/django-saas-kit
Stars232323
LanguagePythonPythonPython
Setup difficultymoderateeasymoderate
Complexity3/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires macOS, Python 3.10+, the bleak Bluetooth package, and a Moonside BLE lamp.

In plain English

Codex Lamp connects an AI coding tool called Codex to a physical desk lamp, so the lamp's color and animation change automatically based on what the AI is doing at any moment. Codex is a command-line coding assistant, this project adds a visual signal you can notice without looking at your screen. The lamp it works with is a Moonside lamp, which accepts Bluetooth commands to change color, brightness, and animation pattern. When Codex starts or finishes a task, the lamp turns a warm amber. While Codex is actively working, it switches to an animated blue and white pattern. When Codex needs your approval before doing something, the lamp goes purple. Each state maps to a Codex lifecycle event, and you can change the colors or animations to anything the lamp supports. The technical setup is deliberately small. A shell script runs whenever Codex fires a lifecycle hook, and all that script does is write the desired lamp state to a temporary file and make sure a background process is running. The background process, a Python script, holds the Bluetooth connection open and watches that file. When the file changes, the daemon sends the appropriate command to the lamp. Keeping the hook fast and the connection in a separate process means Codex itself is not slowed down by Bluetooth communication. The project requires macOS, Python 3.10 or later, and the Python package bleak for Bluetooth. Setup involves copying two scripts to your Codex home directory and merging a hooks configuration file that tells Codex which events to report. A test script lets you scan for your lamp by Bluetooth name and try color commands manually before hooking it into Codex. Configuration options are set through environment variables and cover things like idle timeout (the lamp turns off after 30 minutes of inactivity by default), the lamp's Bluetooth address (useful if multiple BLE devices are nearby), and the file paths the hook and daemon use to communicate.

Copy-paste prompts

Prompt 1
Help me install codex-lamp by copying the hook and daemon scripts into my Codex home directory and merging the hooks config.
Prompt 2
Walk me through testing my Moonside lamp directly with codex_lamp_test.py before wiring it into Codex.
Prompt 3
Explain how the shell hook and the Python daemon communicate through a state file without slowing Codex down.
Prompt 4
Show me how to change the lamp colors for the working and input states in codex_lamp_daemon.py.
Prompt 5
I want to set an idle timeout and a specific Bluetooth address for my lamp. Show me the environment variables for that.

Frequently asked questions

What is codex-lamp?

Connects Codex lifecycle hooks to a Bluetooth Moonside desk lamp, so the lamp's color shows whether Codex is idle, working, or waiting for approval.

What language is codex-lamp written in?

Mainly Python. The stack also includes Python, Shell, Bluetooth.

How hard is codex-lamp to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is codex-lamp for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.