Skip to content

Give Claude Code sessions computer use on Windows - #134

Closed
m4rocks wants to merge 1 commit into
mainfrom
computer-use
Closed

m4rocks wants to merge 1 commit into
mainfrom
computer-use

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

Claude Code ships its computer-use MCP server only on macOS. A Claudiu session on Windows has no way to look at or drive an app, so agents say they can't check what they built.

Claudiu's own MCP server, claudiu --mcp-title, now serves six tools on Windows:

list_windows   visible top-level windows, frontmost first: id, process, title, bounds
focus_window   brings a window to the front, restoring it if minimized
screenshot     PNG of a window or the whole screen, saved under <data>/screenshots for the model to Read
click          x,y counted from a named window's corner, as in its screenshot, or from the screen
type_text      Unicode text; newlines and tabs press Enter and Tab
press_keys     combos like ["ctrl+s", "escape"]
  • The Win32 calls go through the existing windows-sys dependency, with four more features: Gdi, Dwm, HiDpi and KeyboardAndMouse. Screenshots copy the screen with BitBlt, which works for GPU-drawn windows like Claudiu's own. The server is per-monitor DPI aware, so a pixel in a screenshot is a pixel for click.
  • Windows gives the foreground only to the process that sent the latest input, and a background MCP server never has. The server sends a mouse input that moves nothing before SetForegroundWindow, which is what PowerToys does.
  • Settings → Claudiu tools has a new "Computer use" switch, on by default. The tools are pre-allowed like Claudiu's other tools, as the maintainer chose.
  • The tools never click or type into the Claudiu that runs the session, because that would type into the session's own terminal (see Boundaries in CLAUDE.md). Claudiu passes its pid in CLAUDIU_PID. Screenshots of that window still work, and list_windows marks it.
  • On macOS and Linux the tools aren't listed and the switch is hidden. A call that names one anyway gets "Computer use works only on Windows".
  • Claudiu deletes screenshots after a week, like the other per-session files.

Evidence

  • cargo test --locked: 552 passed. New tests cover the listing per platform and per switch, argument errors before anything moves, key combos, window picking and the refusal for the host window. They failed to compile before the change because Feature::ComputerUse didn't exist.
  • cargo clippy --locked --all-targets -- -D warnings is clean on Windows. I couldn't build for Linux or macOS here, so CI is the first check there.
  • A headless claude -p session had only these tools and PowerShell. It launched target\debug\claudiu.exe with a temporary CLAUDIU_DATA_DIR and took a screenshot of its setup window. It clicked the "Recommended trims" switch at 505,435 and took a second screenshot, in which the switch had gone from off to on. Its click on the Claudiu window running the session was refused. A first run, before the focus fix, failed with "Windows did not let … come to the front".
  • The screenshots are not committed:
    • before: %TEMP%\claudiu-cu-proof\mcpdata\screenshots\7bbed6e6-b918-4237-beef-1dd43eb6be95.png
    • after: %TEMP%\claudiu-cu-proof\mcpdata\screenshots\96faaa7c-ae7b-4f1d-819d-e25268cee792.png

Risk

  • No session has driven type_text, press_keys, a full-screen screenshot or a minimized window yet. Tests cover only their argument parsing.
  • Windows drops input sent to a window that runs as administrator. The tool reports that as an error.
  • The pre-allowed tools act on the real desktop without a prompt. The switch removes them from new sessions, and reverting this PR removes them entirely.

Claude Code ships computer use only on macOS. Claudiu's MCP server now lists
windows, takes screenshots, clicks, types and presses keys on Windows, never
in the Claudiu window that runs the session. Settings > Claudiu tools can turn
it off; elsewhere the tools are not listed.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 20, 2026 8:14am UTC

This branch was successfully deployed

1 active deployment
Preview — 6ef4afc0 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant