Zero-dependency web inspector built from scratch on Chrome DevTools Protocol. Semantic page understanding in under 500 tokens.
AI agents dump raw HTML into their context window. AgentLens returns structured, semantic output that actually fits.
<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"
...
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
Right panel is actual AgentLens output from github.com/login
Unedited agent.digest() output. These are not mockups.
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
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
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
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();
Every layer is ours. No third-party code at runtime. The only requirement is Chrome on the machine.
~/.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
| Method | Description |
|---|---|
| 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 |
"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"
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();
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
$ 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