A CircuitPython project that replicates the Claude Code thinking animation on an Adafruit MatrixPortal M4 connected to a 64x32 RGB LED matrix panel.
When Claude Code is processing a request, it displays an animated star/asterisk spinner alongside rotating verb phrases like "Thinking", "Cooking", "Clauding", etc. This project faithfully recreates that animation on physical hardware.
- Board: Adafruit MatrixPortal M4 (SAMD51J19 Cortex M4, 512KB flash, 192KB SRAM)
- Display: 64x32 HUB-75 RGB LED matrix panel
The MatrixPortal M4 plugs directly into the back of the matrix panel via the HUB-75 connector. Power the matrix through the panel's barrel jack or screw terminals (5V, 2-4A recommended).
The star is rendered as a 7x7 pixel art bitmap centered in the top half of the display. It cycles through six frames that approximate the Unicode characters Claude Code uses:
· → ✢ → ✳ → ✶ → ✻ → ✽
(dot) (cross) (8-spoke) (6-point) (teardrop) (heavy)
The animation bounces: it plays forward through all six frames, then reverses back (skipping the endpoints to avoid stuttering). One full cycle takes 2 seconds (200ms per frame), matching the original Claude Code timing.
The star is rendered in Claude Code's signature salmon color: #D77757 / rgb(215, 119, 87). The phrase text and cursor are white (#FFFFFF) for contrast and readability.
Phrases are displayed in the bottom half of the display using CircuitPython's built-in terminalio.FONT (6x12 Terminus). The text is always the same font and size. Each phrase is typed out one character at a time with a _ cursor, mimicking a typewriter effect:
_ → T_ → Th_ → Thi_ → ... → Thinking_
After the full phrase is typed, the cursor blinks for 1.8 seconds. Then the display briefly blanks (0.25s) before the next randomly-selected phrase begins typing.
The project includes 50 verbs curated from Claude Code's built-in set of 185 spinner verbs, filtered to those that fit the 64-pixel display width (9 characters max). Examples:
Thinking, Working, Cooking, Brewing, Clauding, Vibing, Pondering, Doodling, Noodling, Wibbling, Sprouting, Zesting...
Phrases are chosen randomly with no immediate repeats.
| File | Purpose |
|---|---|
code.py |
Main CircuitPython program -- copy this to the CIRCUITPY drive |
setup.sh |
Automated script to install libraries and deploy to the board |
If your MatrixPortal M4 isn't already running CircuitPython:
- Connect the board via USB-C
- Double-tap the reset button to enter bootloader mode (a
MATRIXBOOTdrive appears) - Download the latest
.uf2firmware from circuitpython.org/board/matrixportal_m4 - Drag the
.uf2file onto theMATRIXBOOTdrive - Wait for the board to reboot -- a
CIRCUITPYdrive will appear
Run the setup script:
cd ~/Projects/Circuit\ Python/claude-matrix
./setup.shThe script will:
- Verify the
CIRCUITPYvolume is mounted (at/Volumes/CIRCUITPYon macOS) - Install the required
adafruit_display_textlibrary viacircup(or download the Adafruit bundle manually as a fallback) - Copy
code.pyto the board
If you prefer not to use the script:
- Install the
adafruit_display_textlibrary intoCIRCUITPY/lib/:- Option A:
pip3 install circup && circup install adafruit_display_text - Option B: Download the Adafruit CircuitPython Bundle, extract it, and copy the
adafruit_display_textfolder toCIRCUITPY/lib/
- Option A:
- Copy
code.pyto the root of theCIRCUITPYdrive
The animation starts automatically when the board powers on or resets. Press the reset button if needed.
Only one external library is required:
| Library | Purpose |
|---|---|
adafruit_display_text |
Text label rendering on displayio |
Everything else is built into the CircuitPython firmware:
rgbmatrix-- HUB-75 RGB matrix driverframebufferio-- framebuffer-backed displaydisplayio-- display compositing and bitmapsterminalio-- built-in Terminus fontrandom-- phrase selectiontime-- animation timing
The display brightness defaults to 40% for comfortable viewing. Edit the value in code.py:
display.brightness = 0.4 # Range: 0.0 to 1.0Add or replace phrases in the PHRASES tuple. Keep entries to 9 characters or fewer to fit the display width. The full list of Claude Code's 185 default spinner verbs can be found in the Claude Code spinner verbs repository.
Adjust these constants in code.py:
STAR_DT = 0.2 # Seconds per star animation frame (0.2 = 2s full cycle)
TYPE_DT = 0.09 # Seconds per character typed
PAUSE_S = 1.8 # Seconds to pause after phrase is fully typed
BLINK_S = 0.45 # Cursor blink interval during pause
BLANK_S = 0.25 # Blank gap between phrases- Claude Code's thinking animation analysis -- reverse engineering of the spinner characters, timing, and color
- Claude Code spinner verbs -- extracted list of all 185 default verbs
- RGB LED Matrices with CircuitPython -- Adafruit's guide for matrix setup
- MatrixPortal M4 CircuitPython page -- firmware downloads and board info