Test a GUI app with headless scripted input
A developer used one agent to build an image editor and another to exercise it through headless mouse and keyboard scripts.
- What they did
- They set up a headless sway session and a small daemon that exposed virtual keyboard and mouse input over a unix socket. A bash layer handled commands like launching the app, grabbing screenshots, moving the pointer, clicking, and typing, all documented in claude.md. Opus built the editor, while a Sonnet subagent used the scripted controls to test each tool and panel the developer described.
- How it went
- The subagent found most of the bugs on its own, so testing was largely automated. The developer still did a quick manual review, because a headless sway setup does not match a normal KDE desktop exactly.
- Tips
- If you try this, script real input events instead of leaning on accessibility APIs, since that proved more dependable here. It can also help to use a smaller tester subagent so the builder agent does not carry a long context into the test run.
Try it yourself with Claude Code
Build a small [GUI app type] in [language/toolkit] in this folder. First, make a headless test setup with a display compositor plus scripted mouse and keyboard control, and document the commands for launching the app, taking screenshots, moving the pointer, clicking, and typing. Then have a separate subagent use those controls to open the app, exercise each panel and tool I describe, and report any broken behavior. After each round, fix the issues it finds and run the test again. Before any irreversible action such as deleting files, sending data, or submitting anything, stop and ask for my approval. At the end, list anything you could not fully confirm so I can review it manually.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Turn GitHub issues into draft PRs with a long-running agent
A developer used Dots to read GitHub issues and produce rough pull request drafts, mostly as a starting point for later work.
Use Claude to build a Lean runtime for web targets
A developer had Claude help create Lasm, a Lean 4 runtime that can run across Node, browser, serverless, edge, and WASI setups.
Keep coding in batches while Claude works ahead
They paired ongoing app testing with Claude-generated edits, moving from one round of fixes to the next without waiting around.
Use Claude for UI work and Codex for server tasks
A developer split interface work and backend work between Claude and Codex after other agents failed on real projects.
Use Claude Code with a cloned Chrome login
A developer built a macOS add-on so Claude Code could browse from a copied Chrome profile while the user stayed in control of the terminal.
Automate a self-hosted stack on your own hardware
Jordan Fulghum let Claude Code configure and run several home services on a Beelink mini PC.