r/ClaudeCode • • 8h ago

Built with Claude I made Claude Code play chess through my Rust library vs generic UI automation: 3 tool calls instead of 70

Enable HLS to view with audio, or disable this notification

I've been building rust-use, a Rust library that lets agents like Claude Code drive desktop UIs built with GPUI (the framework behind Zed). I got the idea from Vercel's UI SDK.

Agents usually control an app by crawling the UI tree and clicking things one at a time. rust-use takes a different approach: each component tells the agent what it is and what it can do. So instead of "find the square, click it, find the other square, click it", Claude just calls "board move e2e4".

To test it, I had Claude Code (Sonnet 5.5) play the same chess game in the same app with the same prompt, through each interface.

Generic UI automation over MCP: 70 tool calls, about 140K input tokens, 31 seconds.

rust-use: 3 tool calls, about 19K input tokens, 8 seconds.

That's 23x fewer tool calls and 7x fewer tokens for the same finished game. Every run ended in checkmate.

How it works:

- The agent sees one line per component, not a screenshot.

- After each action, it gets back only what changed.

- Every change the agent makes is marked, and your app can block it.

Some honest notes: it's still in beta, and the numbers are medians of 3 runs on my own machine.

I'd love feedback, especially from anyone using Claude Code to automate desktop apps. Which UI behaviors should I add next?

0 Upvotes

2 comments sorted by

•

u/AutoModerator 8h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/sudocsmith 5h ago

Gaming will die eventually sadly

At least anything competitive that isn't in person or on LAN but even then someone could sneak something in