The Problem

Browser automation for AI agents is a hot mess. Most tools are either tightly coupled to their own frameworks (hi, OpenClaw, Playwright), or they rely on heavy solutions like full-page screenshots or bloated DOM snapshots that rack up token usage and costs. If you want something lightweight, framework-agnostic, and easy to integrate with your existing setup, you’re usually out of luck.

What This Does

pinchtab is a self-contained, 12MB Go binary that spins up an HTTP server and a Chrome instance for browser automation. No external dependencies, no bloated frameworks. It’s designed for AI agents but works with anything that can make HTTP requests — even curl.

The magic happens in main.go, which initializes the HTTP server and Chrome bridge. The file bridge.go sets up the communication between the server and Chrome, leveraging Chrome DevTools Protocol (CDP) to interact with web pages. Key files like handlers.go and handler_snapshot.go handle API routes, such as GET /snapshot for accessibility trees or POST /action for interactions like clicks and typing.

The project is packed with thoughtful features: intelligent text extraction (/text endpoint), stealth mode (stealth.js spoofs bot detection signals), and persistent sessions stored at ~/.pinchtab/chrome-profile. If you’re tired of logging in every time you restart your browser tool, this one’s got you covered.

Oh, and it’s dirt cheap on token usage. Instead of dumping the entire DOM, Pinchtab’s /text endpoint extracts clean, readable content — up to 13x fewer tokens compared to full snapshots.

Real-World Use

Let’s say you’re building an AI agent that needs to scrape product listings and click “Add to Cart” buttons. Here’s how you’d do it with pinchtab: Fire up the server: bash ./pinchtab Open Chrome, log in to your site, and let Pinchtab handle session persistence. Use the /snapshot API to grab a structured accessibility tree: bash curl localhost:9867/snapshot?filter=interactive Find the button’s reference ID and tell Pinchtab to click it: bash curl -X POST localhost:9867/action -d '{"kind":"click","ref":"e5"}'

No fancy SDKs or vendor lock-in. Just clean HTTP calls.

The Bottom Line

pinchtab is like the Swiss Army knife of browser automation: simple, efficient, and versatile. It’s perfect for developers who want lightweight tools that don’t dictate how you should build your system. The trade-off? It’s not a feature circus like Playwright, so if you need deep browser testing or hyper-specific actions, look elsewhere. But for AI-driven browser tasks? It’s a steal.