Skip to content

robotastic/claude-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Claude Code Matrix Animation

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.

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).

Animation Details

Star Spinner

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.

Color

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.

Typewriter Text

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.

Phrases

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.

Files

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

Setup

1. Install CircuitPython Firmware

If your MatrixPortal M4 isn't already running CircuitPython:

  1. Connect the board via USB-C
  2. Double-tap the reset button to enter bootloader mode (a MATRIXBOOT drive appears)
  3. Download the latest .uf2 firmware from circuitpython.org/board/matrixportal_m4
  4. Drag the .uf2 file onto the MATRIXBOOT drive
  5. Wait for the board to reboot -- a CIRCUITPY drive will appear

2. Install Libraries and Deploy

Run the setup script:

cd ~/Projects/Circuit\ Python/claude-matrix
./setup.sh

The script will:

  • Verify the CIRCUITPY volume is mounted (at /Volumes/CIRCUITPY on macOS)
  • Install the required adafruit_display_text library via circup (or download the Adafruit bundle manually as a fallback)
  • Copy code.py to the board

Manual Setup (Alternative)

If you prefer not to use the script:

  1. Install the adafruit_display_text library into CIRCUITPY/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_text folder to CIRCUITPY/lib/
  2. Copy code.py to the root of the CIRCUITPY drive

3. Run

The animation starts automatically when the board powers on or resets. Press the reset button if needed.

Dependencies

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 driver
  • framebufferio -- framebuffer-backed display
  • displayio -- display compositing and bitmaps
  • terminalio -- built-in Terminus font
  • random -- phrase selection
  • time -- animation timing

Customization

Brightness

The display brightness defaults to 40% for comfortable viewing. Edit the value in code.py:

display.brightness = 0.4  # Range: 0.0 to 1.0

Phrases

Add 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.

Timing

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

References

About

Claude Code Vibes on a Adafruit Matrix Portal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors