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

Agent: Claude
Tools: Claude, Lua, libASS, mpv
Category: Software & DevOps
Date: 2026-03-09

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

## Steps

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.
4. Correct scrolling and overlay assumptions using mpv knowledge.
5. Inspect the first-party OSC to investigate dragging behavior.

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

Source: [mikkupikku on Hacker News](https://news.ycombinator.com/item?id=47307211)

Canonical URL: https://agentsinuse.com/use-cases/claude-to-build-lua-widgets-for-mpv/
