AI sees the page.
Not the DOM.

Zero-dependency web inspector built from scratch on Chrome DevTools Protocol. Semantic page understanding in under 500 tokens.

$ npm install agentlens-ai

0 dependencies own browser driver

50,000 tokens vs 120

AI agents dump raw HTML into their context window. AgentLens returns structured, semantic output that actually fits.

page.content()
<div class="sc-bdnxRM jKEGSp">
  <div class="sc-gsTCUz kJHfbo">
    <div class="sc-dlfnbm iISzev">
      <span data-reactid=".0.1">
        <div class="css-1dbjc4n">
          <div class="css-901oao">
            Login
          </div>
        </div>
      </span>
      <input class="sc-kgoBCf"
...
~50,000 tokens of noise
agent.digest()
Page: Sign in to GitHub
Status: ready
Suggested: fill 2 required fields

[form] Login: 0/2 filled
  Username or email *: empty
  Password *: empty
  submit: "Submit"
[form] Continue with Google
[form] Continue with Apple
[footer] Terms, Privacy, Docs

Actions: fill form | submit
~143 tokens of signal

Right panel is actual AgentLens output from github.com/login

Real output from real sites

Unedited agent.digest() output. These are not mockups.

Hacker News — news.ycombinator.com
Page: Hacker News (news.ycombinator.com/)
Status: ready

[form] Form: 0/1 filled
    q: empty
[table] Table: (92 rows)
    Sample: 1. | Valve releases Steam Controller...
Actions: fill "Form" form
109 tokens
npm — npmjs.com
Page: npm | Home (npmjs.com/)
Status: ready
Suggested: submit search form

[nav] Header: Sign Up, Sign In, Pro, Teams, Pricing, Documentation
[form] search: 0/1 filled, submit: "Search"
    Search packages: empty
[hero] Build amazing things: CTA "Sign up for free"
[footer] Help, Advisories, Status, Contact npm

Actions: navigate to "Pro" | navigate to "Pricing" | fill search | submit
174 tokens
GitHub Login — github.com/login
Page: Sign in to GitHub (github.com/login)
Status: ready
Suggested: fill 2 required field(s): Username or email address, Password

[form] Login: 0/2 filled, 2 required empty, submit: "Submit"
    Username or email address *: empty
    Password *: empty
[form] Continue with Google
[form] Continue with Apple
[hero] Sign in to GitHub
[footer] Terms, Privacy, Docs, Contact GitHub Support

Actions: fill form | submit form
143 tokens

How it works

Launch, inspect, act
import { Browser } from "agentlens-ai/browser";
import { AgentPage } from "agentlens-ai/agent";

const browser = await Browser.launch();
const page = await browser.newPage();
const agent = new AgentPage(page);

// Understand the page
const digest = await agent.goto("https://myapp.com");
// digest.text            -> semantic page model
// digest.tokens          -> 127
// digest.suggestedAction -> "fill 2 required fields"

// Act with intent
await agent.do("log in with user@test.com / secret123");
// finds login form, fills fields, submits, waits

// Only what changed
const delta = await agent.whatChanged();
// "Navigated -> /dashboard"
// "+ [nav] Sidebar"
// "- [form] Login"
// delta.tokens -> 42

await browser.close();

Built from scratch

Every layer is ours. No third-party code at runtime. The only requirement is Chrome on the machine.

agentlens (0 npm dependencies)

browser/ own browser automation
  ws.ts          WebSocket client (RFC 6455 on node:net)
  cdp.ts         Chrome DevTools Protocol (JSON-RPC)
  launcher.ts    Find Chrome, launch headless
  page.ts        Navigate, evaluate, screenshot, click, fill

agent/ semantic intelligence
  components.ts Detect forms, navs, modals, heroes
  digest.ts      Compact page model (< 500 tokens)
  delta.ts       Only-what-changed tracking
  intent.ts      "submit form", "log in", "navigate"
  blockers.ts    Modal/spinner/cookie detection
Works everywhere, out of the box. If Chrome is on the machine, AgentLens uses it — zero download. If not (CI, containers, fresh installs), it auto-downloads Google's official Chrome for Testing build (~170MB, cached once) to ~/.agentlens/chromium/. Pages render with a standard browser profile — same User-Agent, same settings, same behavior as regular Chrome.
$ agentlens browser-status

Browser detection:

  System Chrome: /usr/bin/google-chrome
  Bundled Chrome: not downloaded

AgentLens will use system Chrome.

# Or on a fresh CI container with no Chrome:
$ agentlens install-browser

Downloading Chrome 148.0.7778.97 for linux64...
  100% (169MB / 169MB)
Chrome 148.0.7778.97 installed to ~/.agentlens/chromium

Features

Zero Dependencies
Built on Node.js builtins and CDP. Nothing to install but Chrome.
Semantic Digest
Pages as forms, navs, modals. Not flat element lists.
Intent Actions
"submit form", "log in with" instead of "click button".
Delta Tracking
Only what changed. "[no change]" = 3 tokens.
Smart Waiting
Watches spinners, network, DOM stability. Not timers.
Blocker Detection
Auto-dismiss modals, cookie banners, loading overlays.
Standard Browser Profile
Consistent rendering. Pages behave like they do in regular Chrome.
Bot Protection Aware
Detects challenge pages and reports them clearly instead of failing silently.

Agent API

MethodDescription
agent.digest()Semantic page model — components, status, suggested actions
agent.do(intent)High-level action — returns result + page delta
agent.whatChanged()Delta since last check — only what's new
agent.waitUntilReady()Smart wait — spinners, network, DOM stability
agent.dismissBlockers()Auto-close modals, banners, overlays
agent.goto(url)Navigate + wait + digest
agent.screenshot(path)Viewport screenshot

Supported intents

"submit form"
"navigate to Pricing"
"log in with user@test.com / password"
"search for [query]"
"fill form with {email: a@b.com, name: John}"
"dismiss blockers"
"wait until ready"
"scroll to [component]"
"go back"

Browser API

Direct CDP-based browser control when you need it. Also zero dependencies.

import { Browser } from "agentlens-ai/browser";

const browser = await Browser.launch();
const page = await browser.newPage();

await page.goto("https://example.com");
await page.fill("#email", "test@example.com");
await page.click("button[type=submit]");
await page.screenshot({ path: "shot.png" });

await browser.close();

Built for AI coding agents

Works with any agent that can run Node.js. Designed for use with Claude Code, Cursor, Codex, and custom autonomous agents.

Use agentlens for web inspection:
- import { Browser } from "agentlens-ai/browser"
- import { AgentPage } from "agentlens-ai/agent"
- agent.digest() for compact page understanding (< 500 tokens)
- agent.do(intent) for high-level actions
- agent.whatChanged() for delta-only updates
- Never call page.content() or innerHTML

CLI

$ agentlens init            # scaffold config + example
$ agentlens doctor --fix    # auto-patch test config
$ agentlens clean           # clear observation log
$ agentlens diff a.json b   # compare runs
$ agentlens ci              # generate CI workflow