AI agents on Windows often struggle with the basic task of "seeing" what they just did. A new open-source tool called Sightline, released by sao-coding, aims to fix this by providing a dedicated CLI for capturing UI states and mapping screen coordinates. The tool, written in Rust, acts as a passive observer for coding agents, allowing them to verify UI changes without resorting to fragile, hard-coded scripts.
Replacing the Throwaway Script
Traditional approaches involve agents writing temporary PowerShell scripts using Start-Sleep and CopyFromScreen. These methods are notoriously flaky; sleep timers are either too short, causing race conditions, or too long, wasting tokens. Sightline introduces a --settle parameter that waits until pixel data stabilizes, returning an honest settled:false if the UI remains volatile. It also handles covered windows via --hwnd capture, ensuring the agent sees the target application even if another window is on top.
Solving the DPI and Coordinate Nightmare
One of the biggest hurdles for Windows automation is DPI scaling. When a model resizes an image for analysis, pixel positions no longer match screen coordinates. Sightline returns explicit formulas mapping image pixels to screen, window, and client coordinates, accounting for per-monitor DPI scales. This allows agents to click accurately on high-DPI displays without guessing. The tool also detects popups and menus that standard capture APIs often miss, including them in the screenshot automatically.
Integration and Agent Skills
Sightline is designed for seamless integration with modern agent frameworks like Codex and Cursor. The repository includes an AGENTS.md file that serves as a one-page brief for the AI, detailing commands and error codes. For Claude Code users, it provides a specific skill file that can be copied into the local skills directory. The tool outputs single-line JSON with stable error codes, eliminating the need for agents to parse verbose prose logs.
Key Takeaways
- Passive Observation Only: Sightline never clicks or types; it only captures and reports state, leaving action to the agent's existing tools.
- Token Efficiency: Screenshots are saved to local files rather than returned as base64 strings, reducing token costs for large images.
- Robust Change Detection: The
--expect-changeflag ensures agents don't mistake static old frames for new results after an action. - Process Tree Monitoring: The
statcommand measures CPU and memory for an entire process tree, useful for debugging performance in Electron or browser-based apps. - AGPL-3.0 License: The project is open source under a strong copyleft license, requiring derivative works to remain open.
The Bottom Line
Sightline is a necessary utility for serious Windows agent development. By solving the coordinate and DPI mapping problem, it removes one of the most persistent sources of hallucination and failure in autonomous coding workflows.