dwgx@blog:~$dwgx
> cd ../posts

Ripping Claude's /effort selector out of decompiled source, 1:1

// created

claude-effort-selector is a project that reproduces that /effort selector in Claude Code 1:1. The ring of purple ripples that spreads out from the marker when you switch to ultracode — the colors, the ripple, the layout are all lifted exactly, not approximated by eyeballing a screenshot.

The approach was to decompile claude.exe directly and pull the layout constants, the color scheme for each stage, and the math behind the ultracode ripple straight out of the source, using the original values. The goal is identical, not similar.

There are two implementations. One is a terminal TUI: effort_selector.py, written in pure Python standard library, plus the entire ui/ rendering engine package it depends on — self-contained, copy it and it runs. The other is a single-file web version, claude-ultracode-effort-card.html, that opens on a double-click in the browser, no build and no dependencies. To see the effect quickly, open the web page; to nail down the details frame by frame, run the terminal.

Six stages: low / medium / high / xhigh / max / ultracode. The first few are clean gray text with an accent color, xhigh adds a shimmer sweeping across, max goes rainbow, and the closer, ultracode, is the star: purple ripples riding a cosine wave, an 8-level violet palette, white text layered on top, expanding ring by ring out from the marker. The ripple isn’t written as an inline blob of math — it’s handed to ui/field.py::Ripple for per-cell sampling, aligned with the structure of the original implementation, and every cell’s color is computed, which also makes it easy to check later.

The terminal version has a gotcha on Windows: without UTF-8 set, the purple blocks and box lines garble into question marks, so set the encoding first.

$env:PYTHONIOENCODING="utf-8"
cd effort_selector
python effort_selector.py                                      # ← / → 切换 Enter 确认 Esc 退出
python effort_selector.py --once --stage ultracode --frame 1   # 单帧 确定性 逐帧对比用

--once --stage ultracode --frame 1 gets the most use when tuning alignment: the output is deterministic, so you can compare against the original frame by frame. The whole environment is light — Python 3.x, pure standard library, zero dependencies. Since it was ripped out from the low level, there’s no reason to pile another layer of dependencies on top.