Agents In Use
What’s new todayLast update
499 additions

How to use Claude to build Lua widgets for mpv

The author reports a GUI library and several working media scripts produced over a weekend, validated through demos while acknowledging likely undiscovered bugs.

Added news.ycombinator.comAgent: Claude
TRY A BOUNDED VERSION

Prompt to try

Editorial adaptation, not the source author’s exact prompt. Replace bracketed inputs and review tool permissions first.

Build [Lua widget library] for mpv using libASS subtitle drawing primitives. Include [required widgets] and an interactive demo. After feedback, use it for [media script]. Check mpv APIs and the first-party OSC when implementing scrolling, overlays and drag interactions.

What happened

The author reports a GUI library and several working media scripts produced over a weekend, validated through demos while acknowledging likely undiscovered bugs.

Reported by mikkupikku on Hacker News

How the agent did it

  1. Generate a Lua widget library from subtitle drawing primitives.
  2. Test the evolving demo during library development.
  3. Build media scripts using the generated GUI library.

Where a person stepped in

The author tested demos, read a small portion of the code and corrected API assumptions; they expected undiscovered bugs.

A person approved each step before the agent continued.

The author used Claude to generate roughly 10,000 lines of Lua for a GUI library built from libASS subtitle drawing primitives. The library included nearly two dozen widgets, with nested scrollable containers, clipping, dropdown menus, and animated tab bars. The author tested the evolving demo rather than reading the entire implementation, estimating they read about 100 lines that day.

The following day, they had Claude create several projects using the library. These included a video looping script, graphical updates to older text-only scripts, a playlist visualizer supporting drag reordering, and controls for text-to-speech reading of subtitles. Another project let viewers choose and reorder clips and export an edit decision list.

The author's familiarity with mpv guided corrections. They directed Claude to use WHEEL_LEFT and WHEEL_RIGHT for horizontal scrolling, rejected a proposed PNG overlay because that path required raw pixel data, and sent it to inspect the first-party OSC implementation for dragging behavior. They describe working demos and rapid progress, while openly expecting undiscovered bugs. The post does not establish comprehensive validation of the library.

Who it's for: Experienced mpv users building personal desktop scripts who can test interactions and correct API misunderstandings.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: Hacker News · mikkupikku

Frequently asked questions

How did the author validate the generated code?

They tested the demo Claude updated during development and read about 100 lines, rather than reviewing the entire roughly 10,000-line library.

Which mpv assumptions needed correction?

The author corrected horizontal scrolling to use WHEEL_LEFT and WHEEL_RIGHT, explained the raw-pixel overlay requirement, and directed Claude to inspect the first-party OSC for dragging behavior.

More details

Remaining steps

  1. Correct scrolling and overlay assumptions using mpv knowledge.
  2. Inspect the first-party OSC to investigate dragging behavior.

About this account

Claude generated the library, built projects on top of it and investigated existing OSC code after the author directed it there.

Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=47307211. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.

Credit: mikkupikku on Hacker News

Source published 9 Mar 2026

Source checked 14 Oct 2026

Tools and topics

Claude · Lua · libASS · mpv

Lua · mpv · GUI

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.