Why calling cloud LLMs for every browser click is an anti-pattern: I built BrowserClaw, a lightweight Dual-Brain Chrome MCP with Jev micro-loop (250ms/step)
BrowserClaw is a lightweight Chrome automation platform that uses a dual-brain architecture to optimize browser interactions for AI agents, significantly reducing latency and token usage.
Hey everyone, Like many of you building agentic workflows, I grew frustrated with the current state of browser automation (heavy Playwright sandboxes, browser-use, raw CDP wrappers). In real-world usage, three persistent bottlenecks kept breaking autonomous tasks: Insane Latency & Token Burn: Sending a 50KB accessibility tree back and forth to remote reasoning models (Claude 3.7 / GPT-4o) for every single click ("type into search bar", "click submit") takes 3β5 seconds per step and burns hundreds of thousands of tokens on trivial form sequences. Disposable Sandboxes & Windows File Locks: Disposable browser instances don't inherit active Google, GitHub, or enterprise SSO logins. Attempting to copy default user profile dirs on Windows consistently crashes with [WinError 32] exclusive sharing locks. Robotic Clicks & Broken Screenshots: Mechanical clicks get easily detected or fail on React/Vue synthetic events, while Windows display scaling (125%/150%) causes screenshot coordinate drift that completely misaligns vision models. To solve this, I built and open-sourced BrowserClaw: a lightweight Chrome automation platform pairing an MV3 extension with a local Fastify Native Messaging bridge that exposes 47 production-ready MCP tools. Here is the architectural breakdown of how it tackles these bottlenecks from the inside: π§ 1. Fast Semantic Micro-Loop powered by TypeSafe Jev (System 1) Instead of relying on a monolithic remote LLM for every single interaction, BrowserClaw introduces a Hierarchical Dual-Brain model: System 2 (Macro Planner): Your primary reasoning LLM (Claude, GPT, local 70B) stays in charge of task decomposition, long-horizon planning, and free-text generation. System 1 (Semantic Micro-Loop via chrome_act_toward_goal): A local decision loop evaluates compact DOM snapshots locally using TypeSafe Jev. It perceives, decides, and executes on-page actions at 200β400ms per step with zero intermediate remote MCP round-trips. Graceful Fallback & Guardrails: If no Jev API key is provided, it automatically falls back to an internal heuristic rule engine. If it detects sensitive keywords (pay, delete, submit) or low confidence, it safely escalates back to the macro planner with structured candidate elements. β‘ Real-World Benchmarks (real Jev API, T1βT5): T1 Navigate + Search: 2,062ms (2 Jev calls, 1,737 in / 52 out tokens) T2 Form Submit: 586ms (2 Jev calls, 1,666 in / 48 out tokens) T3 Select Option: 249ms (1 Jev call, 781 in / 24 out tokens) Single-step median: ~260β350ms | End-to-end speedup >75% | Token reduction >80%. π― 2. Fast, Human-like Kinematics with Surgical Precision Spring-Kinematics Virtual Cursor: Instead of instantaneous mechanical telemetry, BrowserClaw injects a physics-based cursor inside a Closed Shadow DOM. It enforces a natural deceleration curve within a 65px radius of targets with 80β120ms physiological settling pauses. Native Event Fidelity (isTrusted: true): Dispatches physical CDP events directly to the browser layout engine, ensuring flawless triggers across React 18/19 synthetic events, Vue reactivity, and complex Shadow DOMs. Pre-flight Occlusion Inspection: Before executing, it verifies target bounding boxes via DOM.getNodeForLocation to prevent misclicking under transparent overlays, fixed headers, or sticky modals. πΈ 3. Industrial Screenshot Pipeline (No Coordinate Drift, No Ghosting) DPR 1:1 Viewport Normalization: Uses OffscreenCanvas to resample captures to exact CSS viewport dimensions. Completely eliminates the notorious coordinate offset caused by Windows scaling (125%, 150%) or Retina displays. Flawless Full-Page Capture: Sequential scroll stitching that dynamically detects and hides position: fixed and position: sticky headers/footers during captures, eliminating duplicate ghost banners. High-Clarity ROI Sub-Region: Allows cropping dense tables or micro-captchas at unscaled native device fidelity for visual reasoning. π 4. Ultra-Lightweight: Connects Directly to Your Everyday Chrome No Heavy Sandboxes: No separate Chromium instances to spawn or manage. It connects directly to your active browser via a lightweight Chrome MV3 extension and local native host. Zero-Friction Auth: Seamlessly operates under your existing session, cookies, extensions, and corporate logins. Zero [WinError 32] file lock headaches on Windows. Full Browser Control Surface: Exposes 47 tools covering not just web interaction, but full tab management, colored Tab Groups, bookmarks, browsing history, and background API interception. The project is fully open-source under AGPL-3.0. Following the subreddit rules, I'm dropping the GitHub repo link and setup guide in the comments below! Would love to hear your thoughts, feedback, and what edge cases you encounter in daily browser automation!
A developer shares an interesting use case for running LLMs in the browser to inspect internal workings, highlighting a meaningful scenario for client-side AI.
OpenClaw with Cockroach Crawler transforms an AI agent into a powerful web research machine that can crawl JavaScript-heavy pages, extract structured data, generate PDFs, and take screenshots without separate API keys for many public sources.